diff --git a/.golangci.yml b/.golangci.yml index bdcc9b8d8b8..5d16ff2fae4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -92,6 +92,16 @@ issues: - path: stan_scaler.go linters: - dupl + # Exclude for mongo_scaler and couchdb_scaler, reason: + # pkg/scalers/couchdb_scaler.go:144: 144-174 lines are duplicate of `pkg/scalers/mongo_scaler.go:155-185` (dupl) + - path: couchdb_scaler.go + linters: + - dupl + # Exclude for mongo_scaler and couchdb_scaler, reason: + # pkg/scalers/mongo_scaler.go:155: 155-185 lines are duplicate of `pkg/scalers/couchdb_scaler.go:144-174` (dupl) + - path: mongo_scaler.go + linters: + - dupl linters-settings: funlen: @@ -102,3 +112,5 @@ linters-settings: - standard - default - prefix(github.com/kedacore/keda) + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a6531c2be94..12d6c89a10b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio ### New + +- **General:** Introduce new CouchDB Scaler ([#3746](https://github.com/kedacore/keda/issues/3746)) - **General**: Introduction deprecation & breaking change policy ([Governance #68](https://github.com/kedacore/governance/issues/68)) - **General**: Consolidate all exposed Prometheus Metrics in KEDA Operator ([#3919](https://github.com/kedacore/keda/issues/3919)) - **General**: Disable response compression for k8s restAPI in client-go ([#3863](https://github.com/kedacore/keda/issues/3863)). Kubernetes issue for reference (https://github.com/kubernetes/kubernetes/issues/112296) diff --git a/go.mod b/go.mod index 9bbfe339eab..bee6250c5a0 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,9 @@ require ( github.com/denisenkom/go-mssqldb v0.12.3 github.com/dysnix/predictkube-libs v0.0.4-0.20220717101015-44c816c4fb9c github.com/dysnix/predictkube-proto v0.0.0-20220713123213-7135dce1e9c9 - github.com/elastic/go-elasticsearch/v7 v7.17.7 + github.com/elastic/go-elasticsearch/v7 v7.17.1 + github.com/go-kivik/couchdb/v3 v3.3.0 + github.com/go-kivik/kivik/v3 v3.2.3 github.com/go-logr/logr v1.2.3 github.com/go-playground/validator/v10 v10.11.1 github.com/go-redis/redis/v8 v8.11.5 @@ -35,6 +37,7 @@ require ( github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.9 + github.com/google/uuid v1.3.0 github.com/gophercloud/gophercloud v1.1.0 github.com/hashicorp/vault/api v1.8.2 github.com/imdario/mergo v0.3.13 @@ -163,7 +166,6 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect diff --git a/go.sum b/go.sum index ae172c0a511..1e2306ea97f 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -135,6 +136,8 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Huawei/gophercloud v1.0.21 h1:HhtzZzRGZiVmLypqHlXrGAcdC1TJW99FLewfPSVktpY= github.com/Huawei/gophercloud v1.0.21/go.mod h1:TUtAO2PE+Nj7/QdfUXbhi5Xu0uFKVccyukPA7UCxD9w= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= @@ -241,8 +244,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8 github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/elastic/go-elasticsearch/v7 v7.17.7 h1:pcYNfITNPusl+cLwLN6OLmVT+F73Els0nbaWOmYachs= -github.com/elastic/go-elasticsearch/v7 v7.17.7/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= +github.com/elastic/go-elasticsearch/v7 v7.17.1 h1:49mHcHx7lpCL8cW1aioEwSEVKQF3s+Igi4Ye/QTWwmk= +github.com/elastic/go-elasticsearch/v7 v7.17.1/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20220417044921-416226498f94 h1:VIy7cdK7ufs7ctpTFkXJHm1uP3dJSnCGSPysEICB1so= github.com/emicklei/go-restful v2.16.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -271,6 +274,8 @@ github.com/favadi/protoc-go-inject-tag v1.3.0/go.mod h1:SSkUBgfqw2IJ2p7NPNKWk0Id github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flimzy/diff v0.1.5/go.mod h1:lFJtC7SPsK0EroDmGTSrdtWKAxOk3rO+q+e04LL05Hs= +github.com/flimzy/testy v0.1.17-0.20190521133342-95b386c3ece6/go.mod h1:3szguN8NXqgq9bt9Gu8TQVj698PJWmyx/VY1frwwKrM= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= @@ -297,6 +302,14 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kivik/couchdb/v3 v3.3.0 h1:xipDIw66Sqei550OzSXWlLmJ9y01fMbBLkX0F/snjnw= +github.com/go-kivik/couchdb/v3 v3.3.0/go.mod h1:idTUN/G5HGE+YP2EgW+dvZ5ODkdhvddcU7ZzFZfwN6Q= +github.com/go-kivik/kivik/v3 v3.0.1/go.mod h1:7tmQDvkta/pcijpUjLMsQ9HJUELiKD5zm6jQ3Gb9cxE= +github.com/go-kivik/kivik/v3 v3.2.0/go.mod h1:chqVuHKAU9j2C7qL0cAH2FCO26oL+0B4aIBeCRMnLa8= +github.com/go-kivik/kivik/v3 v3.2.3 h1:ZFGR3hMDa+AUmPUCQxq4da3+3C4awdFQwdOtjLS+MxM= +github.com/go-kivik/kivik/v3 v3.2.3/go.mod h1:chqVuHKAU9j2C7qL0cAH2FCO26oL+0B4aIBeCRMnLa8= +github.com/go-kivik/kiviktest/v3 v3.0.4 h1:mHX/9gpz5VdSOOOs7sN0/6iLK6jQcLiYbteEd33cKNo= +github.com/go-kivik/kiviktest/v3 v3.0.4/go.mod h1:sqsz3M2sJxTxAUdOj+2SU21y4phcpYc0FJIn+hbf1D0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -462,6 +475,9 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v1.1.0 h1:xlsBMeBi0KJ56RBW6GJ2laJJKbtlpObj5HwQzggYAsA= github.com/gophercloud/gophercloud v1.1.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= @@ -709,6 +725,15 @@ github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/otiai10/copy v1.0.2/go.mod h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY= +github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776/go.mod h1:3HNVkVOU7vZeFXocWuvtcS0XSFLcf2XUSDHkq9t1jU4= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= @@ -871,6 +896,9 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.com/flimzy/testy v0.0.3/go.mod h1:YObF4cq711ubd/3U0ydRQQVz7Cnq/ChgJpVwNr/AJac= +gitlab.com/flimzy/testy v0.9.1 h1:c255KNz+9lqkMAmC4TYngLP1mOkBJ30KziNgz9r7apk= +gitlab.com/flimzy/testy v0.9.1/go.mod h1:4Yy2aelUY6IgRmd3jHgGWewZLNMQZWQTlwyuMW642Mc= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= diff --git a/pkg/scalers/couchdb_scaler.go b/pkg/scalers/couchdb_scaler.go new file mode 100644 index 00000000000..d10d0d1d87d --- /dev/null +++ b/pkg/scalers/couchdb_scaler.go @@ -0,0 +1,240 @@ +package scalers + +import ( + "context" + "encoding/json" + "fmt" + "net" + "strconv" + + couchdb "github.com/go-kivik/couchdb/v3" + "github.com/go-kivik/kivik/v3" + "github.com/go-logr/logr" + v2 "k8s.io/api/autoscaling/v2" + "k8s.io/metrics/pkg/apis/external_metrics" + + kedautil "github.com/kedacore/keda/v2/pkg/util" +) + +type couchDBScaler struct { + metricType v2.MetricTargetType + metadata *couchDBMetadata + client *kivik.Client + logger logr.Logger +} + +type couchDBQueryRequest struct { + Selector map[string]interface{} `json:"selector"` + Fields []string `json:"fields"` +} + +type couchDBMetadata struct { + connectionString string + host string + port string + username string + password string + dbName string + query string + queryValue int64 + activationQueryValue int64 + metricName string + scalerIndex int +} + +type Res struct { + ID string `json:"_id"` + Feet int `json:"feet"` + Greeting string `json:"greeting"` +} + +func (s *couchDBScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec { + externalMetric := &v2.ExternalMetricSource{ + Metric: v2.MetricIdentifier{ + Name: GenerateMetricNameWithIndex(s.metadata.scalerIndex, s.metadata.metricName), + }, + Target: GetMetricTarget(s.metricType, s.metadata.queryValue), + } + metricSpec := v2.MetricSpec{ + External: externalMetric, Type: externalMetricType, + } + return []v2.MetricSpec{metricSpec} +} + +func (s couchDBScaler) Close(ctx context.Context) error { + if s.client != nil { + err := s.client.Close(ctx) + if err != nil { + s.logger.Error(err, fmt.Sprintf("failed to close couchdb connection, because of %v", err)) + return err + } + } + return nil +} + +func (s *couchDBScaler) getQueryResult(ctx context.Context) (int64, error) { + db := s.client.DB(ctx, s.metadata.dbName) + var request couchDBQueryRequest + err := json.Unmarshal([]byte(s.metadata.query), &request) + if err != nil { + s.logger.Error(err, fmt.Sprintf("Couldn't unmarshal query string because of %v", err)) + return 0, err + } + rows, err := db.Find(ctx, request, nil) + if err != nil { + s.logger.Error(err, fmt.Sprintf("failed to fetch rows because of %v", err)) + return 0, err + } + var count int64 + for rows.Next() { + count++ + res := Res{} + if err := rows.ScanDoc(&res); err != nil { + s.logger.Error(err, fmt.Sprintf("failed to scan the doc because of %v", err)) + return 0, err + } + } + return count, nil +} + +func (s *couchDBScaler) IsActive(ctx context.Context) (bool, error) { + result, err := s.getQueryResult(ctx) + if err != nil { + s.logger.Error(err, fmt.Sprintf("failed to get query result by couchDB, because of %v", err)) + return false, err + } + return result > s.metadata.activationQueryValue, nil +} + +func parseCouchDBMetadata(config *ScalerConfig) (*couchDBMetadata, string, error) { + var connStr string + var err error + meta := couchDBMetadata{} + + if val, ok := config.TriggerMetadata["query"]; ok { + meta.query = val + } else { + return nil, "", fmt.Errorf("no query given") + } + + if val, ok := config.TriggerMetadata["queryValue"]; ok { + queryValue, err := strconv.ParseInt(val, 10, 64) + if err != nil { + return nil, "", fmt.Errorf("failed to convert %v to int, because of %v", queryValue, err.Error()) + } + meta.queryValue = queryValue + } else { + return nil, "", fmt.Errorf("no queryValue given") + } + + meta.activationQueryValue = 0 + if val, ok := config.TriggerMetadata["activationQueryValue"]; ok { + activationQueryValue, err := strconv.ParseInt(val, 10, 64) + if err != nil { + return nil, "", fmt.Errorf("failed to convert %v to int, because of %v", activationQueryValue, err.Error()) + } + meta.activationQueryValue = activationQueryValue + } + + meta.dbName, err = GetFromAuthOrMeta(config, "dbName") + if err != nil { + return nil, "", err + } + + switch { + case config.AuthParams["connectionString"] != "": + meta.connectionString = config.AuthParams["connectionString"] + case config.TriggerMetadata["connectionStringFromEnv"] != "": + meta.connectionString = config.ResolvedEnv[config.TriggerMetadata["connectionStringFromEnv"]] + default: + meta.connectionString = "" + meta.host, err = GetFromAuthOrMeta(config, "host") + if err != nil { + return nil, "", err + } + + meta.port, err = GetFromAuthOrMeta(config, "port") + if err != nil { + return nil, "", err + } + + meta.username, err = GetFromAuthOrMeta(config, "username") + if err != nil { + return nil, "", err + } + + if config.AuthParams["password"] != "" { + meta.password = config.AuthParams["password"] + } else if config.TriggerMetadata["passwordFromEnv"] != "" { + meta.password = config.ResolvedEnv[config.TriggerMetadata["passwordFromEnv"]] + } + if len(meta.password) == 0 { + return nil, "", fmt.Errorf("no password given") + } + } + + if meta.connectionString != "" { + connStr = meta.connectionString + } else { + // Build connection str + addr := net.JoinHostPort(meta.host, meta.port) + // addr := fmt.Sprintf("%s:%s", meta.host, meta.port) + // auth := fmt.Sprintf("%s:%s", meta.username, meta.password) + connStr = "http://" + addr + } + if val, ok := config.TriggerMetadata["metricName"]; ok { + meta.metricName = kedautil.NormalizeString(fmt.Sprintf("couchdb-%s", val)) + } + meta.metricName = GenerateMetricNameWithIndex(config.ScalerIndex, kedautil.NormalizeString(fmt.Sprintf("coucdb-%s", meta.dbName))) + meta.scalerIndex = config.ScalerIndex + return &meta, connStr, nil +} + +func NewCouchDBScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { + metricType, err := GetMetricTargetType(config) + if err != nil { + return nil, fmt.Errorf("error getting scaler metric type: %s", err) + } + + meta, connStr, err := parseCouchDBMetadata(config) + if err != nil { + return nil, fmt.Errorf("failed to parsing couchDB metadata, because of %v", err) + } + + client, err := kivik.New("couch", connStr) + if err != nil { + return nil, fmt.Errorf("%v", err) + } + + err = client.Authenticate(context.TODO(), couchdb.BasicAuth("admin", meta.password)) + if err != nil { + return nil, err + } + + isconnected, err := client.Ping(ctx) + if !isconnected { + return nil, fmt.Errorf("%v", err) + } + if err != nil { + return nil, fmt.Errorf("failed to ping couchDB, because of %v", err) + } + + return &couchDBScaler{ + metricType: metricType, + metadata: meta, + client: client, + logger: InitializeLogger(config, "couchdb_scaler"), + }, nil +} + +// GetMetrics query from couchDB,and return to external metrics +func (s *couchDBScaler) GetMetrics(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, error) { + num, err := s.getQueryResult(ctx) + if err != nil { + return []external_metrics.ExternalMetricValue{}, fmt.Errorf("failed to inspect couchdb, because of %v", err) + } + + metric := GenerateMetricInMili(metricName, float64(num)) + + return append([]external_metrics.ExternalMetricValue{}, metric), nil +} diff --git a/pkg/scalers/couchdb_scaler_test.go b/pkg/scalers/couchdb_scaler_test.go new file mode 100644 index 00000000000..03eff1d63e4 --- /dev/null +++ b/pkg/scalers/couchdb_scaler_test.go @@ -0,0 +1,96 @@ +package scalers + +import ( + "context" + "testing" + + _ "github.com/go-kivik/couchdb/v3" + "github.com/go-kivik/kivik/v3" + "github.com/go-logr/logr" +) + +var testCouchDBResolvedEnv = map[string]string{ + "CouchDB_CONN_STR": "http://admin:YeFvQno9LylIm5MDgwcV@localhost:5984/", + "CouchDB_PASSWORD": "YeFvQno9LylIm5MDgwcV", +} + +type parseCouchDBMetadataTestData struct { + metadata map[string]string + authParams map[string]string + resolvedEnv map[string]string + raisesError bool +} + +type couchDBMetricIdentifier struct { + metadataTestData *parseCouchDBMetadataTestData + scalerIndex int + name string +} + +var testCOUCHDBMetadata = []parseCouchDBMetadataTestData{ + // No metadata + { + metadata: map[string]string{}, + authParams: map[string]string{}, + resolvedEnv: testCouchDBResolvedEnv, + raisesError: true, + }, + // connectionStringFromEnv + { + metadata: map[string]string{"query": `{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }`, "queryValue": "1", "connectionStringFromEnv": "CouchDB_CONN_STR", "dbName": "animals"}, + authParams: map[string]string{}, + resolvedEnv: testCouchDBResolvedEnv, + raisesError: false, + }, + // with metric name + { + metadata: map[string]string{"query": `{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }`, "queryValue": "1", "connectionStringFromEnv": "CouchDB_CONN_STR", "dbName": "animals"}, + authParams: map[string]string{}, + resolvedEnv: testCouchDBResolvedEnv, + raisesError: false, + }, + // from trigger auth + { + metadata: map[string]string{"query": `{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }`, "queryValue": "1"}, + authParams: map[string]string{"dbName": "animals", "host": "localhost", "port": "5984", "username": "admin", "password": "YeFvQno9LylIm5MDgwcV"}, + resolvedEnv: testCouchDBResolvedEnv, + raisesError: false, + }, + // wrong activationQueryValue + { + metadata: map[string]string{"query": `{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }`, "queryValue": "1", "activationQueryValue": "1", "connectionStringFromEnv": "CouchDB_CONN_STR", "dbName": "animals"}, + authParams: map[string]string{}, + resolvedEnv: testCouchDBResolvedEnv, + raisesError: true, + }, +} + +var couchDBMetricIdentifiers = []couchDBMetricIdentifier{ + {metadataTestData: &testCOUCHDBMetadata[2], scalerIndex: 0, name: "s0-s0-coucdb-animals"}, + {metadataTestData: &testCOUCHDBMetadata[2], scalerIndex: 1, name: "s1-s1-coucdb-animals"}, +} + +func TestParseCouchDBMetadata(t *testing.T) { + for _, testData := range testCOUCHDBMetadata { + _, _, err := parseCouchDBMetadata(&ScalerConfig{TriggerMetadata: testData.metadata, AuthParams: testData.authParams}) + if err != nil && !testData.raisesError { + t.Error("Expected success but got error:", err) + } + } +} + +func TestCouchDBGetMetricSpecForScaling(t *testing.T) { + for _, testData := range couchDBMetricIdentifiers { + meta, _, err := parseCouchDBMetadata(&ScalerConfig{ResolvedEnv: testData.metadataTestData.resolvedEnv, AuthParams: testData.metadataTestData.authParams, TriggerMetadata: testData.metadataTestData.metadata, ScalerIndex: testData.scalerIndex}) + if err != nil { + t.Fatal("Could not parse metadata:", err) + } + mockCouchDBScaler := couchDBScaler{"", meta, &kivik.Client{}, logr.Discard()} + + metricSpec := mockCouchDBScaler.GetMetricSpecForScaling(context.Background()) + metricName := metricSpec[0].External.Metric.Name + if metricName != testData.name { + t.Error("Wrong External metric source name:", metricName) + } + } +} diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index 568064ea881..b246e279ff1 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -552,6 +552,8 @@ func buildScaler(ctx context.Context, client client.Client, triggerType string, return scalers.NewAzureServiceBusScaler(ctx, config) case "cassandra": return scalers.NewCassandraScaler(config) + case "couchdb": + return scalers.NewCouchDBScaler(ctx, config) case "cpu": return scalers.NewCPUMemoryScaler(corev1.ResourceCPU, config) case "cron": diff --git a/tests/scalers/couchdb/couchdb_test.go b/tests/scalers/couchdb/couchdb_test.go new file mode 100644 index 00000000000..6fcf04a4c76 --- /dev/null +++ b/tests/scalers/couchdb/couchdb_test.go @@ -0,0 +1,382 @@ +//go:build e2e +// +build e2e + +package couchdb_test + +import ( + "bytes" + "context" + "encoding/base64" + "fmt" + "io" + "strings" + "testing" + "time" + + "github.com/google/uuid" + "github.com/joho/godotenv" + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + . "github.com/kedacore/keda/v2/tests/helper" +) + +// Load environment variables from .env file +var _ = godotenv.Load("../../.env") + +const ( + testName = "couchdb-test" +) + +var ( + testNamespace = fmt.Sprintf("%s-ns", testName) + deploymentName = fmt.Sprintf("%s-deployment", testName) + secretName = fmt.Sprintf("%s-secret", testName) + triggerAuthName = fmt.Sprintf("%s-ta", testName) + scaledObjectName = fmt.Sprintf("%s-sj", testName) + couchdbNamespace = "couchdb-ns" + couchdbUser = "admin" + couchdbHelmRepo = "https://apache.github.io/couchdb-helm" + couchdbDBName = "animals" + minReplicaCount = 1 + maxReplicaCount = 2 +) + +type templateData struct { + TestNamespace string + DeploymentName string + HostName string + Port string + Username string + Password string + CouchDBNamespace string + SecretName string + TriggerAuthName string + ScaledObjectName string + Connection, Base64Connection string + Database string +} + +const ( + deploymentTemplate = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{.DeploymentName}} + namespace: {{.TestNamespace}} + labels: + app: {{.DeploymentName}} +spec: + replicas: 1 + selector: + matchLabels: + app: {{.DeploymentName}} + template: + metadata: + labels: + app: {{.DeploymentName}} + spec: + containers: + - name: nginx + image: nginx:alpine +` + + secretTemplate = ` +apiVersion: v1 +kind: Secret +metadata: + name: {{.SecretName}} + namespace: {{.TestNamespace}} +data: + connectionString: {{.Base64Connection}} + username: {{.Username}} + password: {{.Password}} +` + triggerAuthTemplate = `apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: {{.TriggerAuthName}} + namespace: {{.TestNamespace}} +spec: + secretTargetRef: + - parameter: password + name: {{.SecretName}} + key: password + - parameter: username + name: {{.SecretName}} + key: username +` + scaledObjectTemplate = ` +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: {{.ScaledObjectName}} + namespace: {{.TestNamespace}} +spec: + scaleTargetRef: + name: {{.DeploymentName}} + minReplicaCount: 1 + maxReplicaCount: 2 + triggers: + - type: couchdb + metadata: + host: {{.HostName}} + port: "5984" + dbName: "animals" + queryValue: "1" + query: '{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }' + activationQueryValue: "1" + metricName: "global-metric" + authenticationRef: + name: {{.TriggerAuthName}} +` +) + +func CreateKubernetesResourcesCouchDB(t *testing.T, kc *kubernetes.Clientset, nsName string, data interface{}, templates []Template) { + KubectlApplyMultipleWithTemplate(t, data, templates) +} + +func TestCouchDBScaler(t *testing.T) { + // Create kubernetes resources + kc := GetKubernetesClient(t) + // setup couchdb + CreateNamespace(t, kc, testNamespace) + installCouchDB(t) + + data, templates := getTemplateData(kc) + CreateKubernetesResourcesCouchDB(t, kc, testNamespace, data, templates) + + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, minReplicaCount, 60, 3), + "replica count should be %d after 3 minutes", minReplicaCount) + + // test scaling + testActivation(t, kc) + testScaleUp(t, kc) + testScaleDown(t, kc) + + // cleanup + DeleteKubernetesResources(t, kc, testNamespace, data, templates) +} + +func generateUUID() string { + id := strings.ReplaceAll(uuid.New().String(), "-", "") + return id +} + +func installCouchDB(t *testing.T) { + _, err := ExecuteCommand(fmt.Sprintf("helm repo add couchdb %s", couchdbHelmRepo)) + assert.NoErrorf(t, err, "cannot execute command - %s", err) + _, err = ExecuteCommand("helm repo update") + assert.NoErrorf(t, err, "cannot execute command - %s", err) + uuid := generateUUID() + _, err = ExecuteCommand(fmt.Sprintf("helm install test-release --set couchdbConfig.couchdb.uuid=%s --namespace %s couchdb/couchdb", uuid, testNamespace)) + assert.NoErrorf(t, err, "cannot execute command - %s", err) +} + +func getPassword(kc *kubernetes.Clientset, namespace string) string { + secret, _ := kc.CoreV1().Secrets(namespace).Get(context.Background(), "test-release-couchdb", metav1.GetOptions{}) + encodedPassword := secret.Data["adminPassword"] + password := string(encodedPassword) + return password +} + +func WaitForDeploymentReplicaCountChangeCouchDB(t *testing.T, kc *kubernetes.Clientset, name, namespace string, iterations, intervalSeconds int) bool { + t.Log("Waiting for some time to see if deployment replica count changes") + var replicas, prevReplicas int32 + prevReplicas = -1 + + for i := 0; i < iterations; i++ { + deployment, _ := kc.AppsV1().Deployments(namespace).Get(context.Background(), name, metav1.GetOptions{}) + replicas = deployment.Status.Replicas + + t.Logf("Deployment - %s, Current - %d", name, replicas) + + if replicas != prevReplicas && prevReplicas != -1 { + break + } + + prevReplicas = replicas + time.Sleep(time.Duration(intervalSeconds) * time.Second) + } + + return int(replicas) > 1 +} + +func deployPod(t *testing.T, kc *kubernetes.Clientset, podName, args string) { + podSpec := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod-couchdb-" + podName, + Namespace: testNamespace, + }, + Spec: corev1.PodSpec{ + RestartPolicy: "OnFailure", + Containers: []corev1.Container{ + { + Name: "test-couchdb-container", + Image: "nginx:alpine", + Command: []string{"curl"}, + Args: strings.Split(args, " "), + }, + }, + }, + } + + _, err := kc.CoreV1().Pods(testNamespace).Create(context.Background(), podSpec, metav1.CreateOptions{}) + if err != nil { + assert.NoErrorf(t, err, "cannot create pod - %s", err) + } +} + +func testActivation(t *testing.T, kc *kubernetes.Clientset) { + t.Log("--- testing activation ---") + password := getPassword(kc, testNamespace) + if WaitForStatefulsetReplicaReadyCount(t, kc, "test-release-couchdb", testNamespace, 3, 15, 1) { + dsn := fmt.Sprintf("http://admin:%s@test-release-svc-couchdb.%s.svc.cluster.local:5984/animals", password, testNamespace) + cmd := "-vX PUT " + dsn + deployPod(t, kc, "activation", cmd) + AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, testNamespace, minReplicaCount, 5) + } +} + +func insertRecord(t *testing.T, kc *kubernetes.Clientset, password, record, name, uuid string) { + dsn := fmt.Sprintf(`http://admin:%s@test-release-svc-couchdb.%s.svc.cluster.local:5984/animals/%s`, password, testNamespace, uuid) + cmd := ` -X PUT ` + dsn + ` -d ` + record + deployPod(t, kc, name, cmd) +} + +func deployPodDelete(t *testing.T, kc *kubernetes.Clientset, podName, args string) { + podSpec := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod-couchdb-" + podName, + Namespace: testNamespace, + }, + Spec: corev1.PodSpec{ + RestartPolicy: "OnFailure", + Containers: []corev1.Container{ + { + Name: "test-couchdb-container", + Image: "nginx:alpine", + Command: []string{"curl"}, + Args: strings.Split(args, " "), + }, + }, + }, + } + _, err := kc.CoreV1().Pods(testNamespace).Create(context.Background(), podSpec, metav1.CreateOptions{}) + if err != nil { + assert.NoErrorf(t, err, "couldn't create pod - %s", err) + } +} + +func deleteRecord(t *testing.T, kc *kubernetes.Clientset, password, name, uuid, rev string) { + dsn := fmt.Sprintf("http://admin:%s@test-release-svc-couchdb.%s.svc.cluster.local:5984/animals/%s?rev=%s", password, testNamespace, uuid, rev) + cmd := " -X DELETE " + dsn + deployPodDelete(t, kc, name, cmd) +} + +type PodLog struct { + OK bool `json:"ok"` + ID string `json:"id"` + Rev string `json:"rev"` +} + +func getPodLogs(kc *kubernetes.Clientset, podName string) (string, error) { + podLogOpts := corev1.PodLogOptions{} + req := kc.CoreV1().Pods(testNamespace).GetLogs(podName, &podLogOpts) + podLogs, err := req.Stream(context.Background()) + if err != nil { + return "", err + } + defer podLogs.Close() + + buf := new(bytes.Buffer) + _, err = io.Copy(buf, podLogs) + if err != nil { + return "", err + } + str := buf.String() + chars := str[strings.Index(str, `"rev":`)+7 : strings.Index(str, `}`)-1] + return chars, nil +} + +func testScaleUp(t *testing.T, kc *kubernetes.Clientset) { + t.Log("--- testing scale up ---") + password := getPassword(kc, testNamespace) + if WaitForStatefulsetReplicaReadyCount(t, kc, "test-release-couchdb", testNamespace, 3, 1, 1) { + record := `{ + "_id":"Cow", + "feet":4, + "greeting":"moo" + }` + insertRecord(t, kc, password, record, "scaleup-1", "e488df68180d4c759d38bcf0881faca1") + time.Sleep(time.Second * 60) + _, err := getPodLogs(kc, "test-pod-couchdb-scaleup-1") + if err != nil { + assert.NoErrorf(t, err, "couldn't get pods logs for scaleup-1 - %s", err) + } + record = `{ + "_id":"Cat", + "feet":4, + "greeting":"meow" + }` + insertRecord(t, kc, password, record, "scaleup-2", "818bba66323b40bf83f42c04374cab23") + time.Sleep(time.Second * 60) + _, err = getPodLogs(kc, "test-pod-couchdb-scaleup-2") + if err != nil { + assert.NoErrorf(t, err, "couldn't get pods logs for scaleup-2 - %s", err) + } + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, maxReplicaCount, 60, 1), + "replica count should be %d after 1 minute", maxReplicaCount) + time.Sleep(time.Second * 60) + } +} + +func testScaleDown(t *testing.T, kc *kubernetes.Clientset) { + t.Log("--- testing scale down ---") + password := getPassword(kc, testNamespace) + if WaitForStatefulsetReplicaReadyCount(t, kc, "test-release-couchdb", testNamespace, 3, 1, 1) { + rev1, err := getPodLogs(kc, "test-pod-couchdb-scaleup-1") + if err != nil { + assert.NoErrorf(t, err, "couldn't get pods logs for scaleup-1 - %s", err) + } + deleteRecord(t, kc, password, "scaledown-1", "e488df68180d4c759d38bcf0881faca1", rev1) + rev2, err := getPodLogs(kc, "test-pod-couchdb-scaleup-2") + if err != nil { + assert.NoErrorf(t, err, "couldn't get pods logs for scaleup-1 - %s", err) + } + deleteRecord(t, kc, password, "scaledown-2", "818bba66323b40bf83f42c04374cab23", rev2) + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, minReplicaCount, 300, 1), + "replica count should be %d after 5 minutes", minReplicaCount) + time.Sleep(time.Second * 60) + } +} + +func getTemplateData(kc *kubernetes.Clientset) (templateData, []Template) { + password := getPassword(kc, testNamespace) + passwordEncoded := base64.StdEncoding.EncodeToString([]byte(password)) + connectionString := fmt.Sprintf("http://test-release-svc-couchdb.%s.svc.cluster.local:5984", testNamespace) + hostName := fmt.Sprintf("test-release-svc-couchdb.%s.svc.cluster.local", testNamespace) + base64ConnectionString := base64.StdEncoding.EncodeToString([]byte(connectionString)) + return templateData{ + TestNamespace: testNamespace, + DeploymentName: deploymentName, + HostName: hostName, + Port: "5984", + Username: base64.StdEncoding.EncodeToString([]byte(couchdbUser)), + Password: passwordEncoded, + TriggerAuthName: triggerAuthName, + SecretName: secretName, + ScaledObjectName: scaledObjectName, + CouchDBNamespace: couchdbNamespace, + Database: couchdbDBName, + Connection: connectionString, + Base64Connection: base64ConnectionString, + }, []Template{ + {Name: "deploymentTemplate", Config: deploymentTemplate}, + {Name: "secretTemplate", Config: secretTemplate}, + {Name: "triggerAuthTemplate", Config: triggerAuthTemplate}, + {Name: "scaledObjectTemplate", Config: scaledObjectTemplate}, + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/CHANGELOG.md b/vendor/github.com/elastic/go-elasticsearch/v7/CHANGELOG.md index b79211ca4b8..0a10a5b0d11 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/CHANGELOG.md +++ b/vendor/github.com/elastic/go-elasticsearch/v7/CHANGELOG.md @@ -1,10 +1,3 @@ -# v7.17.7 - -## Client - -* Added the option to override the `Content-Type` to enable usage of alternative serialization. ([#542](https://github.com/elastic/go-elasticsearch/pull/542)) -* API is compatible with Elasticsearch 7.17.7 - # v7.17.1 ## Client diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/Makefile b/vendor/github.com/elastic/go-elasticsearch/v7/Makefile index d034af25456..6de347bf17c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/Makefile +++ b/vendor/github.com/elastic/go-elasticsearch/v7/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash -ELASTICSEARCH_DEFAULT_BUILD_VERSION = "7.17.7-SNAPSHOT" +ELASTICSEARCH_DEFAULT_BUILD_VERSION = "7.17.1-SNAPSHOT" ##@ Test test-unit: ## Run unit tests @@ -267,7 +267,7 @@ godoc: ## Display documentation for the package godoc --http=localhost:6060 --play cluster: ## Launch an Elasticsearch cluster with Docker - $(eval version ?= "elasticsearch:7.17.4-SNAPSHOT") + $(eval version ?= "elasticsearch:7.17.1-SNAPSHOT") $(eval flavor ?= "core") $(eval elasticsearch_url = "http://es1:9200") diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/README.md b/vendor/github.com/elastic/go-elasticsearch/v7/README.md index 533b3d5ed85..0290aff22c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/README.md +++ b/vendor/github.com/elastic/go-elasticsearch/v7/README.md @@ -187,7 +187,6 @@ import ( "strconv" "strings" "sync" - "bytes" "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esapi" @@ -238,17 +237,17 @@ func main() { go func(i int, title string) { defer wg.Done() - // Build the request body. - data, err := json.Marshal(struct{ Title string }{Title: title}) - if err != nil { - log.Fatalf("Error marshaling document: %s", err) - } + // Build the request body. + var b strings.Builder + b.WriteString(`{"title" : "`) + b.WriteString(title) + b.WriteString(`"}`) // Set up the request object. req := esapi.IndexRequest{ Index: "test", DocumentID: strconv.Itoa(i + 1), - Body: bytes.NewReader(data), + Body: strings.NewReader(b.String()), Refresh: "true", } diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api._.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api._.go index 2165bf4bf19..879e8e70a81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api._.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api._.go @@ -15,11 +15,12 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7 (eeacb58): DO NOT EDIT +// Code generated from specification version 7.17.1 (9dd5717): DO NOT EDIT package esapi // API contains the Elasticsearch APIs +// type API struct { Cat *Cat Cluster *Cluster @@ -536,6 +537,7 @@ type XPack struct { } // New creates new API +// func New(t Transport) *API { return &API{ AutoscalingDeleteAutoscalingPolicy: newAutoscalingDeleteAutoscalingPolicyFunc(t), diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.bulk.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.bulk.go index cb049be4f0d..bd7be1f2ee9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.bulk.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newBulkFunc(t Transport) Bulk { // Bulk allows to perform multiple index/update/delete operations in a single request. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html. +// type Bulk func(body io.Reader, o ...func(*BulkRequest)) (*Response, error) // BulkRequest configures the Bulk API request. +// type BulkRequest struct { Index string DocumentType string @@ -73,6 +75,7 @@ type BulkRequest struct { } // Do executes the request and returns response or error. +// func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -165,6 +168,10 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er 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 @@ -177,10 +184,6 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -200,6 +203,7 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er } // WithContext sets the request context. +// func (f Bulk) WithContext(v context.Context) func(*BulkRequest) { return func(r *BulkRequest) { r.ctx = v @@ -207,6 +211,7 @@ func (f Bulk) WithContext(v context.Context) func(*BulkRequest) { } // WithIndex - default index for items which don't provide one. +// func (f Bulk) WithIndex(v string) func(*BulkRequest) { return func(r *BulkRequest) { r.Index = v @@ -214,6 +219,7 @@ func (f Bulk) WithIndex(v string) func(*BulkRequest) { } // WithDocumentType - default document type for items which don't provide one. +// func (f Bulk) WithDocumentType(v string) func(*BulkRequest) { return func(r *BulkRequest) { r.DocumentType = v @@ -221,6 +227,7 @@ func (f Bulk) WithDocumentType(v string) func(*BulkRequest) { } // WithPipeline - the pipeline ID to preprocess incoming documents with. +// func (f Bulk) WithPipeline(v string) func(*BulkRequest) { return func(r *BulkRequest) { r.Pipeline = v @@ -228,6 +235,7 @@ func (f Bulk) WithPipeline(v string) func(*BulkRequest) { } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.. +// func (f Bulk) WithRefresh(v string) func(*BulkRequest) { return func(r *BulkRequest) { r.Refresh = v @@ -235,6 +243,7 @@ func (f Bulk) WithRefresh(v string) func(*BulkRequest) { } // WithRequireAlias - sets require_alias for all incoming documents. defaults to unset (false). +// func (f Bulk) WithRequireAlias(v bool) func(*BulkRequest) { return func(r *BulkRequest) { r.RequireAlias = &v @@ -242,6 +251,7 @@ func (f Bulk) WithRequireAlias(v bool) func(*BulkRequest) { } // WithRouting - specific routing value. +// func (f Bulk) WithRouting(v string) func(*BulkRequest) { return func(r *BulkRequest) { r.Routing = v @@ -249,6 +259,7 @@ func (f Bulk) WithRouting(v string) func(*BulkRequest) { } // WithSource - true or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request. +// func (f Bulk) WithSource(v ...string) func(*BulkRequest) { return func(r *BulkRequest) { r.Source = v @@ -256,6 +267,7 @@ func (f Bulk) WithSource(v ...string) func(*BulkRequest) { } // WithSourceExcludes - default list of fields to exclude from the returned _source field, can be overridden on each sub-request. +// func (f Bulk) WithSourceExcludes(v ...string) func(*BulkRequest) { return func(r *BulkRequest) { r.SourceExcludes = v @@ -263,6 +275,7 @@ func (f Bulk) WithSourceExcludes(v ...string) func(*BulkRequest) { } // WithSourceIncludes - default list of fields to extract and return from the _source field, can be overridden on each sub-request. +// func (f Bulk) WithSourceIncludes(v ...string) func(*BulkRequest) { return func(r *BulkRequest) { r.SourceIncludes = v @@ -270,6 +283,7 @@ func (f Bulk) WithSourceIncludes(v ...string) func(*BulkRequest) { } // WithTimeout - explicit operation timeout. +// func (f Bulk) WithTimeout(v time.Duration) func(*BulkRequest) { return func(r *BulkRequest) { r.Timeout = v @@ -277,6 +291,7 @@ func (f Bulk) WithTimeout(v time.Duration) func(*BulkRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the bulk operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f Bulk) WithWaitForActiveShards(v string) func(*BulkRequest) { return func(r *BulkRequest) { r.WaitForActiveShards = v @@ -284,6 +299,7 @@ func (f Bulk) WithWaitForActiveShards(v string) func(*BulkRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Bulk) WithPretty() func(*BulkRequest) { return func(r *BulkRequest) { r.Pretty = true @@ -291,6 +307,7 @@ func (f Bulk) WithPretty() func(*BulkRequest) { } // WithHuman makes statistical values human-readable. +// func (f Bulk) WithHuman() func(*BulkRequest) { return func(r *BulkRequest) { r.Human = true @@ -298,6 +315,7 @@ func (f Bulk) WithHuman() func(*BulkRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Bulk) WithErrorTrace() func(*BulkRequest) { return func(r *BulkRequest) { r.ErrorTrace = true @@ -305,6 +323,7 @@ func (f Bulk) WithErrorTrace() func(*BulkRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Bulk) WithFilterPath(v ...string) func(*BulkRequest) { return func(r *BulkRequest) { r.FilterPath = v @@ -312,6 +331,7 @@ func (f Bulk) WithFilterPath(v ...string) func(*BulkRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Bulk) WithHeader(h map[string]string) func(*BulkRequest) { return func(r *BulkRequest) { if r.Header == nil { @@ -324,6 +344,7 @@ func (f Bulk) WithHeader(h map[string]string) func(*BulkRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Bulk) WithOpaqueID(s string) func(*BulkRequest) { return func(r *BulkRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.aliases.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.aliases.go index 6172a697dca..e8569cd3ffa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.aliases.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatAliasesFunc(t Transport) CatAliases { // CatAliases shows information about currently configured aliases to indices including filter and routing infos. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html. +// type CatAliases func(o ...func(*CatAliasesRequest)) (*Response, error) // CatAliasesRequest configures the Cat Aliases API request. +// type CatAliasesRequest struct { Name []string @@ -66,6 +68,7 @@ type CatAliasesRequest struct { } // Do executes the request and returns response or error. +// func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -175,6 +178,7 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f CatAliases) WithContext(v context.Context) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.ctx = v @@ -182,6 +186,7 @@ func (f CatAliases) WithContext(v context.Context) func(*CatAliasesRequest) { } // WithName - a list of alias names to return. +// func (f CatAliases) WithName(v ...string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.Name = v @@ -189,6 +194,7 @@ func (f CatAliases) WithName(v ...string) func(*CatAliasesRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f CatAliases) WithExpandWildcards(v string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.ExpandWildcards = v @@ -196,6 +202,7 @@ func (f CatAliases) WithExpandWildcards(v string) func(*CatAliasesRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatAliases) WithFormat(v string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.Format = v @@ -203,6 +210,7 @@ func (f CatAliases) WithFormat(v string) func(*CatAliasesRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatAliases) WithH(v ...string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.H = v @@ -210,6 +218,7 @@ func (f CatAliases) WithH(v ...string) func(*CatAliasesRequest) { } // WithHelp - return help information. +// func (f CatAliases) WithHelp(v bool) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.Help = &v @@ -217,6 +226,7 @@ func (f CatAliases) WithHelp(v bool) func(*CatAliasesRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatAliases) WithLocal(v bool) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.Local = &v @@ -224,6 +234,7 @@ func (f CatAliases) WithLocal(v bool) func(*CatAliasesRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatAliases) WithS(v ...string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.S = v @@ -231,6 +242,7 @@ func (f CatAliases) WithS(v ...string) func(*CatAliasesRequest) { } // WithV - verbose mode. display column headers. +// func (f CatAliases) WithV(v bool) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.V = &v @@ -238,6 +250,7 @@ func (f CatAliases) WithV(v bool) func(*CatAliasesRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatAliases) WithPretty() func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.Pretty = true @@ -245,6 +258,7 @@ func (f CatAliases) WithPretty() func(*CatAliasesRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatAliases) WithHuman() func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.Human = true @@ -252,6 +266,7 @@ func (f CatAliases) WithHuman() func(*CatAliasesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatAliases) WithErrorTrace() func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.ErrorTrace = true @@ -259,6 +274,7 @@ func (f CatAliases) WithErrorTrace() func(*CatAliasesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatAliases) WithFilterPath(v ...string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.FilterPath = v @@ -266,6 +282,7 @@ func (f CatAliases) WithFilterPath(v ...string) func(*CatAliasesRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatAliases) WithHeader(h map[string]string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { if r.Header == nil { @@ -278,6 +295,7 @@ func (f CatAliases) WithHeader(h map[string]string) func(*CatAliasesRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatAliases) WithOpaqueID(s string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.allocation.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.allocation.go index 198086a0b8c..44737916bb6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.allocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.allocation.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatAllocationFunc(t Transport) CatAllocation { // CatAllocation provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html. +// type CatAllocation func(o ...func(*CatAllocationRequest)) (*Response, error) // CatAllocationRequest configures the Cat Allocation API request. +// type CatAllocationRequest struct { NodeID []string @@ -68,6 +70,7 @@ type CatAllocationRequest struct { } // Do executes the request and returns response or error. +// func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -181,6 +184,7 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f CatAllocation) WithContext(v context.Context) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.ctx = v @@ -188,6 +192,7 @@ func (f CatAllocation) WithContext(v context.Context) func(*CatAllocationRequest } // WithNodeID - a list of node ids or names to limit the returned information. +// func (f CatAllocation) WithNodeID(v ...string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.NodeID = v @@ -195,6 +200,7 @@ func (f CatAllocation) WithNodeID(v ...string) func(*CatAllocationRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatAllocation) WithBytes(v string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.Bytes = v @@ -202,6 +208,7 @@ func (f CatAllocation) WithBytes(v string) func(*CatAllocationRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatAllocation) WithFormat(v string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.Format = v @@ -209,6 +216,7 @@ func (f CatAllocation) WithFormat(v string) func(*CatAllocationRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatAllocation) WithH(v ...string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.H = v @@ -216,6 +224,7 @@ func (f CatAllocation) WithH(v ...string) func(*CatAllocationRequest) { } // WithHelp - return help information. +// func (f CatAllocation) WithHelp(v bool) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.Help = &v @@ -223,6 +232,7 @@ func (f CatAllocation) WithHelp(v bool) func(*CatAllocationRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatAllocation) WithLocal(v bool) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.Local = &v @@ -230,6 +240,7 @@ func (f CatAllocation) WithLocal(v bool) func(*CatAllocationRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatAllocation) WithMasterTimeout(v time.Duration) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.MasterTimeout = v @@ -237,6 +248,7 @@ func (f CatAllocation) WithMasterTimeout(v time.Duration) func(*CatAllocationReq } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatAllocation) WithS(v ...string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.S = v @@ -244,6 +256,7 @@ func (f CatAllocation) WithS(v ...string) func(*CatAllocationRequest) { } // WithV - verbose mode. display column headers. +// func (f CatAllocation) WithV(v bool) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.V = &v @@ -251,6 +264,7 @@ func (f CatAllocation) WithV(v bool) func(*CatAllocationRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatAllocation) WithPretty() func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.Pretty = true @@ -258,6 +272,7 @@ func (f CatAllocation) WithPretty() func(*CatAllocationRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatAllocation) WithHuman() func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.Human = true @@ -265,6 +280,7 @@ func (f CatAllocation) WithHuman() func(*CatAllocationRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatAllocation) WithErrorTrace() func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.ErrorTrace = true @@ -272,6 +288,7 @@ func (f CatAllocation) WithErrorTrace() func(*CatAllocationRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatAllocation) WithFilterPath(v ...string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { r.FilterPath = v @@ -279,6 +296,7 @@ func (f CatAllocation) WithFilterPath(v ...string) func(*CatAllocationRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatAllocation) WithHeader(h map[string]string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { if r.Header == nil { @@ -291,6 +309,7 @@ func (f CatAllocation) WithHeader(h map[string]string) func(*CatAllocationReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatAllocation) WithOpaqueID(s string) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.count.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.count.go index c2e71569e91..02cdb282fbf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.count.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatCountFunc(t Transport) CatCount { // CatCount provides quick access to the document count of the entire cluster, or individual indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html. +// type CatCount func(o ...func(*CatCountRequest)) (*Response, error) // CatCountRequest configures the Cat Count API request. +// type CatCountRequest struct { Index []string @@ -64,6 +66,7 @@ type CatCountRequest struct { } // Do executes the request and returns response or error. +// func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -165,6 +168,7 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f CatCount) WithContext(v context.Context) func(*CatCountRequest) { return func(r *CatCountRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f CatCount) WithContext(v context.Context) func(*CatCountRequest) { } // WithIndex - a list of index names to limit the returned information. +// func (f CatCount) WithIndex(v ...string) func(*CatCountRequest) { return func(r *CatCountRequest) { r.Index = v @@ -179,6 +184,7 @@ func (f CatCount) WithIndex(v ...string) func(*CatCountRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatCount) WithFormat(v string) func(*CatCountRequest) { return func(r *CatCountRequest) { r.Format = v @@ -186,6 +192,7 @@ func (f CatCount) WithFormat(v string) func(*CatCountRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatCount) WithH(v ...string) func(*CatCountRequest) { return func(r *CatCountRequest) { r.H = v @@ -193,6 +200,7 @@ func (f CatCount) WithH(v ...string) func(*CatCountRequest) { } // WithHelp - return help information. +// func (f CatCount) WithHelp(v bool) func(*CatCountRequest) { return func(r *CatCountRequest) { r.Help = &v @@ -200,6 +208,7 @@ func (f CatCount) WithHelp(v bool) func(*CatCountRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatCount) WithS(v ...string) func(*CatCountRequest) { return func(r *CatCountRequest) { r.S = v @@ -207,6 +216,7 @@ func (f CatCount) WithS(v ...string) func(*CatCountRequest) { } // WithV - verbose mode. display column headers. +// func (f CatCount) WithV(v bool) func(*CatCountRequest) { return func(r *CatCountRequest) { r.V = &v @@ -214,6 +224,7 @@ func (f CatCount) WithV(v bool) func(*CatCountRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatCount) WithPretty() func(*CatCountRequest) { return func(r *CatCountRequest) { r.Pretty = true @@ -221,6 +232,7 @@ func (f CatCount) WithPretty() func(*CatCountRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatCount) WithHuman() func(*CatCountRequest) { return func(r *CatCountRequest) { r.Human = true @@ -228,6 +240,7 @@ func (f CatCount) WithHuman() func(*CatCountRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatCount) WithErrorTrace() func(*CatCountRequest) { return func(r *CatCountRequest) { r.ErrorTrace = true @@ -235,6 +248,7 @@ func (f CatCount) WithErrorTrace() func(*CatCountRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatCount) WithFilterPath(v ...string) func(*CatCountRequest) { return func(r *CatCountRequest) { r.FilterPath = v @@ -242,6 +256,7 @@ func (f CatCount) WithFilterPath(v ...string) func(*CatCountRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatCount) WithHeader(h map[string]string) func(*CatCountRequest) { return func(r *CatCountRequest) { if r.Header == nil { @@ -254,6 +269,7 @@ func (f CatCount) WithHeader(h map[string]string) func(*CatCountRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatCount) WithOpaqueID(s string) func(*CatCountRequest) { return func(r *CatCountRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.fielddata.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.fielddata.go index e18e017c1bb..41be629b646 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.fielddata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.fielddata.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatFielddataFunc(t Transport) CatFielddata { // CatFielddata shows how much heap memory is currently being used by fielddata on every data node in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html. +// type CatFielddata func(o ...func(*CatFielddataRequest)) (*Response, error) // CatFielddataRequest configures the Cat Fielddata API request. +// type CatFielddataRequest struct { Fields []string @@ -65,6 +67,7 @@ type CatFielddataRequest struct { } // Do executes the request and returns response or error. +// func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -174,6 +177,7 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f CatFielddata) WithContext(v context.Context) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.ctx = v @@ -181,6 +185,7 @@ func (f CatFielddata) WithContext(v context.Context) func(*CatFielddataRequest) } // WithFields - a list of fields to return the fielddata size. +// func (f CatFielddata) WithFields(v ...string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.Fields = v @@ -188,6 +193,7 @@ func (f CatFielddata) WithFields(v ...string) func(*CatFielddataRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatFielddata) WithBytes(v string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.Bytes = v @@ -195,6 +201,7 @@ func (f CatFielddata) WithBytes(v string) func(*CatFielddataRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatFielddata) WithFormat(v string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.Format = v @@ -202,6 +209,7 @@ func (f CatFielddata) WithFormat(v string) func(*CatFielddataRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatFielddata) WithH(v ...string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.H = v @@ -209,6 +217,7 @@ func (f CatFielddata) WithH(v ...string) func(*CatFielddataRequest) { } // WithHelp - return help information. +// func (f CatFielddata) WithHelp(v bool) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.Help = &v @@ -216,6 +225,7 @@ func (f CatFielddata) WithHelp(v bool) func(*CatFielddataRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatFielddata) WithS(v ...string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.S = v @@ -223,6 +233,7 @@ func (f CatFielddata) WithS(v ...string) func(*CatFielddataRequest) { } // WithV - verbose mode. display column headers. +// func (f CatFielddata) WithV(v bool) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.V = &v @@ -230,6 +241,7 @@ func (f CatFielddata) WithV(v bool) func(*CatFielddataRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatFielddata) WithPretty() func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.Pretty = true @@ -237,6 +249,7 @@ func (f CatFielddata) WithPretty() func(*CatFielddataRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatFielddata) WithHuman() func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.Human = true @@ -244,6 +257,7 @@ func (f CatFielddata) WithHuman() func(*CatFielddataRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatFielddata) WithErrorTrace() func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.ErrorTrace = true @@ -251,6 +265,7 @@ func (f CatFielddata) WithErrorTrace() func(*CatFielddataRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatFielddata) WithFilterPath(v ...string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { r.FilterPath = v @@ -258,6 +273,7 @@ func (f CatFielddata) WithFilterPath(v ...string) func(*CatFielddataRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatFielddata) WithHeader(h map[string]string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { if r.Header == nil { @@ -270,6 +286,7 @@ func (f CatFielddata) WithHeader(h map[string]string) func(*CatFielddataRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatFielddata) WithOpaqueID(s string) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.health.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.health.go index a3251fdb353..17071b80de0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.health.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatHealthFunc(t Transport) CatHealth { // CatHealth returns a concise representation of the cluster health. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html. +// type CatHealth func(o ...func(*CatHealthRequest)) (*Response, error) // CatHealthRequest configures the Cat Health API request. +// type CatHealthRequest struct { Format string H []string @@ -64,6 +66,7 @@ type CatHealthRequest struct { } // Do executes the request and returns response or error. +// func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -166,6 +169,7 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f CatHealth) WithContext(v context.Context) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.ctx = v @@ -173,6 +177,7 @@ func (f CatHealth) WithContext(v context.Context) func(*CatHealthRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatHealth) WithFormat(v string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.Format = v @@ -180,6 +185,7 @@ func (f CatHealth) WithFormat(v string) func(*CatHealthRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatHealth) WithH(v ...string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.H = v @@ -187,6 +193,7 @@ func (f CatHealth) WithH(v ...string) func(*CatHealthRequest) { } // WithHelp - return help information. +// func (f CatHealth) WithHelp(v bool) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.Help = &v @@ -194,6 +201,7 @@ func (f CatHealth) WithHelp(v bool) func(*CatHealthRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatHealth) WithS(v ...string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.S = v @@ -201,6 +209,7 @@ func (f CatHealth) WithS(v ...string) func(*CatHealthRequest) { } // WithTime - the unit in which to display time values. +// func (f CatHealth) WithTime(v string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.Time = v @@ -208,6 +217,7 @@ func (f CatHealth) WithTime(v string) func(*CatHealthRequest) { } // WithTs - set to false to disable timestamping. +// func (f CatHealth) WithTs(v bool) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.Ts = &v @@ -215,6 +225,7 @@ func (f CatHealth) WithTs(v bool) func(*CatHealthRequest) { } // WithV - verbose mode. display column headers. +// func (f CatHealth) WithV(v bool) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.V = &v @@ -222,6 +233,7 @@ func (f CatHealth) WithV(v bool) func(*CatHealthRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatHealth) WithPretty() func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.Pretty = true @@ -229,6 +241,7 @@ func (f CatHealth) WithPretty() func(*CatHealthRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatHealth) WithHuman() func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.Human = true @@ -236,6 +249,7 @@ func (f CatHealth) WithHuman() func(*CatHealthRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatHealth) WithErrorTrace() func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.ErrorTrace = true @@ -243,6 +257,7 @@ func (f CatHealth) WithErrorTrace() func(*CatHealthRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatHealth) WithFilterPath(v ...string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { r.FilterPath = v @@ -250,6 +265,7 @@ func (f CatHealth) WithFilterPath(v ...string) func(*CatHealthRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatHealth) WithHeader(h map[string]string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { if r.Header == nil { @@ -262,6 +278,7 @@ func (f CatHealth) WithHeader(h map[string]string) func(*CatHealthRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatHealth) WithOpaqueID(s string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.help.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.help.go index f02537fe6d7..643f54bb34d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.help.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.help.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatHelpFunc(t Transport) CatHelp { // CatHelp returns help for the Cat APIs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html. +// type CatHelp func(o ...func(*CatHelpRequest)) (*Response, error) // CatHelpRequest configures the Cat Help API request. +// type CatHelpRequest struct { Help *bool S []string @@ -59,6 +61,7 @@ type CatHelpRequest struct { } // Do executes the request and returns response or error. +// func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f CatHelp) WithContext(v context.Context) func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f CatHelp) WithContext(v context.Context) func(*CatHelpRequest) { } // WithHelp - return help information. +// func (f CatHelp) WithHelp(v bool) func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.Help = &v @@ -155,6 +160,7 @@ func (f CatHelp) WithHelp(v bool) func(*CatHelpRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatHelp) WithS(v ...string) func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.S = v @@ -162,6 +168,7 @@ func (f CatHelp) WithS(v ...string) func(*CatHelpRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatHelp) WithPretty() func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.Pretty = true @@ -169,6 +176,7 @@ func (f CatHelp) WithPretty() func(*CatHelpRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatHelp) WithHuman() func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.Human = true @@ -176,6 +184,7 @@ func (f CatHelp) WithHuman() func(*CatHelpRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatHelp) WithErrorTrace() func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.ErrorTrace = true @@ -183,6 +192,7 @@ func (f CatHelp) WithErrorTrace() func(*CatHelpRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatHelp) WithFilterPath(v ...string) func(*CatHelpRequest) { return func(r *CatHelpRequest) { r.FilterPath = v @@ -190,6 +200,7 @@ func (f CatHelp) WithFilterPath(v ...string) func(*CatHelpRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatHelp) WithHeader(h map[string]string) func(*CatHelpRequest) { return func(r *CatHelpRequest) { if r.Header == nil { @@ -202,6 +213,7 @@ func (f CatHelp) WithHeader(h map[string]string) func(*CatHelpRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatHelp) WithOpaqueID(s string) func(*CatHelpRequest) { return func(r *CatHelpRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.indices.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.indices.go index c64388f46b2..9b95cb20849 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.indices.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatIndicesFunc(t Transport) CatIndices { // CatIndices returns information about indices: number of primaries and replicas, document counts, disk size, ... // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html. +// type CatIndices func(o ...func(*CatIndicesRequest)) (*Response, error) // CatIndicesRequest configures the Cat Indices API request. +// type CatIndicesRequest struct { Index []string @@ -73,6 +75,7 @@ type CatIndicesRequest struct { } // Do executes the request and returns response or error. +// func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -206,6 +209,7 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f CatIndices) WithContext(v context.Context) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.ctx = v @@ -213,6 +217,7 @@ func (f CatIndices) WithContext(v context.Context) func(*CatIndicesRequest) { } // WithIndex - a list of index names to limit the returned information. +// func (f CatIndices) WithIndex(v ...string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Index = v @@ -220,6 +225,7 @@ func (f CatIndices) WithIndex(v ...string) func(*CatIndicesRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatIndices) WithBytes(v string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Bytes = v @@ -227,6 +233,7 @@ func (f CatIndices) WithBytes(v string) func(*CatIndicesRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f CatIndices) WithExpandWildcards(v string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.ExpandWildcards = v @@ -234,6 +241,7 @@ func (f CatIndices) WithExpandWildcards(v string) func(*CatIndicesRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatIndices) WithFormat(v string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Format = v @@ -241,6 +249,7 @@ func (f CatIndices) WithFormat(v string) func(*CatIndicesRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatIndices) WithH(v ...string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.H = v @@ -248,6 +257,7 @@ func (f CatIndices) WithH(v ...string) func(*CatIndicesRequest) { } // WithHealth - a health status ("green", "yellow", or "red" to filter only indices matching the specified health status. +// func (f CatIndices) WithHealth(v string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Health = v @@ -255,6 +265,7 @@ func (f CatIndices) WithHealth(v string) func(*CatIndicesRequest) { } // WithHelp - return help information. +// func (f CatIndices) WithHelp(v bool) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Help = &v @@ -262,6 +273,7 @@ func (f CatIndices) WithHelp(v bool) func(*CatIndicesRequest) { } // WithIncludeUnloadedSegments - if set to true segment stats will include stats for segments that are not currently loaded into memory. +// func (f CatIndices) WithIncludeUnloadedSegments(v bool) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.IncludeUnloadedSegments = &v @@ -269,6 +281,7 @@ func (f CatIndices) WithIncludeUnloadedSegments(v bool) func(*CatIndicesRequest) } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatIndices) WithLocal(v bool) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Local = &v @@ -276,6 +289,7 @@ func (f CatIndices) WithLocal(v bool) func(*CatIndicesRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatIndices) WithMasterTimeout(v time.Duration) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.MasterTimeout = v @@ -283,6 +297,7 @@ func (f CatIndices) WithMasterTimeout(v time.Duration) func(*CatIndicesRequest) } // WithPri - set to true to return stats only for primary shards. +// func (f CatIndices) WithPri(v bool) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Pri = &v @@ -290,6 +305,7 @@ func (f CatIndices) WithPri(v bool) func(*CatIndicesRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatIndices) WithS(v ...string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.S = v @@ -297,6 +313,7 @@ func (f CatIndices) WithS(v ...string) func(*CatIndicesRequest) { } // WithTime - the unit in which to display time values. +// func (f CatIndices) WithTime(v string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Time = v @@ -304,6 +321,7 @@ func (f CatIndices) WithTime(v string) func(*CatIndicesRequest) { } // WithV - verbose mode. display column headers. +// func (f CatIndices) WithV(v bool) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.V = &v @@ -311,6 +329,7 @@ func (f CatIndices) WithV(v bool) func(*CatIndicesRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatIndices) WithPretty() func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Pretty = true @@ -318,6 +337,7 @@ func (f CatIndices) WithPretty() func(*CatIndicesRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatIndices) WithHuman() func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.Human = true @@ -325,6 +345,7 @@ func (f CatIndices) WithHuman() func(*CatIndicesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatIndices) WithErrorTrace() func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.ErrorTrace = true @@ -332,6 +353,7 @@ func (f CatIndices) WithErrorTrace() func(*CatIndicesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatIndices) WithFilterPath(v ...string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.FilterPath = v @@ -339,6 +361,7 @@ func (f CatIndices) WithFilterPath(v ...string) func(*CatIndicesRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatIndices) WithHeader(h map[string]string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { if r.Header == nil { @@ -351,6 +374,7 @@ func (f CatIndices) WithHeader(h map[string]string) func(*CatIndicesRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatIndices) WithOpaqueID(s string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.master.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.master.go index 6a046dbdb4c..ef14c3b61d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.master.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.master.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatMasterFunc(t Transport) CatMaster { // CatMaster returns information about the master node. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html. +// type CatMaster func(o ...func(*CatMasterRequest)) (*Response, error) // CatMasterRequest configures the Cat Master API request. +// type CatMasterRequest struct { Format string H []string @@ -65,6 +67,7 @@ type CatMasterRequest struct { } // Do executes the request and returns response or error. +// func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f CatMaster) WithContext(v context.Context) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f CatMaster) WithContext(v context.Context) func(*CatMasterRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatMaster) WithFormat(v string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Format = v @@ -181,6 +186,7 @@ func (f CatMaster) WithFormat(v string) func(*CatMasterRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatMaster) WithH(v ...string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.H = v @@ -188,6 +194,7 @@ func (f CatMaster) WithH(v ...string) func(*CatMasterRequest) { } // WithHelp - return help information. +// func (f CatMaster) WithHelp(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Help = &v @@ -195,6 +202,7 @@ func (f CatMaster) WithHelp(v bool) func(*CatMasterRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatMaster) WithLocal(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Local = &v @@ -202,6 +210,7 @@ func (f CatMaster) WithLocal(v bool) func(*CatMasterRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatMaster) WithMasterTimeout(v time.Duration) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.MasterTimeout = v @@ -209,6 +218,7 @@ func (f CatMaster) WithMasterTimeout(v time.Duration) func(*CatMasterRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatMaster) WithS(v ...string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.S = v @@ -216,6 +226,7 @@ func (f CatMaster) WithS(v ...string) func(*CatMasterRequest) { } // WithV - verbose mode. display column headers. +// func (f CatMaster) WithV(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.V = &v @@ -223,6 +234,7 @@ func (f CatMaster) WithV(v bool) func(*CatMasterRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatMaster) WithPretty() func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Pretty = true @@ -230,6 +242,7 @@ func (f CatMaster) WithPretty() func(*CatMasterRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatMaster) WithHuman() func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Human = true @@ -237,6 +250,7 @@ func (f CatMaster) WithHuman() func(*CatMasterRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatMaster) WithErrorTrace() func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.ErrorTrace = true @@ -244,6 +258,7 @@ func (f CatMaster) WithErrorTrace() func(*CatMasterRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatMaster) WithFilterPath(v ...string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.FilterPath = v @@ -251,6 +266,7 @@ func (f CatMaster) WithFilterPath(v ...string) func(*CatMasterRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { if r.Header == nil { @@ -263,6 +279,7 @@ func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatMaster) WithOpaqueID(s string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodeattrs.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodeattrs.go index 1298acde559..f60e1b46c68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodeattrs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodeattrs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatNodeattrsFunc(t Transport) CatNodeattrs { // CatNodeattrs returns information about custom node attributes. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html. +// type CatNodeattrs func(o ...func(*CatNodeattrsRequest)) (*Response, error) // CatNodeattrsRequest configures the Cat Nodeattrs API request. +// type CatNodeattrsRequest struct { Format string H []string @@ -65,6 +67,7 @@ type CatNodeattrsRequest struct { } // Do executes the request and returns response or error. +// func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f CatNodeattrs) WithContext(v context.Context) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f CatNodeattrs) WithContext(v context.Context) func(*CatNodeattrsRequest) } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatNodeattrs) WithFormat(v string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.Format = v @@ -181,6 +186,7 @@ func (f CatNodeattrs) WithFormat(v string) func(*CatNodeattrsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatNodeattrs) WithH(v ...string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.H = v @@ -188,6 +194,7 @@ func (f CatNodeattrs) WithH(v ...string) func(*CatNodeattrsRequest) { } // WithHelp - return help information. +// func (f CatNodeattrs) WithHelp(v bool) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.Help = &v @@ -195,6 +202,7 @@ func (f CatNodeattrs) WithHelp(v bool) func(*CatNodeattrsRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatNodeattrs) WithLocal(v bool) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.Local = &v @@ -202,6 +210,7 @@ func (f CatNodeattrs) WithLocal(v bool) func(*CatNodeattrsRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatNodeattrs) WithMasterTimeout(v time.Duration) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.MasterTimeout = v @@ -209,6 +218,7 @@ func (f CatNodeattrs) WithMasterTimeout(v time.Duration) func(*CatNodeattrsReque } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatNodeattrs) WithS(v ...string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.S = v @@ -216,6 +226,7 @@ func (f CatNodeattrs) WithS(v ...string) func(*CatNodeattrsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatNodeattrs) WithV(v bool) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.V = &v @@ -223,6 +234,7 @@ func (f CatNodeattrs) WithV(v bool) func(*CatNodeattrsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatNodeattrs) WithPretty() func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.Pretty = true @@ -230,6 +242,7 @@ func (f CatNodeattrs) WithPretty() func(*CatNodeattrsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatNodeattrs) WithHuman() func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.Human = true @@ -237,6 +250,7 @@ func (f CatNodeattrs) WithHuman() func(*CatNodeattrsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatNodeattrs) WithErrorTrace() func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.ErrorTrace = true @@ -244,6 +258,7 @@ func (f CatNodeattrs) WithErrorTrace() func(*CatNodeattrsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatNodeattrs) WithFilterPath(v ...string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { r.FilterPath = v @@ -251,6 +266,7 @@ func (f CatNodeattrs) WithFilterPath(v ...string) func(*CatNodeattrsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatNodeattrs) WithHeader(h map[string]string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { if r.Header == nil { @@ -263,6 +279,7 @@ func (f CatNodeattrs) WithHeader(h map[string]string) func(*CatNodeattrsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatNodeattrs) WithOpaqueID(s string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodes.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodes.go index afffe61afc6..839be939518 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.nodes.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatNodesFunc(t Transport) CatNodes { // CatNodes returns basic statistics about performance of cluster nodes. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html. +// type CatNodes func(o ...func(*CatNodesRequest)) (*Response, error) // CatNodesRequest configures the Cat Nodes API request. +// type CatNodesRequest struct { Bytes string Format string @@ -69,6 +71,7 @@ type CatNodesRequest struct { } // Do executes the request and returns response or error. +// func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -187,6 +190,7 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f CatNodes) WithContext(v context.Context) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.ctx = v @@ -194,6 +198,7 @@ func (f CatNodes) WithContext(v context.Context) func(*CatNodesRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatNodes) WithBytes(v string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Bytes = v @@ -201,6 +206,7 @@ func (f CatNodes) WithBytes(v string) func(*CatNodesRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatNodes) WithFormat(v string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Format = v @@ -208,6 +214,7 @@ func (f CatNodes) WithFormat(v string) func(*CatNodesRequest) { } // WithFullID - return the full node ID instead of the shortened version (default: false). +// func (f CatNodes) WithFullID(v bool) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.FullID = &v @@ -215,6 +222,7 @@ func (f CatNodes) WithFullID(v bool) func(*CatNodesRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatNodes) WithH(v ...string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.H = v @@ -222,6 +230,7 @@ func (f CatNodes) WithH(v ...string) func(*CatNodesRequest) { } // WithHelp - return help information. +// func (f CatNodes) WithHelp(v bool) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Help = &v @@ -229,6 +238,7 @@ func (f CatNodes) WithHelp(v bool) func(*CatNodesRequest) { } // WithIncludeUnloadedSegments - if set to true segment stats will include stats for segments that are not currently loaded into memory. +// func (f CatNodes) WithIncludeUnloadedSegments(v bool) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.IncludeUnloadedSegments = &v @@ -236,6 +246,7 @@ func (f CatNodes) WithIncludeUnloadedSegments(v bool) func(*CatNodesRequest) { } // WithLocal - calculate the selected nodes using the local cluster state rather than the state from master node (default: false). +// func (f CatNodes) WithLocal(v bool) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Local = &v @@ -243,6 +254,7 @@ func (f CatNodes) WithLocal(v bool) func(*CatNodesRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatNodes) WithMasterTimeout(v time.Duration) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.MasterTimeout = v @@ -250,6 +262,7 @@ func (f CatNodes) WithMasterTimeout(v time.Duration) func(*CatNodesRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatNodes) WithS(v ...string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.S = v @@ -257,6 +270,7 @@ func (f CatNodes) WithS(v ...string) func(*CatNodesRequest) { } // WithTime - the unit in which to display time values. +// func (f CatNodes) WithTime(v string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Time = v @@ -264,6 +278,7 @@ func (f CatNodes) WithTime(v string) func(*CatNodesRequest) { } // WithV - verbose mode. display column headers. +// func (f CatNodes) WithV(v bool) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.V = &v @@ -271,6 +286,7 @@ func (f CatNodes) WithV(v bool) func(*CatNodesRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatNodes) WithPretty() func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Pretty = true @@ -278,6 +294,7 @@ func (f CatNodes) WithPretty() func(*CatNodesRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatNodes) WithHuman() func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.Human = true @@ -285,6 +302,7 @@ func (f CatNodes) WithHuman() func(*CatNodesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatNodes) WithErrorTrace() func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.ErrorTrace = true @@ -292,6 +310,7 @@ func (f CatNodes) WithErrorTrace() func(*CatNodesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatNodes) WithFilterPath(v ...string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { r.FilterPath = v @@ -299,6 +318,7 @@ func (f CatNodes) WithFilterPath(v ...string) func(*CatNodesRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatNodes) WithHeader(h map[string]string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { if r.Header == nil { @@ -311,6 +331,7 @@ func (f CatNodes) WithHeader(h map[string]string) func(*CatNodesRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatNodes) WithOpaqueID(s string) func(*CatNodesRequest) { return func(r *CatNodesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.pending_tasks.go index 209f34ae233..79e5e3c9df7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.pending_tasks.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatPendingTasksFunc(t Transport) CatPendingTasks { // CatPendingTasks returns a concise representation of the cluster pending tasks. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html. +// type CatPendingTasks func(o ...func(*CatPendingTasksRequest)) (*Response, error) // CatPendingTasksRequest configures the Cat Pending Tasks API request. +// type CatPendingTasksRequest struct { Format string H []string @@ -66,6 +68,7 @@ type CatPendingTasksRequest struct { } // Do executes the request and returns response or error. +// func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -172,6 +175,7 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f CatPendingTasks) WithContext(v context.Context) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.ctx = v @@ -179,6 +183,7 @@ func (f CatPendingTasks) WithContext(v context.Context) func(*CatPendingTasksReq } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatPendingTasks) WithFormat(v string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.Format = v @@ -186,6 +191,7 @@ func (f CatPendingTasks) WithFormat(v string) func(*CatPendingTasksRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatPendingTasks) WithH(v ...string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.H = v @@ -193,6 +199,7 @@ func (f CatPendingTasks) WithH(v ...string) func(*CatPendingTasksRequest) { } // WithHelp - return help information. +// func (f CatPendingTasks) WithHelp(v bool) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.Help = &v @@ -200,6 +207,7 @@ func (f CatPendingTasks) WithHelp(v bool) func(*CatPendingTasksRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatPendingTasks) WithLocal(v bool) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.Local = &v @@ -207,6 +215,7 @@ func (f CatPendingTasks) WithLocal(v bool) func(*CatPendingTasksRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatPendingTasks) WithMasterTimeout(v time.Duration) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.MasterTimeout = v @@ -214,6 +223,7 @@ func (f CatPendingTasks) WithMasterTimeout(v time.Duration) func(*CatPendingTask } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatPendingTasks) WithS(v ...string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.S = v @@ -221,6 +231,7 @@ func (f CatPendingTasks) WithS(v ...string) func(*CatPendingTasksRequest) { } // WithTime - the unit in which to display time values. +// func (f CatPendingTasks) WithTime(v string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.Time = v @@ -228,6 +239,7 @@ func (f CatPendingTasks) WithTime(v string) func(*CatPendingTasksRequest) { } // WithV - verbose mode. display column headers. +// func (f CatPendingTasks) WithV(v bool) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.V = &v @@ -235,6 +247,7 @@ func (f CatPendingTasks) WithV(v bool) func(*CatPendingTasksRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatPendingTasks) WithPretty() func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.Pretty = true @@ -242,6 +255,7 @@ func (f CatPendingTasks) WithPretty() func(*CatPendingTasksRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatPendingTasks) WithHuman() func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.Human = true @@ -249,6 +263,7 @@ func (f CatPendingTasks) WithHuman() func(*CatPendingTasksRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatPendingTasks) WithErrorTrace() func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.ErrorTrace = true @@ -256,6 +271,7 @@ func (f CatPendingTasks) WithErrorTrace() func(*CatPendingTasksRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatPendingTasks) WithFilterPath(v ...string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { r.FilterPath = v @@ -263,6 +279,7 @@ func (f CatPendingTasks) WithFilterPath(v ...string) func(*CatPendingTasksReques } // WithHeader adds the headers to the HTTP request. +// func (f CatPendingTasks) WithHeader(h map[string]string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { if r.Header == nil { @@ -275,6 +292,7 @@ func (f CatPendingTasks) WithHeader(h map[string]string) func(*CatPendingTasksRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatPendingTasks) WithOpaqueID(s string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.plugins.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.plugins.go index b5e85f4c918..f2e81c75bd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.plugins.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.plugins.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatPluginsFunc(t Transport) CatPlugins { // CatPlugins returns information about installed plugins across nodes node. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html. +// type CatPlugins func(o ...func(*CatPluginsRequest)) (*Response, error) // CatPluginsRequest configures the Cat Plugins API request. +// type CatPluginsRequest struct { Format string H []string @@ -66,6 +68,7 @@ type CatPluginsRequest struct { } // Do executes the request and returns response or error. +// func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -172,6 +175,7 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f CatPlugins) WithContext(v context.Context) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.ctx = v @@ -179,6 +183,7 @@ func (f CatPlugins) WithContext(v context.Context) func(*CatPluginsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatPlugins) WithFormat(v string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.Format = v @@ -186,6 +191,7 @@ func (f CatPlugins) WithFormat(v string) func(*CatPluginsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatPlugins) WithH(v ...string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.H = v @@ -193,6 +199,7 @@ func (f CatPlugins) WithH(v ...string) func(*CatPluginsRequest) { } // WithHelp - return help information. +// func (f CatPlugins) WithHelp(v bool) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.Help = &v @@ -200,6 +207,7 @@ func (f CatPlugins) WithHelp(v bool) func(*CatPluginsRequest) { } // WithIncludeBootstrap - include bootstrap plugins in the response. +// func (f CatPlugins) WithIncludeBootstrap(v bool) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.IncludeBootstrap = &v @@ -207,6 +215,7 @@ func (f CatPlugins) WithIncludeBootstrap(v bool) func(*CatPluginsRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatPlugins) WithLocal(v bool) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.Local = &v @@ -214,6 +223,7 @@ func (f CatPlugins) WithLocal(v bool) func(*CatPluginsRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatPlugins) WithMasterTimeout(v time.Duration) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.MasterTimeout = v @@ -221,6 +231,7 @@ func (f CatPlugins) WithMasterTimeout(v time.Duration) func(*CatPluginsRequest) } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatPlugins) WithS(v ...string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.S = v @@ -228,6 +239,7 @@ func (f CatPlugins) WithS(v ...string) func(*CatPluginsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatPlugins) WithV(v bool) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.V = &v @@ -235,6 +247,7 @@ func (f CatPlugins) WithV(v bool) func(*CatPluginsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatPlugins) WithPretty() func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.Pretty = true @@ -242,6 +255,7 @@ func (f CatPlugins) WithPretty() func(*CatPluginsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatPlugins) WithHuman() func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.Human = true @@ -249,6 +263,7 @@ func (f CatPlugins) WithHuman() func(*CatPluginsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatPlugins) WithErrorTrace() func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.ErrorTrace = true @@ -256,6 +271,7 @@ func (f CatPlugins) WithErrorTrace() func(*CatPluginsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatPlugins) WithFilterPath(v ...string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { r.FilterPath = v @@ -263,6 +279,7 @@ func (f CatPlugins) WithFilterPath(v ...string) func(*CatPluginsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatPlugins) WithHeader(h map[string]string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { if r.Header == nil { @@ -275,6 +292,7 @@ func (f CatPlugins) WithHeader(h map[string]string) func(*CatPluginsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatPlugins) WithOpaqueID(s string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.recovery.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.recovery.go index 21e13000653..473608564cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.recovery.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatRecoveryFunc(t Transport) CatRecovery { // CatRecovery returns information about index shard recoveries, both on-going completed. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html. +// type CatRecovery func(o ...func(*CatRecoveryRequest)) (*Response, error) // CatRecoveryRequest configures the Cat Recovery API request. +// type CatRecoveryRequest struct { Index []string @@ -68,6 +70,7 @@ type CatRecoveryRequest struct { } // Do executes the request and returns response or error. +// func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -189,6 +192,7 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f CatRecovery) WithContext(v context.Context) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.ctx = v @@ -196,6 +200,7 @@ func (f CatRecovery) WithContext(v context.Context) func(*CatRecoveryRequest) { } // WithIndex - comma-separated list or wildcard expression of index names to limit the returned information. +// func (f CatRecovery) WithIndex(v ...string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Index = v @@ -203,6 +208,7 @@ func (f CatRecovery) WithIndex(v ...string) func(*CatRecoveryRequest) { } // WithActiveOnly - if `true`, the response only includes ongoing shard recoveries. +// func (f CatRecovery) WithActiveOnly(v bool) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.ActiveOnly = &v @@ -210,6 +216,7 @@ func (f CatRecovery) WithActiveOnly(v bool) func(*CatRecoveryRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatRecovery) WithBytes(v string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Bytes = v @@ -217,6 +224,7 @@ func (f CatRecovery) WithBytes(v string) func(*CatRecoveryRequest) { } // WithDetailed - if `true`, the response includes detailed information about shard recoveries. +// func (f CatRecovery) WithDetailed(v bool) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Detailed = &v @@ -224,6 +232,7 @@ func (f CatRecovery) WithDetailed(v bool) func(*CatRecoveryRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatRecovery) WithFormat(v string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Format = v @@ -231,6 +240,7 @@ func (f CatRecovery) WithFormat(v string) func(*CatRecoveryRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatRecovery) WithH(v ...string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.H = v @@ -238,6 +248,7 @@ func (f CatRecovery) WithH(v ...string) func(*CatRecoveryRequest) { } // WithHelp - return help information. +// func (f CatRecovery) WithHelp(v bool) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Help = &v @@ -245,6 +256,7 @@ func (f CatRecovery) WithHelp(v bool) func(*CatRecoveryRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatRecovery) WithS(v ...string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.S = v @@ -252,6 +264,7 @@ func (f CatRecovery) WithS(v ...string) func(*CatRecoveryRequest) { } // WithTime - the unit in which to display time values. +// func (f CatRecovery) WithTime(v string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Time = v @@ -259,6 +272,7 @@ func (f CatRecovery) WithTime(v string) func(*CatRecoveryRequest) { } // WithV - verbose mode. display column headers. +// func (f CatRecovery) WithV(v bool) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.V = &v @@ -266,6 +280,7 @@ func (f CatRecovery) WithV(v bool) func(*CatRecoveryRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatRecovery) WithPretty() func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Pretty = true @@ -273,6 +288,7 @@ func (f CatRecovery) WithPretty() func(*CatRecoveryRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatRecovery) WithHuman() func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.Human = true @@ -280,6 +296,7 @@ func (f CatRecovery) WithHuman() func(*CatRecoveryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatRecovery) WithErrorTrace() func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.ErrorTrace = true @@ -287,6 +304,7 @@ func (f CatRecovery) WithErrorTrace() func(*CatRecoveryRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatRecovery) WithFilterPath(v ...string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { r.FilterPath = v @@ -294,6 +312,7 @@ func (f CatRecovery) WithFilterPath(v ...string) func(*CatRecoveryRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatRecovery) WithHeader(h map[string]string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { if r.Header == nil { @@ -306,6 +325,7 @@ func (f CatRecovery) WithHeader(h map[string]string) func(*CatRecoveryRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatRecovery) WithOpaqueID(s string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.repositories.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.repositories.go index 326d0b5d583..b7ad81a6647 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.repositories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.repositories.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatRepositoriesFunc(t Transport) CatRepositories { // CatRepositories returns information about snapshot repositories registered in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html. +// type CatRepositories func(o ...func(*CatRepositoriesRequest)) (*Response, error) // CatRepositoriesRequest configures the Cat Repositories API request. +// type CatRepositoriesRequest struct { Format string H []string @@ -65,6 +67,7 @@ type CatRepositoriesRequest struct { } // Do executes the request and returns response or error. +// func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f CatRepositories) WithContext(v context.Context) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f CatRepositories) WithContext(v context.Context) func(*CatRepositoriesReq } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatRepositories) WithFormat(v string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.Format = v @@ -181,6 +186,7 @@ func (f CatRepositories) WithFormat(v string) func(*CatRepositoriesRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatRepositories) WithH(v ...string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.H = v @@ -188,6 +194,7 @@ func (f CatRepositories) WithH(v ...string) func(*CatRepositoriesRequest) { } // WithHelp - return help information. +// func (f CatRepositories) WithHelp(v bool) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.Help = &v @@ -195,6 +202,7 @@ func (f CatRepositories) WithHelp(v bool) func(*CatRepositoriesRequest) { } // WithLocal - return local information, do not retrieve the state from master node. +// func (f CatRepositories) WithLocal(v bool) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.Local = &v @@ -202,6 +210,7 @@ func (f CatRepositories) WithLocal(v bool) func(*CatRepositoriesRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatRepositories) WithMasterTimeout(v time.Duration) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.MasterTimeout = v @@ -209,6 +218,7 @@ func (f CatRepositories) WithMasterTimeout(v time.Duration) func(*CatRepositorie } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatRepositories) WithS(v ...string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.S = v @@ -216,6 +226,7 @@ func (f CatRepositories) WithS(v ...string) func(*CatRepositoriesRequest) { } // WithV - verbose mode. display column headers. +// func (f CatRepositories) WithV(v bool) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.V = &v @@ -223,6 +234,7 @@ func (f CatRepositories) WithV(v bool) func(*CatRepositoriesRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatRepositories) WithPretty() func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.Pretty = true @@ -230,6 +242,7 @@ func (f CatRepositories) WithPretty() func(*CatRepositoriesRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatRepositories) WithHuman() func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.Human = true @@ -237,6 +250,7 @@ func (f CatRepositories) WithHuman() func(*CatRepositoriesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatRepositories) WithErrorTrace() func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.ErrorTrace = true @@ -244,6 +258,7 @@ func (f CatRepositories) WithErrorTrace() func(*CatRepositoriesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatRepositories) WithFilterPath(v ...string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { r.FilterPath = v @@ -251,6 +266,7 @@ func (f CatRepositories) WithFilterPath(v ...string) func(*CatRepositoriesReques } // WithHeader adds the headers to the HTTP request. +// func (f CatRepositories) WithHeader(h map[string]string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { if r.Header == nil { @@ -263,6 +279,7 @@ func (f CatRepositories) WithHeader(h map[string]string) func(*CatRepositoriesRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatRepositories) WithOpaqueID(s string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.segments.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.segments.go index 6cca036eabf..bab2f9a2322 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.segments.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatSegmentsFunc(t Transport) CatSegments { // CatSegments provides low-level information about the segments in the shards of an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html. +// type CatSegments func(o ...func(*CatSegmentsRequest)) (*Response, error) // CatSegmentsRequest configures the Cat Segments API request. +// type CatSegmentsRequest struct { Index []string @@ -65,6 +67,7 @@ type CatSegmentsRequest struct { } // Do executes the request and returns response or error. +// func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -170,6 +173,7 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f CatSegments) WithContext(v context.Context) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.ctx = v @@ -177,6 +181,7 @@ func (f CatSegments) WithContext(v context.Context) func(*CatSegmentsRequest) { } // WithIndex - a list of index names to limit the returned information. +// func (f CatSegments) WithIndex(v ...string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.Index = v @@ -184,6 +189,7 @@ func (f CatSegments) WithIndex(v ...string) func(*CatSegmentsRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatSegments) WithBytes(v string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.Bytes = v @@ -191,6 +197,7 @@ func (f CatSegments) WithBytes(v string) func(*CatSegmentsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatSegments) WithFormat(v string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.Format = v @@ -198,6 +205,7 @@ func (f CatSegments) WithFormat(v string) func(*CatSegmentsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatSegments) WithH(v ...string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.H = v @@ -205,6 +213,7 @@ func (f CatSegments) WithH(v ...string) func(*CatSegmentsRequest) { } // WithHelp - return help information. +// func (f CatSegments) WithHelp(v bool) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.Help = &v @@ -212,6 +221,7 @@ func (f CatSegments) WithHelp(v bool) func(*CatSegmentsRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatSegments) WithS(v ...string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.S = v @@ -219,6 +229,7 @@ func (f CatSegments) WithS(v ...string) func(*CatSegmentsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatSegments) WithV(v bool) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.V = &v @@ -226,6 +237,7 @@ func (f CatSegments) WithV(v bool) func(*CatSegmentsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatSegments) WithPretty() func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.Pretty = true @@ -233,6 +245,7 @@ func (f CatSegments) WithPretty() func(*CatSegmentsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatSegments) WithHuman() func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.Human = true @@ -240,6 +253,7 @@ func (f CatSegments) WithHuman() func(*CatSegmentsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatSegments) WithErrorTrace() func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.ErrorTrace = true @@ -247,6 +261,7 @@ func (f CatSegments) WithErrorTrace() func(*CatSegmentsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatSegments) WithFilterPath(v ...string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { r.FilterPath = v @@ -254,6 +269,7 @@ func (f CatSegments) WithFilterPath(v ...string) func(*CatSegmentsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatSegments) WithHeader(h map[string]string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { if r.Header == nil { @@ -266,6 +282,7 @@ func (f CatSegments) WithHeader(h map[string]string) func(*CatSegmentsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatSegments) WithOpaqueID(s string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.shards.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.shards.go index 32dc5651317..1f68fee5c76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.shards.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatShardsFunc(t Transport) CatShards { // CatShards provides a detailed view of shard allocation on nodes. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html. +// type CatShards func(o ...func(*CatShardsRequest)) (*Response, error) // CatShardsRequest configures the Cat Shards API request. +// type CatShardsRequest struct { Index []string @@ -69,6 +71,7 @@ type CatShardsRequest struct { } // Do executes the request and returns response or error. +// func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -186,6 +189,7 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f CatShards) WithContext(v context.Context) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.ctx = v @@ -193,6 +197,7 @@ func (f CatShards) WithContext(v context.Context) func(*CatShardsRequest) { } // WithIndex - a list of index names to limit the returned information. +// func (f CatShards) WithIndex(v ...string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Index = v @@ -200,6 +205,7 @@ func (f CatShards) WithIndex(v ...string) func(*CatShardsRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatShards) WithBytes(v string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Bytes = v @@ -207,6 +213,7 @@ func (f CatShards) WithBytes(v string) func(*CatShardsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatShards) WithFormat(v string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Format = v @@ -214,6 +221,7 @@ func (f CatShards) WithFormat(v string) func(*CatShardsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatShards) WithH(v ...string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.H = v @@ -221,6 +229,7 @@ func (f CatShards) WithH(v ...string) func(*CatShardsRequest) { } // WithHelp - return help information. +// func (f CatShards) WithHelp(v bool) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Help = &v @@ -228,6 +237,7 @@ func (f CatShards) WithHelp(v bool) func(*CatShardsRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatShards) WithLocal(v bool) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Local = &v @@ -235,6 +245,7 @@ func (f CatShards) WithLocal(v bool) func(*CatShardsRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatShards) WithMasterTimeout(v time.Duration) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.MasterTimeout = v @@ -242,6 +253,7 @@ func (f CatShards) WithMasterTimeout(v time.Duration) func(*CatShardsRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatShards) WithS(v ...string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.S = v @@ -249,6 +261,7 @@ func (f CatShards) WithS(v ...string) func(*CatShardsRequest) { } // WithTime - the unit in which to display time values. +// func (f CatShards) WithTime(v string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Time = v @@ -256,6 +269,7 @@ func (f CatShards) WithTime(v string) func(*CatShardsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatShards) WithV(v bool) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.V = &v @@ -263,6 +277,7 @@ func (f CatShards) WithV(v bool) func(*CatShardsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatShards) WithPretty() func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Pretty = true @@ -270,6 +285,7 @@ func (f CatShards) WithPretty() func(*CatShardsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatShards) WithHuman() func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.Human = true @@ -277,6 +293,7 @@ func (f CatShards) WithHuman() func(*CatShardsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatShards) WithErrorTrace() func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.ErrorTrace = true @@ -284,6 +301,7 @@ func (f CatShards) WithErrorTrace() func(*CatShardsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatShards) WithFilterPath(v ...string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { r.FilterPath = v @@ -291,6 +309,7 @@ func (f CatShards) WithFilterPath(v ...string) func(*CatShardsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatShards) WithHeader(h map[string]string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { if r.Header == nil { @@ -303,6 +322,7 @@ func (f CatShards) WithHeader(h map[string]string) func(*CatShardsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatShards) WithOpaqueID(s string) func(*CatShardsRequest) { return func(r *CatShardsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.snapshots.go index 8c0f1b2d7d9..7ef2b02320c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.snapshots.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatSnapshotsFunc(t Transport) CatSnapshots { // CatSnapshots returns all snapshots in a specific repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html. +// type CatSnapshots func(o ...func(*CatSnapshotsRequest)) (*Response, error) // CatSnapshotsRequest configures the Cat Snapshots API request. +// type CatSnapshotsRequest struct { Repository []string @@ -68,6 +70,7 @@ type CatSnapshotsRequest struct { } // Do executes the request and returns response or error. +// func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -181,6 +184,7 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f CatSnapshots) WithContext(v context.Context) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.ctx = v @@ -188,6 +192,7 @@ func (f CatSnapshots) WithContext(v context.Context) func(*CatSnapshotsRequest) } // WithRepository - name of repository from which to fetch the snapshot information. +// func (f CatSnapshots) WithRepository(v ...string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.Repository = v @@ -195,6 +200,7 @@ func (f CatSnapshots) WithRepository(v ...string) func(*CatSnapshotsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatSnapshots) WithFormat(v string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.Format = v @@ -202,6 +208,7 @@ func (f CatSnapshots) WithFormat(v string) func(*CatSnapshotsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatSnapshots) WithH(v ...string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.H = v @@ -209,6 +216,7 @@ func (f CatSnapshots) WithH(v ...string) func(*CatSnapshotsRequest) { } // WithHelp - return help information. +// func (f CatSnapshots) WithHelp(v bool) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.Help = &v @@ -216,6 +224,7 @@ func (f CatSnapshots) WithHelp(v bool) func(*CatSnapshotsRequest) { } // WithIgnoreUnavailable - set to true to ignore unavailable snapshots. +// func (f CatSnapshots) WithIgnoreUnavailable(v bool) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.IgnoreUnavailable = &v @@ -223,6 +232,7 @@ func (f CatSnapshots) WithIgnoreUnavailable(v bool) func(*CatSnapshotsRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatSnapshots) WithMasterTimeout(v time.Duration) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.MasterTimeout = v @@ -230,6 +240,7 @@ func (f CatSnapshots) WithMasterTimeout(v time.Duration) func(*CatSnapshotsReque } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatSnapshots) WithS(v ...string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.S = v @@ -237,6 +248,7 @@ func (f CatSnapshots) WithS(v ...string) func(*CatSnapshotsRequest) { } // WithTime - the unit in which to display time values. +// func (f CatSnapshots) WithTime(v string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.Time = v @@ -244,6 +256,7 @@ func (f CatSnapshots) WithTime(v string) func(*CatSnapshotsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatSnapshots) WithV(v bool) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.V = &v @@ -251,6 +264,7 @@ func (f CatSnapshots) WithV(v bool) func(*CatSnapshotsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatSnapshots) WithPretty() func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.Pretty = true @@ -258,6 +272,7 @@ func (f CatSnapshots) WithPretty() func(*CatSnapshotsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatSnapshots) WithHuman() func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.Human = true @@ -265,6 +280,7 @@ func (f CatSnapshots) WithHuman() func(*CatSnapshotsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatSnapshots) WithErrorTrace() func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.ErrorTrace = true @@ -272,6 +288,7 @@ func (f CatSnapshots) WithErrorTrace() func(*CatSnapshotsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatSnapshots) WithFilterPath(v ...string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { r.FilterPath = v @@ -279,6 +296,7 @@ func (f CatSnapshots) WithFilterPath(v ...string) func(*CatSnapshotsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatSnapshots) WithHeader(h map[string]string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { if r.Header == nil { @@ -291,6 +309,7 @@ func (f CatSnapshots) WithHeader(h map[string]string) func(*CatSnapshotsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatSnapshots) WithOpaqueID(s string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.tasks.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.tasks.go index 36154ac4a07..5153d498a14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.tasks.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatTasksFunc(t Transport) CatTasks { // CatTasks returns information about the tasks currently executing on one or more nodes in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// type CatTasks func(o ...func(*CatTasksRequest)) (*Response, error) // CatTasksRequest configures the Cat Tasks API request. +// type CatTasksRequest struct { Actions []string Detailed *bool @@ -67,6 +69,7 @@ type CatTasksRequest struct { } // Do executes the request and returns response or error. +// func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -181,6 +184,7 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f CatTasks) WithContext(v context.Context) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.ctx = v @@ -188,6 +192,7 @@ func (f CatTasks) WithContext(v context.Context) func(*CatTasksRequest) { } // WithActions - a list of actions that should be returned. leave empty to return all.. +// func (f CatTasks) WithActions(v ...string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Actions = v @@ -195,6 +200,7 @@ func (f CatTasks) WithActions(v ...string) func(*CatTasksRequest) { } // WithDetailed - return detailed task information (default: false). +// func (f CatTasks) WithDetailed(v bool) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Detailed = &v @@ -202,6 +208,7 @@ func (f CatTasks) WithDetailed(v bool) func(*CatTasksRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatTasks) WithFormat(v string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Format = v @@ -209,6 +216,7 @@ func (f CatTasks) WithFormat(v string) func(*CatTasksRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatTasks) WithH(v ...string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.H = v @@ -216,6 +224,7 @@ func (f CatTasks) WithH(v ...string) func(*CatTasksRequest) { } // WithHelp - return help information. +// func (f CatTasks) WithHelp(v bool) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Help = &v @@ -223,6 +232,7 @@ func (f CatTasks) WithHelp(v bool) func(*CatTasksRequest) { } // WithNodes - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f CatTasks) WithNodes(v ...string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Nodes = v @@ -230,6 +240,7 @@ func (f CatTasks) WithNodes(v ...string) func(*CatTasksRequest) { } // WithParentTaskID - return tasks with specified parent task ID (node_id:task_number). set to -1 to return all.. +// func (f CatTasks) WithParentTaskID(v string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.ParentTaskID = v @@ -237,6 +248,7 @@ func (f CatTasks) WithParentTaskID(v string) func(*CatTasksRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatTasks) WithS(v ...string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.S = v @@ -244,6 +256,7 @@ func (f CatTasks) WithS(v ...string) func(*CatTasksRequest) { } // WithTime - the unit in which to display time values. +// func (f CatTasks) WithTime(v string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Time = v @@ -251,6 +264,7 @@ func (f CatTasks) WithTime(v string) func(*CatTasksRequest) { } // WithV - verbose mode. display column headers. +// func (f CatTasks) WithV(v bool) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.V = &v @@ -258,6 +272,7 @@ func (f CatTasks) WithV(v bool) func(*CatTasksRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatTasks) WithPretty() func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Pretty = true @@ -265,6 +280,7 @@ func (f CatTasks) WithPretty() func(*CatTasksRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatTasks) WithHuman() func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.Human = true @@ -272,6 +288,7 @@ func (f CatTasks) WithHuman() func(*CatTasksRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatTasks) WithErrorTrace() func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.ErrorTrace = true @@ -279,6 +296,7 @@ func (f CatTasks) WithErrorTrace() func(*CatTasksRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatTasks) WithFilterPath(v ...string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { r.FilterPath = v @@ -286,6 +304,7 @@ func (f CatTasks) WithFilterPath(v ...string) func(*CatTasksRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatTasks) WithHeader(h map[string]string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { if r.Header == nil { @@ -298,6 +317,7 @@ func (f CatTasks) WithHeader(h map[string]string) func(*CatTasksRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatTasks) WithOpaqueID(s string) func(*CatTasksRequest) { return func(r *CatTasksRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.templates.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.templates.go index 7978d6bbe3b..db7cc602100 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.templates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.templates.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCatTemplatesFunc(t Transport) CatTemplates { // CatTemplates returns information about existing templates. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html. +// type CatTemplates func(o ...func(*CatTemplatesRequest)) (*Response, error) // CatTemplatesRequest configures the Cat Templates API request. +// type CatTemplatesRequest struct { Name string @@ -67,6 +69,7 @@ type CatTemplatesRequest struct { } // Do executes the request and returns response or error. +// func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -176,6 +179,7 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f CatTemplates) WithContext(v context.Context) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.ctx = v @@ -183,6 +187,7 @@ func (f CatTemplates) WithContext(v context.Context) func(*CatTemplatesRequest) } // WithName - a pattern that returned template names must match. +// func (f CatTemplates) WithName(v string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.Name = v @@ -190,6 +195,7 @@ func (f CatTemplates) WithName(v string) func(*CatTemplatesRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatTemplates) WithFormat(v string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.Format = v @@ -197,6 +203,7 @@ func (f CatTemplates) WithFormat(v string) func(*CatTemplatesRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatTemplates) WithH(v ...string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.H = v @@ -204,6 +211,7 @@ func (f CatTemplates) WithH(v ...string) func(*CatTemplatesRequest) { } // WithHelp - return help information. +// func (f CatTemplates) WithHelp(v bool) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.Help = &v @@ -211,6 +219,7 @@ func (f CatTemplates) WithHelp(v bool) func(*CatTemplatesRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatTemplates) WithLocal(v bool) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.Local = &v @@ -218,6 +227,7 @@ func (f CatTemplates) WithLocal(v bool) func(*CatTemplatesRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatTemplates) WithMasterTimeout(v time.Duration) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.MasterTimeout = v @@ -225,6 +235,7 @@ func (f CatTemplates) WithMasterTimeout(v time.Duration) func(*CatTemplatesReque } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatTemplates) WithS(v ...string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.S = v @@ -232,6 +243,7 @@ func (f CatTemplates) WithS(v ...string) func(*CatTemplatesRequest) { } // WithV - verbose mode. display column headers. +// func (f CatTemplates) WithV(v bool) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.V = &v @@ -239,6 +251,7 @@ func (f CatTemplates) WithV(v bool) func(*CatTemplatesRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatTemplates) WithPretty() func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.Pretty = true @@ -246,6 +259,7 @@ func (f CatTemplates) WithPretty() func(*CatTemplatesRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatTemplates) WithHuman() func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.Human = true @@ -253,6 +267,7 @@ func (f CatTemplates) WithHuman() func(*CatTemplatesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatTemplates) WithErrorTrace() func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.ErrorTrace = true @@ -260,6 +275,7 @@ func (f CatTemplates) WithErrorTrace() func(*CatTemplatesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatTemplates) WithFilterPath(v ...string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { r.FilterPath = v @@ -267,6 +283,7 @@ func (f CatTemplates) WithFilterPath(v ...string) func(*CatTemplatesRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatTemplates) WithHeader(h map[string]string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { if r.Header == nil { @@ -279,6 +296,7 @@ func (f CatTemplates) WithHeader(h map[string]string) func(*CatTemplatesRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatTemplates) WithOpaqueID(s string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.thread_pool.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.thread_pool.go index d38c99f06e8..0edbf6ae1f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.thread_pool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cat.thread_pool.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newCatThreadPoolFunc(t Transport) CatThreadPool { // By default the active, queue and rejected statistics are returned for all thread pools. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html. +// type CatThreadPool func(o ...func(*CatThreadPoolRequest)) (*Response, error) // CatThreadPoolRequest configures the Cat Thread Pool API request. +// type CatThreadPoolRequest struct { ThreadPoolPatterns []string @@ -69,6 +71,7 @@ type CatThreadPoolRequest struct { } // Do executes the request and returns response or error. +// func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -182,6 +185,7 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f CatThreadPool) WithContext(v context.Context) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.ctx = v @@ -189,6 +193,7 @@ func (f CatThreadPool) WithContext(v context.Context) func(*CatThreadPoolRequest } // WithThreadPoolPatterns - a list of regular-expressions to filter the thread pools in the output. +// func (f CatThreadPool) WithThreadPoolPatterns(v ...string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.ThreadPoolPatterns = v @@ -196,6 +201,7 @@ func (f CatThreadPool) WithThreadPoolPatterns(v ...string) func(*CatThreadPoolRe } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatThreadPool) WithFormat(v string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.Format = v @@ -203,6 +209,7 @@ func (f CatThreadPool) WithFormat(v string) func(*CatThreadPoolRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatThreadPool) WithH(v ...string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.H = v @@ -210,6 +217,7 @@ func (f CatThreadPool) WithH(v ...string) func(*CatThreadPoolRequest) { } // WithHelp - return help information. +// func (f CatThreadPool) WithHelp(v bool) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.Help = &v @@ -217,6 +225,7 @@ func (f CatThreadPool) WithHelp(v bool) func(*CatThreadPoolRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f CatThreadPool) WithLocal(v bool) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.Local = &v @@ -224,6 +233,7 @@ func (f CatThreadPool) WithLocal(v bool) func(*CatThreadPoolRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f CatThreadPool) WithMasterTimeout(v time.Duration) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.MasterTimeout = v @@ -231,6 +241,7 @@ func (f CatThreadPool) WithMasterTimeout(v time.Duration) func(*CatThreadPoolReq } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatThreadPool) WithS(v ...string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.S = v @@ -238,6 +249,7 @@ func (f CatThreadPool) WithS(v ...string) func(*CatThreadPoolRequest) { } // WithSize - the multiplier in which to display values. +// func (f CatThreadPool) WithSize(v string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.Size = v @@ -245,6 +257,7 @@ func (f CatThreadPool) WithSize(v string) func(*CatThreadPoolRequest) { } // WithV - verbose mode. display column headers. +// func (f CatThreadPool) WithV(v bool) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.V = &v @@ -252,6 +265,7 @@ func (f CatThreadPool) WithV(v bool) func(*CatThreadPoolRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatThreadPool) WithPretty() func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.Pretty = true @@ -259,6 +273,7 @@ func (f CatThreadPool) WithPretty() func(*CatThreadPoolRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatThreadPool) WithHuman() func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.Human = true @@ -266,6 +281,7 @@ func (f CatThreadPool) WithHuman() func(*CatThreadPoolRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatThreadPool) WithErrorTrace() func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.ErrorTrace = true @@ -273,6 +289,7 @@ func (f CatThreadPool) WithErrorTrace() func(*CatThreadPoolRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatThreadPool) WithFilterPath(v ...string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { r.FilterPath = v @@ -280,6 +297,7 @@ func (f CatThreadPool) WithFilterPath(v ...string) func(*CatThreadPoolRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatThreadPool) WithHeader(h map[string]string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { if r.Header == nil { @@ -292,6 +310,7 @@ func (f CatThreadPool) WithHeader(h map[string]string) func(*CatThreadPoolReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatThreadPool) WithOpaqueID(s string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.clear_scroll.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.clear_scroll.go index ef6f19a3d55..15cf4fff9d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.clear_scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.clear_scroll.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newClearScrollFunc(t Transport) ClearScroll { // ClearScroll explicitly clears the search context for a scroll. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-scroll-api.html. +// type ClearScroll func(o ...func(*ClearScrollRequest)) (*Response, error) // ClearScrollRequest configures the Clear Scroll API request. +// type ClearScrollRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type ClearScrollRequest struct { } // Do executes the request and returns response or error. +// func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo 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 @@ -122,10 +129,6 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f ClearScroll) WithContext(v context.Context) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f ClearScroll) WithContext(v context.Context) func(*ClearScrollRequest) { } // WithBody - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter. +// func (f ClearScroll) WithBody(v io.Reader) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.Body = v @@ -159,6 +164,7 @@ func (f ClearScroll) WithBody(v io.Reader) func(*ClearScrollRequest) { } // WithScrollID - a list of scroll ids to clear. +// func (f ClearScroll) WithScrollID(v ...string) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.ScrollID = v @@ -166,6 +172,7 @@ func (f ClearScroll) WithScrollID(v ...string) func(*ClearScrollRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ClearScroll) WithPretty() func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.Pretty = true @@ -173,6 +180,7 @@ func (f ClearScroll) WithPretty() func(*ClearScrollRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClearScroll) WithHuman() func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.Human = true @@ -180,6 +188,7 @@ func (f ClearScroll) WithHuman() func(*ClearScrollRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClearScroll) WithErrorTrace() func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.ErrorTrace = true @@ -187,6 +196,7 @@ func (f ClearScroll) WithErrorTrace() func(*ClearScrollRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClearScroll) WithFilterPath(v ...string) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { r.FilterPath = v @@ -194,6 +204,7 @@ func (f ClearScroll) WithFilterPath(v ...string) func(*ClearScrollRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ClearScroll) WithHeader(h map[string]string) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { if r.Header == nil { @@ -206,6 +217,7 @@ func (f ClearScroll) WithHeader(h map[string]string) func(*ClearScrollRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClearScroll) WithOpaqueID(s string) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.allocation_explain.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.allocation_explain.go index f611efcebcb..c8b082cd949 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.allocation_explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.allocation_explain.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterAllocationExplainFunc(t Transport) ClusterAllocationExplain { // ClusterAllocationExplain provides explanations for shard allocations in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html. +// type ClusterAllocationExplain func(o ...func(*ClusterAllocationExplainRequest)) (*Response, error) // ClusterAllocationExplainRequest configures the Cluster Allocation Explain API request. +// type ClusterAllocationExplainRequest struct { Body io.Reader @@ -62,6 +64,7 @@ type ClusterAllocationExplainRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -113,6 +116,10 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans 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 @@ -125,10 +132,6 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -148,6 +151,7 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f ClusterAllocationExplain) WithContext(v context.Context) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f ClusterAllocationExplain) WithContext(v context.Context) func(*ClusterAl } // WithBody - The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard'. +// func (f ClusterAllocationExplain) WithBody(v io.Reader) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.Body = v @@ -162,6 +167,7 @@ func (f ClusterAllocationExplain) WithBody(v io.Reader) func(*ClusterAllocationE } // WithIncludeDiskInfo - return information about disk usage and shard sizes (default: false). +// func (f ClusterAllocationExplain) WithIncludeDiskInfo(v bool) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.IncludeDiskInfo = &v @@ -169,6 +175,7 @@ func (f ClusterAllocationExplain) WithIncludeDiskInfo(v bool) func(*ClusterAlloc } // WithIncludeYesDecisions - return 'yes' decisions in explanation (default: false). +// func (f ClusterAllocationExplain) WithIncludeYesDecisions(v bool) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.IncludeYesDecisions = &v @@ -176,6 +183,7 @@ func (f ClusterAllocationExplain) WithIncludeYesDecisions(v bool) func(*ClusterA } // WithPretty makes the response body pretty-printed. +// func (f ClusterAllocationExplain) WithPretty() func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.Pretty = true @@ -183,6 +191,7 @@ func (f ClusterAllocationExplain) WithPretty() func(*ClusterAllocationExplainReq } // WithHuman makes statistical values human-readable. +// func (f ClusterAllocationExplain) WithHuman() func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.Human = true @@ -190,6 +199,7 @@ func (f ClusterAllocationExplain) WithHuman() func(*ClusterAllocationExplainRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterAllocationExplain) WithErrorTrace() func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.ErrorTrace = true @@ -197,6 +207,7 @@ func (f ClusterAllocationExplain) WithErrorTrace() func(*ClusterAllocationExplai } // WithFilterPath filters the properties of the response body. +// func (f ClusterAllocationExplain) WithFilterPath(v ...string) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { r.FilterPath = v @@ -204,6 +215,7 @@ func (f ClusterAllocationExplain) WithFilterPath(v ...string) func(*ClusterAlloc } // WithHeader adds the headers to the HTTP request. +// func (f ClusterAllocationExplain) WithHeader(h map[string]string) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { if r.Header == nil { @@ -216,6 +228,7 @@ func (f ClusterAllocationExplain) WithHeader(h map[string]string) func(*ClusterA } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterAllocationExplain) WithOpaqueID(s string) func(*ClusterAllocationExplainRequest) { return func(r *ClusterAllocationExplainRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_component_template.go index 515136807aa..8634d196592 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newClusterDeleteComponentTemplateFunc(t Transport) ClusterDeleteComponentTe // ClusterDeleteComponentTemplate deletes a component template // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// type ClusterDeleteComponentTemplate func(name string, o ...func(*ClusterDeleteComponentTemplateRequest)) (*Response, error) // ClusterDeleteComponentTemplateRequest configures the Cluster Delete Component Template API request. +// type ClusterDeleteComponentTemplateRequest struct { Name string @@ -61,6 +63,7 @@ type ClusterDeleteComponentTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -146,6 +149,7 @@ func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f ClusterDeleteComponentTemplate) WithContext(v context.Context) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.ctx = v @@ -153,6 +157,7 @@ func (f ClusterDeleteComponentTemplate) WithContext(v context.Context) func(*Clu } // WithMasterTimeout - specify timeout for connection to master. +// func (f ClusterDeleteComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.MasterTimeout = v @@ -160,6 +165,7 @@ func (f ClusterDeleteComponentTemplate) WithMasterTimeout(v time.Duration) func( } // WithTimeout - explicit operation timeout. +// func (f ClusterDeleteComponentTemplate) WithTimeout(v time.Duration) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.Timeout = v @@ -167,6 +173,7 @@ func (f ClusterDeleteComponentTemplate) WithTimeout(v time.Duration) func(*Clust } // WithPretty makes the response body pretty-printed. +// func (f ClusterDeleteComponentTemplate) WithPretty() func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.Pretty = true @@ -174,6 +181,7 @@ func (f ClusterDeleteComponentTemplate) WithPretty() func(*ClusterDeleteComponen } // WithHuman makes statistical values human-readable. +// func (f ClusterDeleteComponentTemplate) WithHuman() func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.Human = true @@ -181,6 +189,7 @@ func (f ClusterDeleteComponentTemplate) WithHuman() func(*ClusterDeleteComponent } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterDeleteComponentTemplate) WithErrorTrace() func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.ErrorTrace = true @@ -188,6 +197,7 @@ func (f ClusterDeleteComponentTemplate) WithErrorTrace() func(*ClusterDeleteComp } // WithFilterPath filters the properties of the response body. +// func (f ClusterDeleteComponentTemplate) WithFilterPath(v ...string) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { r.FilterPath = v @@ -195,6 +205,7 @@ func (f ClusterDeleteComponentTemplate) WithFilterPath(v ...string) func(*Cluste } // WithHeader adds the headers to the HTTP request. +// func (f ClusterDeleteComponentTemplate) WithHeader(h map[string]string) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { if r.Header == nil { @@ -207,6 +218,7 @@ func (f ClusterDeleteComponentTemplate) WithHeader(h map[string]string) func(*Cl } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterDeleteComponentTemplate) WithOpaqueID(s string) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_voting_config_exclusions.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_voting_config_exclusions.go index 7ecc3824545..5f424346c63 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_voting_config_exclusions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.delete_voting_config_exclusions.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newClusterDeleteVotingConfigExclusionsFunc(t Transport) ClusterDeleteVoting // ClusterDeleteVotingConfigExclusions clears cluster voting config exclusions. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html. +// type ClusterDeleteVotingConfigExclusions func(o ...func(*ClusterDeleteVotingConfigExclusionsRequest)) (*Response, error) // ClusterDeleteVotingConfigExclusionsRequest configures the Cluster Delete Voting Config Exclusions API request. +// type ClusterDeleteVotingConfigExclusionsRequest struct { WaitForRemoval *bool @@ -58,6 +60,7 @@ type ClusterDeleteVotingConfigExclusionsRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterDeleteVotingConfigExclusionsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r ClusterDeleteVotingConfigExclusionsRequest) Do(ctx context.Context, tran } // WithContext sets the request context. +// func (f ClusterDeleteVotingConfigExclusions) WithContext(v context.Context) func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithContext(v context.Context) func } // WithWaitForRemoval - specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.. +// func (f ClusterDeleteVotingConfigExclusions) WithWaitForRemoval(v bool) func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { r.WaitForRemoval = &v @@ -150,6 +155,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithWaitForRemoval(v bool) func(*Cl } // WithPretty makes the response body pretty-printed. +// func (f ClusterDeleteVotingConfigExclusions) WithPretty() func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithPretty() func(*ClusterDeleteVot } // WithHuman makes statistical values human-readable. +// func (f ClusterDeleteVotingConfigExclusions) WithHuman() func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithHuman() func(*ClusterDeleteVoti } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterDeleteVotingConfigExclusions) WithErrorTrace() func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithErrorTrace() func(*ClusterDelet } // WithFilterPath filters the properties of the response body. +// func (f ClusterDeleteVotingConfigExclusions) WithFilterPath(v ...string) func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithFilterPath(v ...string) func(*C } // WithHeader adds the headers to the HTTP request. +// func (f ClusterDeleteVotingConfigExclusions) WithHeader(h map[string]string) func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f ClusterDeleteVotingConfigExclusions) WithHeader(h map[string]string) fun } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterDeleteVotingConfigExclusions) WithOpaqueID(s string) func(*ClusterDeleteVotingConfigExclusionsRequest) { return func(r *ClusterDeleteVotingConfigExclusionsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.exists_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.exists_component_template.go index fcfcaf01f27..813727a2261 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.exists_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.exists_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterExistsComponentTemplateFunc(t Transport) ClusterExistsComponentTe // ClusterExistsComponentTemplate returns information about whether a particular component template exist // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// type ClusterExistsComponentTemplate func(name string, o ...func(*ClusterExistsComponentTemplateRequest)) (*Response, error) // ClusterExistsComponentTemplateRequest configures the Cluster Exists Component Template API request. +// type ClusterExistsComponentTemplateRequest struct { Name string @@ -62,6 +64,7 @@ type ClusterExistsComponentTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -147,6 +150,7 @@ func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f ClusterExistsComponentTemplate) WithContext(v context.Context) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f ClusterExistsComponentTemplate) WithContext(v context.Context) func(*Clu } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f ClusterExistsComponentTemplate) WithLocal(v bool) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.Local = &v @@ -161,6 +166,7 @@ func (f ClusterExistsComponentTemplate) WithLocal(v bool) func(*ClusterExistsCom } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f ClusterExistsComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.MasterTimeout = v @@ -168,6 +174,7 @@ func (f ClusterExistsComponentTemplate) WithMasterTimeout(v time.Duration) func( } // WithPretty makes the response body pretty-printed. +// func (f ClusterExistsComponentTemplate) WithPretty() func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.Pretty = true @@ -175,6 +182,7 @@ func (f ClusterExistsComponentTemplate) WithPretty() func(*ClusterExistsComponen } // WithHuman makes statistical values human-readable. +// func (f ClusterExistsComponentTemplate) WithHuman() func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.Human = true @@ -182,6 +190,7 @@ func (f ClusterExistsComponentTemplate) WithHuman() func(*ClusterExistsComponent } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterExistsComponentTemplate) WithErrorTrace() func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.ErrorTrace = true @@ -189,6 +198,7 @@ func (f ClusterExistsComponentTemplate) WithErrorTrace() func(*ClusterExistsComp } // WithFilterPath filters the properties of the response body. +// func (f ClusterExistsComponentTemplate) WithFilterPath(v ...string) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { r.FilterPath = v @@ -196,6 +206,7 @@ func (f ClusterExistsComponentTemplate) WithFilterPath(v ...string) func(*Cluste } // WithHeader adds the headers to the HTTP request. +// func (f ClusterExistsComponentTemplate) WithHeader(h map[string]string) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { if r.Header == nil { @@ -208,6 +219,7 @@ func (f ClusterExistsComponentTemplate) WithHeader(h map[string]string) func(*Cl } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterExistsComponentTemplate) WithOpaqueID(s string) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_component_template.go index 89e707844e1..100190cd423 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterGetComponentTemplateFunc(t Transport) ClusterGetComponentTemplate // ClusterGetComponentTemplate returns one or more component templates // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// type ClusterGetComponentTemplate func(o ...func(*ClusterGetComponentTemplateRequest)) (*Response, error) // ClusterGetComponentTemplateRequest configures the Cluster Get Component Template API request. +// type ClusterGetComponentTemplateRequest struct { Name []string @@ -62,6 +64,7 @@ type ClusterGetComponentTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -149,6 +152,7 @@ func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Tr } // WithContext sets the request context. +// func (f ClusterGetComponentTemplate) WithContext(v context.Context) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f ClusterGetComponentTemplate) WithContext(v context.Context) func(*Cluste } // WithName - the comma separated names of the component templates. +// func (f ClusterGetComponentTemplate) WithName(v ...string) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.Name = v @@ -163,6 +168,7 @@ func (f ClusterGetComponentTemplate) WithName(v ...string) func(*ClusterGetCompo } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f ClusterGetComponentTemplate) WithLocal(v bool) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.Local = &v @@ -170,6 +176,7 @@ func (f ClusterGetComponentTemplate) WithLocal(v bool) func(*ClusterGetComponent } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f ClusterGetComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.MasterTimeout = v @@ -177,6 +184,7 @@ func (f ClusterGetComponentTemplate) WithMasterTimeout(v time.Duration) func(*Cl } // WithPretty makes the response body pretty-printed. +// func (f ClusterGetComponentTemplate) WithPretty() func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.Pretty = true @@ -184,6 +192,7 @@ func (f ClusterGetComponentTemplate) WithPretty() func(*ClusterGetComponentTempl } // WithHuman makes statistical values human-readable. +// func (f ClusterGetComponentTemplate) WithHuman() func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.Human = true @@ -191,6 +200,7 @@ func (f ClusterGetComponentTemplate) WithHuman() func(*ClusterGetComponentTempla } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterGetComponentTemplate) WithErrorTrace() func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.ErrorTrace = true @@ -198,6 +208,7 @@ func (f ClusterGetComponentTemplate) WithErrorTrace() func(*ClusterGetComponentT } // WithFilterPath filters the properties of the response body. +// func (f ClusterGetComponentTemplate) WithFilterPath(v ...string) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.FilterPath = v @@ -205,6 +216,7 @@ func (f ClusterGetComponentTemplate) WithFilterPath(v ...string) func(*ClusterGe } // WithHeader adds the headers to the HTTP request. +// func (f ClusterGetComponentTemplate) WithHeader(h map[string]string) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { if r.Header == nil { @@ -217,6 +229,7 @@ func (f ClusterGetComponentTemplate) WithHeader(h map[string]string) func(*Clust } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterGetComponentTemplate) WithOpaqueID(s string) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_settings.go index b070308ba00..987a8e3df96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.get_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterGetSettingsFunc(t Transport) ClusterGetSettings { // ClusterGetSettings returns cluster settings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html. +// type ClusterGetSettings func(o ...func(*ClusterGetSettingsRequest)) (*Response, error) // ClusterGetSettingsRequest configures the Cluster Get Settings API request. +// type ClusterGetSettingsRequest struct { FlatSettings *bool IncludeDefaults *bool @@ -62,6 +64,7 @@ type ClusterGetSettingsRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f ClusterGetSettings) WithContext(v context.Context) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f ClusterGetSettings) WithContext(v context.Context) func(*ClusterGetSetti } // WithFlatSettings - return settings in flat format (default: false). +// func (f ClusterGetSettings) WithFlatSettings(v bool) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.FlatSettings = &v @@ -166,6 +171,7 @@ func (f ClusterGetSettings) WithFlatSettings(v bool) func(*ClusterGetSettingsReq } // WithIncludeDefaults - whether to return all default clusters setting.. +// func (f ClusterGetSettings) WithIncludeDefaults(v bool) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.IncludeDefaults = &v @@ -173,6 +179,7 @@ func (f ClusterGetSettings) WithIncludeDefaults(v bool) func(*ClusterGetSettings } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f ClusterGetSettings) WithMasterTimeout(v time.Duration) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.MasterTimeout = v @@ -180,6 +187,7 @@ func (f ClusterGetSettings) WithMasterTimeout(v time.Duration) func(*ClusterGetS } // WithTimeout - explicit operation timeout. +// func (f ClusterGetSettings) WithTimeout(v time.Duration) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.Timeout = v @@ -187,6 +195,7 @@ func (f ClusterGetSettings) WithTimeout(v time.Duration) func(*ClusterGetSetting } // WithPretty makes the response body pretty-printed. +// func (f ClusterGetSettings) WithPretty() func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.Pretty = true @@ -194,6 +203,7 @@ func (f ClusterGetSettings) WithPretty() func(*ClusterGetSettingsRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterGetSettings) WithHuman() func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.Human = true @@ -201,6 +211,7 @@ func (f ClusterGetSettings) WithHuman() func(*ClusterGetSettingsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterGetSettings) WithErrorTrace() func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.ErrorTrace = true @@ -208,6 +219,7 @@ func (f ClusterGetSettings) WithErrorTrace() func(*ClusterGetSettingsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterGetSettings) WithFilterPath(v ...string) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { r.FilterPath = v @@ -215,6 +227,7 @@ func (f ClusterGetSettings) WithFilterPath(v ...string) func(*ClusterGetSettings } // WithHeader adds the headers to the HTTP request. +// func (f ClusterGetSettings) WithHeader(h map[string]string) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { if r.Header == nil { @@ -227,6 +240,7 @@ func (f ClusterGetSettings) WithHeader(h map[string]string) func(*ClusterGetSett } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterGetSettings) WithOpaqueID(s string) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.health.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.health.go index 7a18286d67d..ea5250aff16 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.health.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterHealthFunc(t Transport) ClusterHealth { // ClusterHealth returns basic information about the health of the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html. +// type ClusterHealth func(o ...func(*ClusterHealthRequest)) (*Response, error) // ClusterHealthRequest configures the Cluster Health API request. +// type ClusterHealthRequest struct { Index []string @@ -71,6 +73,7 @@ type ClusterHealthRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -196,6 +199,7 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f ClusterHealth) WithContext(v context.Context) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.ctx = v @@ -203,6 +207,7 @@ func (f ClusterHealth) WithContext(v context.Context) func(*ClusterHealthRequest } // WithIndex - limit the information returned to a specific index. +// func (f ClusterHealth) WithIndex(v ...string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.Index = v @@ -210,6 +215,7 @@ func (f ClusterHealth) WithIndex(v ...string) func(*ClusterHealthRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f ClusterHealth) WithExpandWildcards(v string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.ExpandWildcards = v @@ -217,6 +223,7 @@ func (f ClusterHealth) WithExpandWildcards(v string) func(*ClusterHealthRequest) } // WithLevel - specify the level of detail for returned information. +// func (f ClusterHealth) WithLevel(v string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.Level = v @@ -224,6 +231,7 @@ func (f ClusterHealth) WithLevel(v string) func(*ClusterHealthRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f ClusterHealth) WithLocal(v bool) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.Local = &v @@ -231,6 +239,7 @@ func (f ClusterHealth) WithLocal(v bool) func(*ClusterHealthRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f ClusterHealth) WithMasterTimeout(v time.Duration) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.MasterTimeout = v @@ -238,6 +247,7 @@ func (f ClusterHealth) WithMasterTimeout(v time.Duration) func(*ClusterHealthReq } // WithTimeout - explicit operation timeout. +// func (f ClusterHealth) WithTimeout(v time.Duration) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.Timeout = v @@ -245,6 +255,7 @@ func (f ClusterHealth) WithTimeout(v time.Duration) func(*ClusterHealthRequest) } // WithWaitForActiveShards - wait until the specified number of shards is active. +// func (f ClusterHealth) WithWaitForActiveShards(v string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.WaitForActiveShards = v @@ -252,6 +263,7 @@ func (f ClusterHealth) WithWaitForActiveShards(v string) func(*ClusterHealthRequ } // WithWaitForEvents - wait until all currently queued events with the given priority are processed. +// func (f ClusterHealth) WithWaitForEvents(v string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.WaitForEvents = v @@ -259,6 +271,7 @@ func (f ClusterHealth) WithWaitForEvents(v string) func(*ClusterHealthRequest) { } // WithWaitForNoInitializingShards - whether to wait until there are no initializing shards in the cluster. +// func (f ClusterHealth) WithWaitForNoInitializingShards(v bool) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.WaitForNoInitializingShards = &v @@ -266,6 +279,7 @@ func (f ClusterHealth) WithWaitForNoInitializingShards(v bool) func(*ClusterHeal } // WithWaitForNoRelocatingShards - whether to wait until there are no relocating shards in the cluster. +// func (f ClusterHealth) WithWaitForNoRelocatingShards(v bool) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.WaitForNoRelocatingShards = &v @@ -273,6 +287,7 @@ func (f ClusterHealth) WithWaitForNoRelocatingShards(v bool) func(*ClusterHealth } // WithWaitForNodes - wait until the specified number of nodes is available. +// func (f ClusterHealth) WithWaitForNodes(v string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.WaitForNodes = v @@ -280,6 +295,7 @@ func (f ClusterHealth) WithWaitForNodes(v string) func(*ClusterHealthRequest) { } // WithWaitForStatus - wait until cluster is in a specific state. +// func (f ClusterHealth) WithWaitForStatus(v string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.WaitForStatus = v @@ -287,6 +303,7 @@ func (f ClusterHealth) WithWaitForStatus(v string) func(*ClusterHealthRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ClusterHealth) WithPretty() func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.Pretty = true @@ -294,6 +311,7 @@ func (f ClusterHealth) WithPretty() func(*ClusterHealthRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterHealth) WithHuman() func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.Human = true @@ -301,6 +319,7 @@ func (f ClusterHealth) WithHuman() func(*ClusterHealthRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterHealth) WithErrorTrace() func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.ErrorTrace = true @@ -308,6 +327,7 @@ func (f ClusterHealth) WithErrorTrace() func(*ClusterHealthRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterHealth) WithFilterPath(v ...string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.FilterPath = v @@ -315,6 +335,7 @@ func (f ClusterHealth) WithFilterPath(v ...string) func(*ClusterHealthRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ClusterHealth) WithHeader(h map[string]string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { if r.Header == nil { @@ -327,6 +348,7 @@ func (f ClusterHealth) WithHeader(h map[string]string) func(*ClusterHealthReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterHealth) WithOpaqueID(s string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.pending_tasks.go index deaa07de868..6e30f76b870 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.pending_tasks.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newClusterPendingTasksFunc(t Transport) ClusterPendingTasks { // allocate or fail shard) which have not yet been executed. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html. +// type ClusterPendingTasks func(o ...func(*ClusterPendingTasksRequest)) (*Response, error) // ClusterPendingTasksRequest configures the Cluster Pending Tasks API request. +// type ClusterPendingTasksRequest struct { Local *bool MasterTimeout time.Duration @@ -61,6 +63,7 @@ type ClusterPendingTasksRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f ClusterPendingTasks) WithContext(v context.Context) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f ClusterPendingTasks) WithContext(v context.Context) func(*ClusterPending } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f ClusterPendingTasks) WithLocal(v bool) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.Local = &v @@ -157,6 +162,7 @@ func (f ClusterPendingTasks) WithLocal(v bool) func(*ClusterPendingTasksRequest) } // WithMasterTimeout - specify timeout for connection to master. +// func (f ClusterPendingTasks) WithMasterTimeout(v time.Duration) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.MasterTimeout = v @@ -164,6 +170,7 @@ func (f ClusterPendingTasks) WithMasterTimeout(v time.Duration) func(*ClusterPen } // WithPretty makes the response body pretty-printed. +// func (f ClusterPendingTasks) WithPretty() func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.Pretty = true @@ -171,6 +178,7 @@ func (f ClusterPendingTasks) WithPretty() func(*ClusterPendingTasksRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterPendingTasks) WithHuman() func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.Human = true @@ -178,6 +186,7 @@ func (f ClusterPendingTasks) WithHuman() func(*ClusterPendingTasksRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterPendingTasks) WithErrorTrace() func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.ErrorTrace = true @@ -185,6 +194,7 @@ func (f ClusterPendingTasks) WithErrorTrace() func(*ClusterPendingTasksRequest) } // WithFilterPath filters the properties of the response body. +// func (f ClusterPendingTasks) WithFilterPath(v ...string) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { r.FilterPath = v @@ -192,6 +202,7 @@ func (f ClusterPendingTasks) WithFilterPath(v ...string) func(*ClusterPendingTas } // WithHeader adds the headers to the HTTP request. +// func (f ClusterPendingTasks) WithHeader(h map[string]string) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { if r.Header == nil { @@ -204,6 +215,7 @@ func (f ClusterPendingTasks) WithHeader(h map[string]string) func(*ClusterPendin } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterPendingTasks) WithOpaqueID(s string) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.post_voting_config_exclusions.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.post_voting_config_exclusions.go index e3a18df15a4..2ccd6443b3f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.post_voting_config_exclusions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.post_voting_config_exclusions.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newClusterPostVotingConfigExclusionsFunc(t Transport) ClusterPostVotingConf // ClusterPostVotingConfigExclusions updates the cluster voting config exclusions by node ids or node names. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html. +// type ClusterPostVotingConfigExclusions func(o ...func(*ClusterPostVotingConfigExclusionsRequest)) (*Response, error) // ClusterPostVotingConfigExclusionsRequest configures the Cluster Post Voting Config Exclusions API request. +// type ClusterPostVotingConfigExclusionsRequest struct { NodeIds string NodeNames string @@ -60,6 +62,7 @@ type ClusterPostVotingConfigExclusionsRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterPostVotingConfigExclusionsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -146,6 +149,7 @@ func (r ClusterPostVotingConfigExclusionsRequest) Do(ctx context.Context, transp } // WithContext sets the request context. +// func (f ClusterPostVotingConfigExclusions) WithContext(v context.Context) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.ctx = v @@ -153,6 +157,7 @@ func (f ClusterPostVotingConfigExclusions) WithContext(v context.Context) func(* } // WithNodeIds - a list of the persistent ids of the nodes to exclude from the voting configuration. if specified, you may not also specify ?node_names.. +// func (f ClusterPostVotingConfigExclusions) WithNodeIds(v string) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.NodeIds = v @@ -160,6 +165,7 @@ func (f ClusterPostVotingConfigExclusions) WithNodeIds(v string) func(*ClusterPo } // WithNodeNames - a list of the names of the nodes to exclude from the voting configuration. if specified, you may not also specify ?node_ids.. +// func (f ClusterPostVotingConfigExclusions) WithNodeNames(v string) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.NodeNames = v @@ -167,6 +173,7 @@ func (f ClusterPostVotingConfigExclusions) WithNodeNames(v string) func(*Cluster } // WithTimeout - explicit operation timeout. +// func (f ClusterPostVotingConfigExclusions) WithTimeout(v time.Duration) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.Timeout = v @@ -174,6 +181,7 @@ func (f ClusterPostVotingConfigExclusions) WithTimeout(v time.Duration) func(*Cl } // WithPretty makes the response body pretty-printed. +// func (f ClusterPostVotingConfigExclusions) WithPretty() func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.Pretty = true @@ -181,6 +189,7 @@ func (f ClusterPostVotingConfigExclusions) WithPretty() func(*ClusterPostVotingC } // WithHuman makes statistical values human-readable. +// func (f ClusterPostVotingConfigExclusions) WithHuman() func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.Human = true @@ -188,6 +197,7 @@ func (f ClusterPostVotingConfigExclusions) WithHuman() func(*ClusterPostVotingCo } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterPostVotingConfigExclusions) WithErrorTrace() func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.ErrorTrace = true @@ -195,6 +205,7 @@ func (f ClusterPostVotingConfigExclusions) WithErrorTrace() func(*ClusterPostVot } // WithFilterPath filters the properties of the response body. +// func (f ClusterPostVotingConfigExclusions) WithFilterPath(v ...string) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { r.FilterPath = v @@ -202,6 +213,7 @@ func (f ClusterPostVotingConfigExclusions) WithFilterPath(v ...string) func(*Clu } // WithHeader adds the headers to the HTTP request. +// func (f ClusterPostVotingConfigExclusions) WithHeader(h map[string]string) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { if r.Header == nil { @@ -214,6 +226,7 @@ func (f ClusterPostVotingConfigExclusions) WithHeader(h map[string]string) func( } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterPostVotingConfigExclusions) WithOpaqueID(s string) func(*ClusterPostVotingConfigExclusionsRequest) { return func(r *ClusterPostVotingConfigExclusionsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_component_template.go index b03f570f916..0ec5a27d3cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newClusterPutComponentTemplateFunc(t Transport) ClusterPutComponentTemplate // ClusterPutComponentTemplate creates or updates a component template // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// type ClusterPutComponentTemplate func(name string, body io.Reader, o ...func(*ClusterPutComponentTemplateRequest)) (*Response, error) // ClusterPutComponentTemplateRequest configures the Cluster Put Component Template API request. +// type ClusterPutComponentTemplateRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type ClusterPutComponentTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -124,6 +127,10 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr 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 @@ -136,10 +143,6 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -159,6 +162,7 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr } // WithContext sets the request context. +// func (f ClusterPutComponentTemplate) WithContext(v context.Context) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.ctx = v @@ -166,6 +170,7 @@ func (f ClusterPutComponentTemplate) WithContext(v context.Context) func(*Cluste } // WithCreate - whether the index template should only be added if new or can also replace an existing one. +// func (f ClusterPutComponentTemplate) WithCreate(v bool) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.Create = &v @@ -173,6 +178,7 @@ func (f ClusterPutComponentTemplate) WithCreate(v bool) func(*ClusterPutComponen } // WithMasterTimeout - specify timeout for connection to master. +// func (f ClusterPutComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.MasterTimeout = v @@ -180,6 +186,7 @@ func (f ClusterPutComponentTemplate) WithMasterTimeout(v time.Duration) func(*Cl } // WithTimeout - explicit operation timeout. +// func (f ClusterPutComponentTemplate) WithTimeout(v time.Duration) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.Timeout = v @@ -187,6 +194,7 @@ func (f ClusterPutComponentTemplate) WithTimeout(v time.Duration) func(*ClusterP } // WithPretty makes the response body pretty-printed. +// func (f ClusterPutComponentTemplate) WithPretty() func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.Pretty = true @@ -194,6 +202,7 @@ func (f ClusterPutComponentTemplate) WithPretty() func(*ClusterPutComponentTempl } // WithHuman makes statistical values human-readable. +// func (f ClusterPutComponentTemplate) WithHuman() func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.Human = true @@ -201,6 +210,7 @@ func (f ClusterPutComponentTemplate) WithHuman() func(*ClusterPutComponentTempla } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterPutComponentTemplate) WithErrorTrace() func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.ErrorTrace = true @@ -208,6 +218,7 @@ func (f ClusterPutComponentTemplate) WithErrorTrace() func(*ClusterPutComponentT } // WithFilterPath filters the properties of the response body. +// func (f ClusterPutComponentTemplate) WithFilterPath(v ...string) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { r.FilterPath = v @@ -215,6 +226,7 @@ func (f ClusterPutComponentTemplate) WithFilterPath(v ...string) func(*ClusterPu } // WithHeader adds the headers to the HTTP request. +// func (f ClusterPutComponentTemplate) WithHeader(h map[string]string) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { if r.Header == nil { @@ -227,6 +239,7 @@ func (f ClusterPutComponentTemplate) WithHeader(h map[string]string) func(*Clust } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterPutComponentTemplate) WithOpaqueID(s string) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_settings.go index f784cc3964c..1a48ced2b71 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.put_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newClusterPutSettingsFunc(t Transport) ClusterPutSettings { // ClusterPutSettings updates the cluster settings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html. +// type ClusterPutSettings func(body io.Reader, o ...func(*ClusterPutSettingsRequest)) (*Response, error) // ClusterPutSettingsRequest configures the Cluster Put Settings API request. +// type ClusterPutSettingsRequest struct { Body io.Reader @@ -64,6 +66,7 @@ type ClusterPutSettingsRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -119,6 +122,10 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) 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 @@ -131,10 +138,6 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -154,6 +157,7 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f ClusterPutSettings) WithContext(v context.Context) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f ClusterPutSettings) WithContext(v context.Context) func(*ClusterPutSetti } // WithFlatSettings - return settings in flat format (default: false). +// func (f ClusterPutSettings) WithFlatSettings(v bool) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.FlatSettings = &v @@ -168,6 +173,7 @@ func (f ClusterPutSettings) WithFlatSettings(v bool) func(*ClusterPutSettingsReq } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f ClusterPutSettings) WithMasterTimeout(v time.Duration) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.MasterTimeout = v @@ -175,6 +181,7 @@ func (f ClusterPutSettings) WithMasterTimeout(v time.Duration) func(*ClusterPutS } // WithTimeout - explicit operation timeout. +// func (f ClusterPutSettings) WithTimeout(v time.Duration) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.Timeout = v @@ -182,6 +189,7 @@ func (f ClusterPutSettings) WithTimeout(v time.Duration) func(*ClusterPutSetting } // WithPretty makes the response body pretty-printed. +// func (f ClusterPutSettings) WithPretty() func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.Pretty = true @@ -189,6 +197,7 @@ func (f ClusterPutSettings) WithPretty() func(*ClusterPutSettingsRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterPutSettings) WithHuman() func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.Human = true @@ -196,6 +205,7 @@ func (f ClusterPutSettings) WithHuman() func(*ClusterPutSettingsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterPutSettings) WithErrorTrace() func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.ErrorTrace = true @@ -203,6 +213,7 @@ func (f ClusterPutSettings) WithErrorTrace() func(*ClusterPutSettingsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterPutSettings) WithFilterPath(v ...string) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { r.FilterPath = v @@ -210,6 +221,7 @@ func (f ClusterPutSettings) WithFilterPath(v ...string) func(*ClusterPutSettings } // WithHeader adds the headers to the HTTP request. +// func (f ClusterPutSettings) WithHeader(h map[string]string) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { if r.Header == nil { @@ -222,6 +234,7 @@ func (f ClusterPutSettings) WithHeader(h map[string]string) func(*ClusterPutSett } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterPutSettings) WithOpaqueID(s string) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.remote_info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.remote_info.go index fe36c0784e4..f24043e6f39 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.remote_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.remote_info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newClusterRemoteInfoFunc(t Transport) ClusterRemoteInfo { // ClusterRemoteInfo returns the information about configured remote clusters. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html. +// type ClusterRemoteInfo func(o ...func(*ClusterRemoteInfoRequest)) (*Response, error) // ClusterRemoteInfoRequest configures the Cluster Remote Info API request. +// type ClusterRemoteInfoRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type ClusterRemoteInfoRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f ClusterRemoteInfo) WithContext(v context.Context) func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f ClusterRemoteInfo) WithContext(v context.Context) func(*ClusterRemoteInf } // WithPretty makes the response body pretty-printed. +// func (f ClusterRemoteInfo) WithPretty() func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f ClusterRemoteInfo) WithPretty() func(*ClusterRemoteInfoRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterRemoteInfo) WithHuman() func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f ClusterRemoteInfo) WithHuman() func(*ClusterRemoteInfoRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterRemoteInfo) WithErrorTrace() func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f ClusterRemoteInfo) WithErrorTrace() func(*ClusterRemoteInfoRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterRemoteInfo) WithFilterPath(v ...string) func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f ClusterRemoteInfo) WithFilterPath(v ...string) func(*ClusterRemoteInfoRe } // WithHeader adds the headers to the HTTP request. +// func (f ClusterRemoteInfo) WithHeader(h map[string]string) func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f ClusterRemoteInfo) WithHeader(h map[string]string) func(*ClusterRemoteIn } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterRemoteInfo) WithOpaqueID(s string) func(*ClusterRemoteInfoRequest) { return func(r *ClusterRemoteInfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.reroute.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.reroute.go index 3efc1be7b79..6661e2acee9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.reroute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.reroute.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newClusterRerouteFunc(t Transport) ClusterReroute { // ClusterReroute allows to manually change the allocation of individual shards in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html. +// type ClusterReroute func(o ...func(*ClusterRerouteRequest)) (*Response, error) // ClusterRerouteRequest configures the Cluster Reroute API request. +// type ClusterRerouteRequest struct { Body io.Reader @@ -67,6 +69,7 @@ type ClusterRerouteRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -134,6 +137,10 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -146,10 +153,6 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -169,6 +172,7 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f ClusterReroute) WithContext(v context.Context) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.ctx = v @@ -176,6 +180,7 @@ func (f ClusterReroute) WithContext(v context.Context) func(*ClusterRerouteReque } // WithBody - The definition of `commands` to perform (`move`, `cancel`, `allocate`). +// func (f ClusterReroute) WithBody(v io.Reader) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.Body = v @@ -183,6 +188,7 @@ func (f ClusterReroute) WithBody(v io.Reader) func(*ClusterRerouteRequest) { } // WithDryRun - simulate the operation only and return the resulting state. +// func (f ClusterReroute) WithDryRun(v bool) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.DryRun = &v @@ -190,6 +196,7 @@ func (f ClusterReroute) WithDryRun(v bool) func(*ClusterRerouteRequest) { } // WithExplain - return an explanation of why the commands can or cannot be executed. +// func (f ClusterReroute) WithExplain(v bool) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.Explain = &v @@ -197,6 +204,7 @@ func (f ClusterReroute) WithExplain(v bool) func(*ClusterRerouteRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f ClusterReroute) WithMasterTimeout(v time.Duration) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.MasterTimeout = v @@ -204,6 +212,7 @@ func (f ClusterReroute) WithMasterTimeout(v time.Duration) func(*ClusterRerouteR } // WithMetric - limit the information returned to the specified metrics. defaults to all but metadata. +// func (f ClusterReroute) WithMetric(v ...string) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.Metric = v @@ -211,6 +220,7 @@ func (f ClusterReroute) WithMetric(v ...string) func(*ClusterRerouteRequest) { } // WithRetryFailed - retries allocation of shards that are blocked due to too many subsequent allocation failures. +// func (f ClusterReroute) WithRetryFailed(v bool) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.RetryFailed = &v @@ -218,6 +228,7 @@ func (f ClusterReroute) WithRetryFailed(v bool) func(*ClusterRerouteRequest) { } // WithTimeout - explicit operation timeout. +// func (f ClusterReroute) WithTimeout(v time.Duration) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.Timeout = v @@ -225,6 +236,7 @@ func (f ClusterReroute) WithTimeout(v time.Duration) func(*ClusterRerouteRequest } // WithPretty makes the response body pretty-printed. +// func (f ClusterReroute) WithPretty() func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.Pretty = true @@ -232,6 +244,7 @@ func (f ClusterReroute) WithPretty() func(*ClusterRerouteRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterReroute) WithHuman() func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.Human = true @@ -239,6 +252,7 @@ func (f ClusterReroute) WithHuman() func(*ClusterRerouteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterReroute) WithErrorTrace() func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.ErrorTrace = true @@ -246,6 +260,7 @@ func (f ClusterReroute) WithErrorTrace() func(*ClusterRerouteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterReroute) WithFilterPath(v ...string) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { r.FilterPath = v @@ -253,6 +268,7 @@ func (f ClusterReroute) WithFilterPath(v ...string) func(*ClusterRerouteRequest) } // WithHeader adds the headers to the HTTP request. +// func (f ClusterReroute) WithHeader(h map[string]string) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { if r.Header == nil { @@ -265,6 +281,7 @@ func (f ClusterReroute) WithHeader(h map[string]string) func(*ClusterRerouteRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterReroute) WithOpaqueID(s string) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.state.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.state.go index c15da8a9c29..68f9baeaa07 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.state.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.state.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterStateFunc(t Transport) ClusterState { // ClusterState returns a comprehensive information about the state of the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html. +// type ClusterState func(o ...func(*ClusterStateRequest)) (*Response, error) // ClusterStateRequest configures the Cluster State API request. +// type ClusterStateRequest struct { Index []string @@ -70,6 +72,7 @@ type ClusterStateRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -187,6 +190,7 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f ClusterState) WithContext(v context.Context) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.ctx = v @@ -194,6 +198,7 @@ func (f ClusterState) WithContext(v context.Context) func(*ClusterStateRequest) } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f ClusterState) WithIndex(v ...string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.Index = v @@ -201,6 +206,7 @@ func (f ClusterState) WithIndex(v ...string) func(*ClusterStateRequest) { } // WithMetric - limit the information returned to the specified metrics. +// func (f ClusterState) WithMetric(v ...string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.Metric = v @@ -208,6 +214,7 @@ func (f ClusterState) WithMetric(v ...string) func(*ClusterStateRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f ClusterState) WithAllowNoIndices(v bool) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.AllowNoIndices = &v @@ -215,6 +222,7 @@ func (f ClusterState) WithAllowNoIndices(v bool) func(*ClusterStateRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f ClusterState) WithExpandWildcards(v string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.ExpandWildcards = v @@ -222,6 +230,7 @@ func (f ClusterState) WithExpandWildcards(v string) func(*ClusterStateRequest) { } // WithFlatSettings - return settings in flat format (default: false). +// func (f ClusterState) WithFlatSettings(v bool) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.FlatSettings = &v @@ -229,6 +238,7 @@ func (f ClusterState) WithFlatSettings(v bool) func(*ClusterStateRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f ClusterState) WithIgnoreUnavailable(v bool) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.IgnoreUnavailable = &v @@ -236,6 +246,7 @@ func (f ClusterState) WithIgnoreUnavailable(v bool) func(*ClusterStateRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f ClusterState) WithLocal(v bool) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.Local = &v @@ -243,6 +254,7 @@ func (f ClusterState) WithLocal(v bool) func(*ClusterStateRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f ClusterState) WithMasterTimeout(v time.Duration) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.MasterTimeout = v @@ -250,6 +262,7 @@ func (f ClusterState) WithMasterTimeout(v time.Duration) func(*ClusterStateReque } // WithWaitForMetadataVersion - wait for the metadata version to be equal or greater than the specified metadata version. +// func (f ClusterState) WithWaitForMetadataVersion(v int) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.WaitForMetadataVersion = &v @@ -257,6 +270,7 @@ func (f ClusterState) WithWaitForMetadataVersion(v int) func(*ClusterStateReques } // WithWaitForTimeout - the maximum time to wait for wait_for_metadata_version before timing out. +// func (f ClusterState) WithWaitForTimeout(v time.Duration) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.WaitForTimeout = v @@ -264,6 +278,7 @@ func (f ClusterState) WithWaitForTimeout(v time.Duration) func(*ClusterStateRequ } // WithPretty makes the response body pretty-printed. +// func (f ClusterState) WithPretty() func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.Pretty = true @@ -271,6 +286,7 @@ func (f ClusterState) WithPretty() func(*ClusterStateRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterState) WithHuman() func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.Human = true @@ -278,6 +294,7 @@ func (f ClusterState) WithHuman() func(*ClusterStateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterState) WithErrorTrace() func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.ErrorTrace = true @@ -285,6 +302,7 @@ func (f ClusterState) WithErrorTrace() func(*ClusterStateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterState) WithFilterPath(v ...string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.FilterPath = v @@ -292,6 +310,7 @@ func (f ClusterState) WithFilterPath(v ...string) func(*ClusterStateRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ClusterState) WithHeader(h map[string]string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { if r.Header == nil { @@ -304,6 +323,7 @@ func (f ClusterState) WithHeader(h map[string]string) func(*ClusterStateRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterState) WithOpaqueID(s string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.stats.go index 27efd28f416..b873867b9f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.cluster.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newClusterStatsFunc(t Transport) ClusterStats { // ClusterStats returns high-level overview of cluster statistics. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html. +// type ClusterStats func(o ...func(*ClusterStatsRequest)) (*Response, error) // ClusterStatsRequest configures the Cluster Stats API request. +// type ClusterStatsRequest struct { NodeID []string @@ -62,6 +64,7 @@ type ClusterStatsRequest struct { } // Do executes the request and returns response or error. +// func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -153,6 +156,7 @@ func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f ClusterStats) WithContext(v context.Context) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f ClusterStats) WithContext(v context.Context) func(*ClusterStatsRequest) } // WithNodeID - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f ClusterStats) WithNodeID(v ...string) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.NodeID = v @@ -167,6 +172,7 @@ func (f ClusterStats) WithNodeID(v ...string) func(*ClusterStatsRequest) { } // WithFlatSettings - return settings in flat format (default: false). +// func (f ClusterStats) WithFlatSettings(v bool) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.FlatSettings = &v @@ -174,6 +180,7 @@ func (f ClusterStats) WithFlatSettings(v bool) func(*ClusterStatsRequest) { } // WithTimeout - explicit operation timeout. +// func (f ClusterStats) WithTimeout(v time.Duration) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.Timeout = v @@ -181,6 +188,7 @@ func (f ClusterStats) WithTimeout(v time.Duration) func(*ClusterStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ClusterStats) WithPretty() func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.Pretty = true @@ -188,6 +196,7 @@ func (f ClusterStats) WithPretty() func(*ClusterStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClusterStats) WithHuman() func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.Human = true @@ -195,6 +204,7 @@ func (f ClusterStats) WithHuman() func(*ClusterStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClusterStats) WithErrorTrace() func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.ErrorTrace = true @@ -202,6 +212,7 @@ func (f ClusterStats) WithErrorTrace() func(*ClusterStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClusterStats) WithFilterPath(v ...string) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { r.FilterPath = v @@ -209,6 +220,7 @@ func (f ClusterStats) WithFilterPath(v ...string) func(*ClusterStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ClusterStats) WithHeader(h map[string]string) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { if r.Header == nil { @@ -221,6 +233,7 @@ func (f ClusterStats) WithHeader(h map[string]string) func(*ClusterStatsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClusterStats) WithOpaqueID(s string) func(*ClusterStatsRequest) { return func(r *ClusterStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.count.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.count.go index 9f46ebec29e..ec3a35f8ca6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.count.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newCountFunc(t Transport) Count { // Count returns number of documents matching a query. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html. +// type Count func(o ...func(*CountRequest)) (*Response, error) // CountRequest configures the Count API request. +// type CountRequest struct { Index []string DocumentType []string @@ -77,6 +79,7 @@ type CountRequest struct { } // Do executes the request and returns response or error. +// func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -185,6 +188,10 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e 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 @@ -197,10 +204,6 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -220,6 +223,7 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e } // WithContext sets the request context. +// func (f Count) WithContext(v context.Context) func(*CountRequest) { return func(r *CountRequest) { r.ctx = v @@ -227,6 +231,7 @@ func (f Count) WithContext(v context.Context) func(*CountRequest) { } // WithBody - A query to restrict the results specified with the Query DSL (optional). +// func (f Count) WithBody(v io.Reader) func(*CountRequest) { return func(r *CountRequest) { r.Body = v @@ -234,6 +239,7 @@ func (f Count) WithBody(v io.Reader) func(*CountRequest) { } // WithIndex - a list of indices to restrict the results. +// func (f Count) WithIndex(v ...string) func(*CountRequest) { return func(r *CountRequest) { r.Index = v @@ -241,6 +247,7 @@ func (f Count) WithIndex(v ...string) func(*CountRequest) { } // WithDocumentType - a list of types to restrict the results. +// func (f Count) WithDocumentType(v ...string) func(*CountRequest) { return func(r *CountRequest) { r.DocumentType = v @@ -248,6 +255,7 @@ func (f Count) WithDocumentType(v ...string) func(*CountRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f Count) WithAllowNoIndices(v bool) func(*CountRequest) { return func(r *CountRequest) { r.AllowNoIndices = &v @@ -255,6 +263,7 @@ func (f Count) WithAllowNoIndices(v bool) func(*CountRequest) { } // WithAnalyzer - the analyzer to use for the query string. +// func (f Count) WithAnalyzer(v string) func(*CountRequest) { return func(r *CountRequest) { r.Analyzer = v @@ -262,6 +271,7 @@ func (f Count) WithAnalyzer(v string) func(*CountRequest) { } // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). +// func (f Count) WithAnalyzeWildcard(v bool) func(*CountRequest) { return func(r *CountRequest) { r.AnalyzeWildcard = &v @@ -269,6 +279,7 @@ func (f Count) WithAnalyzeWildcard(v bool) func(*CountRequest) { } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f Count) WithDefaultOperator(v string) func(*CountRequest) { return func(r *CountRequest) { r.DefaultOperator = v @@ -276,6 +287,7 @@ func (f Count) WithDefaultOperator(v string) func(*CountRequest) { } // WithDf - the field to use as default where no field prefix is given in the query string. +// func (f Count) WithDf(v string) func(*CountRequest) { return func(r *CountRequest) { r.Df = v @@ -283,6 +295,7 @@ func (f Count) WithDf(v string) func(*CountRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f Count) WithExpandWildcards(v string) func(*CountRequest) { return func(r *CountRequest) { r.ExpandWildcards = v @@ -290,6 +303,7 @@ func (f Count) WithExpandWildcards(v string) func(*CountRequest) { } // WithIgnoreThrottled - whether specified concrete, expanded or aliased indices should be ignored when throttled. +// func (f Count) WithIgnoreThrottled(v bool) func(*CountRequest) { return func(r *CountRequest) { r.IgnoreThrottled = &v @@ -297,6 +311,7 @@ func (f Count) WithIgnoreThrottled(v bool) func(*CountRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f Count) WithIgnoreUnavailable(v bool) func(*CountRequest) { return func(r *CountRequest) { r.IgnoreUnavailable = &v @@ -304,6 +319,7 @@ func (f Count) WithIgnoreUnavailable(v bool) func(*CountRequest) { } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f Count) WithLenient(v bool) func(*CountRequest) { return func(r *CountRequest) { r.Lenient = &v @@ -311,6 +327,7 @@ func (f Count) WithLenient(v bool) func(*CountRequest) { } // WithMinScore - include only documents with a specific `_score` value in the result. +// func (f Count) WithMinScore(v int) func(*CountRequest) { return func(r *CountRequest) { r.MinScore = &v @@ -318,6 +335,7 @@ func (f Count) WithMinScore(v int) func(*CountRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f Count) WithPreference(v string) func(*CountRequest) { return func(r *CountRequest) { r.Preference = v @@ -325,6 +343,7 @@ func (f Count) WithPreference(v string) func(*CountRequest) { } // WithQuery - query in the lucene query string syntax. +// func (f Count) WithQuery(v string) func(*CountRequest) { return func(r *CountRequest) { r.Query = v @@ -332,6 +351,7 @@ func (f Count) WithQuery(v string) func(*CountRequest) { } // WithRouting - a list of specific routing values. +// func (f Count) WithRouting(v ...string) func(*CountRequest) { return func(r *CountRequest) { r.Routing = v @@ -339,6 +359,7 @@ func (f Count) WithRouting(v ...string) func(*CountRequest) { } // WithTerminateAfter - the maximum count for each shard, upon reaching which the query execution will terminate early. +// func (f Count) WithTerminateAfter(v int) func(*CountRequest) { return func(r *CountRequest) { r.TerminateAfter = &v @@ -346,6 +367,7 @@ func (f Count) WithTerminateAfter(v int) func(*CountRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Count) WithPretty() func(*CountRequest) { return func(r *CountRequest) { r.Pretty = true @@ -353,6 +375,7 @@ func (f Count) WithPretty() func(*CountRequest) { } // WithHuman makes statistical values human-readable. +// func (f Count) WithHuman() func(*CountRequest) { return func(r *CountRequest) { r.Human = true @@ -360,6 +383,7 @@ func (f Count) WithHuman() func(*CountRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Count) WithErrorTrace() func(*CountRequest) { return func(r *CountRequest) { r.ErrorTrace = true @@ -367,6 +391,7 @@ func (f Count) WithErrorTrace() func(*CountRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Count) WithFilterPath(v ...string) func(*CountRequest) { return func(r *CountRequest) { r.FilterPath = v @@ -374,6 +399,7 @@ func (f Count) WithFilterPath(v ...string) func(*CountRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Count) WithHeader(h map[string]string) func(*CountRequest) { return func(r *CountRequest) { if r.Header == nil { @@ -386,6 +412,7 @@ func (f Count) WithHeader(h map[string]string) func(*CountRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Count) WithOpaqueID(s string) func(*CountRequest) { return func(r *CountRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.create.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.create.go index 56572af83a3..c02ace5543d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.create.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -45,9 +45,11 @@ func newCreateFunc(t Transport) Create { // Returns a 409 response when a document with a same ID already exists in the index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. +// type Create func(index string, id string, body io.Reader, o ...func(*CreateRequest)) (*Response, error) // CreateRequest configures the Create API request. +// type CreateRequest struct { Index string DocumentType string @@ -74,6 +76,7 @@ type CreateRequest struct { } // Do executes the request and returns response or error. +// func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,10 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -170,10 +177,6 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -193,6 +196,7 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Create) WithContext(v context.Context) func(*CreateRequest) { return func(r *CreateRequest) { r.ctx = v @@ -200,6 +204,7 @@ func (f Create) WithContext(v context.Context) func(*CreateRequest) { } // WithDocumentType - the type of the document. +// func (f Create) WithDocumentType(v string) func(*CreateRequest) { return func(r *CreateRequest) { r.DocumentType = v @@ -207,6 +212,7 @@ func (f Create) WithDocumentType(v string) func(*CreateRequest) { } // WithPipeline - the pipeline ID to preprocess incoming documents with. +// func (f Create) WithPipeline(v string) func(*CreateRequest) { return func(r *CreateRequest) { r.Pipeline = v @@ -214,6 +220,7 @@ func (f Create) WithPipeline(v string) func(*CreateRequest) { } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.. +// func (f Create) WithRefresh(v string) func(*CreateRequest) { return func(r *CreateRequest) { r.Refresh = v @@ -221,6 +228,7 @@ func (f Create) WithRefresh(v string) func(*CreateRequest) { } // WithRouting - specific routing value. +// func (f Create) WithRouting(v string) func(*CreateRequest) { return func(r *CreateRequest) { r.Routing = v @@ -228,6 +236,7 @@ func (f Create) WithRouting(v string) func(*CreateRequest) { } // WithTimeout - explicit operation timeout. +// func (f Create) WithTimeout(v time.Duration) func(*CreateRequest) { return func(r *CreateRequest) { r.Timeout = v @@ -235,6 +244,7 @@ func (f Create) WithTimeout(v time.Duration) func(*CreateRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Create) WithVersion(v int) func(*CreateRequest) { return func(r *CreateRequest) { r.Version = &v @@ -242,6 +252,7 @@ func (f Create) WithVersion(v int) func(*CreateRequest) { } // WithVersionType - specific version type. +// func (f Create) WithVersionType(v string) func(*CreateRequest) { return func(r *CreateRequest) { r.VersionType = v @@ -249,6 +260,7 @@ func (f Create) WithVersionType(v string) func(*CreateRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the index operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f Create) WithWaitForActiveShards(v string) func(*CreateRequest) { return func(r *CreateRequest) { r.WaitForActiveShards = v @@ -256,6 +268,7 @@ func (f Create) WithWaitForActiveShards(v string) func(*CreateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Create) WithPretty() func(*CreateRequest) { return func(r *CreateRequest) { r.Pretty = true @@ -263,6 +276,7 @@ func (f Create) WithPretty() func(*CreateRequest) { } // WithHuman makes statistical values human-readable. +// func (f Create) WithHuman() func(*CreateRequest) { return func(r *CreateRequest) { r.Human = true @@ -270,6 +284,7 @@ func (f Create) WithHuman() func(*CreateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Create) WithErrorTrace() func(*CreateRequest) { return func(r *CreateRequest) { r.ErrorTrace = true @@ -277,6 +292,7 @@ func (f Create) WithErrorTrace() func(*CreateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Create) WithFilterPath(v ...string) func(*CreateRequest) { return func(r *CreateRequest) { r.FilterPath = v @@ -284,6 +300,7 @@ func (f Create) WithFilterPath(v ...string) func(*CreateRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Create) WithHeader(h map[string]string) func(*CreateRequest) { return func(r *CreateRequest) { if r.Header == nil { @@ -296,6 +313,7 @@ func (f Create) WithHeader(h map[string]string) func(*CreateRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Create) WithOpaqueID(s string) func(*CreateRequest) { return func(r *CreateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.delete_dangling_index.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.delete_dangling_index.go index 3b038f49dc0..9d7b9290c68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.delete_dangling_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.delete_dangling_index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newDanglingIndicesDeleteDanglingIndexFunc(t Transport) DanglingIndicesDelet // DanglingIndicesDeleteDanglingIndex deletes the specified dangling index // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html. +// type DanglingIndicesDeleteDanglingIndex func(index_uuid string, o ...func(*DanglingIndicesDeleteDanglingIndexRequest)) (*Response, error) // DanglingIndicesDeleteDanglingIndexRequest configures the Dangling Indices Delete Dangling Index API request. +// type DanglingIndicesDeleteDanglingIndexRequest struct { IndexUUID string @@ -63,6 +65,7 @@ type DanglingIndicesDeleteDanglingIndexRequest struct { } // Do executes the request and returns response or error. +// func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, trans } // WithContext sets the request context. +// func (f DanglingIndicesDeleteDanglingIndex) WithContext(v context.Context) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithContext(v context.Context) func( } // WithAcceptDataLoss - must be set to true in order to delete the dangling index. +// func (f DanglingIndicesDeleteDanglingIndex) WithAcceptDataLoss(v bool) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.AcceptDataLoss = &v @@ -166,6 +171,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithAcceptDataLoss(v bool) func(*Dan } // WithMasterTimeout - specify timeout for connection to master. +// func (f DanglingIndicesDeleteDanglingIndex) WithMasterTimeout(v time.Duration) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.MasterTimeout = v @@ -173,6 +179,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithMasterTimeout(v time.Duration) f } // WithTimeout - explicit operation timeout. +// func (f DanglingIndicesDeleteDanglingIndex) WithTimeout(v time.Duration) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.Timeout = v @@ -180,6 +187,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithTimeout(v time.Duration) func(*D } // WithPretty makes the response body pretty-printed. +// func (f DanglingIndicesDeleteDanglingIndex) WithPretty() func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithPretty() func(*DanglingIndicesDe } // WithHuman makes statistical values human-readable. +// func (f DanglingIndicesDeleteDanglingIndex) WithHuman() func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithHuman() func(*DanglingIndicesDel } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DanglingIndicesDeleteDanglingIndex) WithErrorTrace() func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithErrorTrace() func(*DanglingIndic } // WithFilterPath filters the properties of the response body. +// func (f DanglingIndicesDeleteDanglingIndex) WithFilterPath(v ...string) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithFilterPath(v ...string) func(*Da } // WithHeader adds the headers to the HTTP request. +// func (f DanglingIndicesDeleteDanglingIndex) WithHeader(h map[string]string) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f DanglingIndicesDeleteDanglingIndex) WithHeader(h map[string]string) func } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DanglingIndicesDeleteDanglingIndex) WithOpaqueID(s string) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.import_dangling_index.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.import_dangling_index.go index c4d92bf2d3d..7e074c1081b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.import_dangling_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.import_dangling_index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newDanglingIndicesImportDanglingIndexFunc(t Transport) DanglingIndicesImpor // DanglingIndicesImportDanglingIndex imports the specified dangling index // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html. +// type DanglingIndicesImportDanglingIndex func(index_uuid string, o ...func(*DanglingIndicesImportDanglingIndexRequest)) (*Response, error) // DanglingIndicesImportDanglingIndexRequest configures the Dangling Indices Import Dangling Index API request. +// type DanglingIndicesImportDanglingIndexRequest struct { IndexUUID string @@ -63,6 +65,7 @@ type DanglingIndicesImportDanglingIndexRequest struct { } // Do executes the request and returns response or error. +// func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, trans } // WithContext sets the request context. +// func (f DanglingIndicesImportDanglingIndex) WithContext(v context.Context) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f DanglingIndicesImportDanglingIndex) WithContext(v context.Context) func( } // WithAcceptDataLoss - must be set to true in order to import the dangling index. +// func (f DanglingIndicesImportDanglingIndex) WithAcceptDataLoss(v bool) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.AcceptDataLoss = &v @@ -166,6 +171,7 @@ func (f DanglingIndicesImportDanglingIndex) WithAcceptDataLoss(v bool) func(*Dan } // WithMasterTimeout - specify timeout for connection to master. +// func (f DanglingIndicesImportDanglingIndex) WithMasterTimeout(v time.Duration) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.MasterTimeout = v @@ -173,6 +179,7 @@ func (f DanglingIndicesImportDanglingIndex) WithMasterTimeout(v time.Duration) f } // WithTimeout - explicit operation timeout. +// func (f DanglingIndicesImportDanglingIndex) WithTimeout(v time.Duration) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.Timeout = v @@ -180,6 +187,7 @@ func (f DanglingIndicesImportDanglingIndex) WithTimeout(v time.Duration) func(*D } // WithPretty makes the response body pretty-printed. +// func (f DanglingIndicesImportDanglingIndex) WithPretty() func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f DanglingIndicesImportDanglingIndex) WithPretty() func(*DanglingIndicesIm } // WithHuman makes statistical values human-readable. +// func (f DanglingIndicesImportDanglingIndex) WithHuman() func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f DanglingIndicesImportDanglingIndex) WithHuman() func(*DanglingIndicesImp } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DanglingIndicesImportDanglingIndex) WithErrorTrace() func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f DanglingIndicesImportDanglingIndex) WithErrorTrace() func(*DanglingIndic } // WithFilterPath filters the properties of the response body. +// func (f DanglingIndicesImportDanglingIndex) WithFilterPath(v ...string) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f DanglingIndicesImportDanglingIndex) WithFilterPath(v ...string) func(*Da } // WithHeader adds the headers to the HTTP request. +// func (f DanglingIndicesImportDanglingIndex) WithHeader(h map[string]string) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f DanglingIndicesImportDanglingIndex) WithHeader(h map[string]string) func } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DanglingIndicesImportDanglingIndex) WithOpaqueID(s string) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.list_dangling_indices.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.list_dangling_indices.go index 6966e364f03..f496b94195a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.list_dangling_indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.dangling_indices.list_dangling_indices.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newDanglingIndicesListDanglingIndicesFunc(t Transport) DanglingIndicesListD // DanglingIndicesListDanglingIndices returns all dangling indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html. +// type DanglingIndicesListDanglingIndices func(o ...func(*DanglingIndicesListDanglingIndicesRequest)) (*Response, error) // DanglingIndicesListDanglingIndicesRequest configures the Dangling Indices List Dangling Indices API request. +// type DanglingIndicesListDanglingIndicesRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type DanglingIndicesListDanglingIndicesRequest struct { } // Do executes the request and returns response or error. +// func (r DanglingIndicesListDanglingIndicesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r DanglingIndicesListDanglingIndicesRequest) Do(ctx context.Context, trans } // WithContext sets the request context. +// func (f DanglingIndicesListDanglingIndices) WithContext(v context.Context) func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f DanglingIndicesListDanglingIndices) WithContext(v context.Context) func( } // WithPretty makes the response body pretty-printed. +// func (f DanglingIndicesListDanglingIndices) WithPretty() func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f DanglingIndicesListDanglingIndices) WithPretty() func(*DanglingIndicesLi } // WithHuman makes statistical values human-readable. +// func (f DanglingIndicesListDanglingIndices) WithHuman() func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f DanglingIndicesListDanglingIndices) WithHuman() func(*DanglingIndicesLis } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DanglingIndicesListDanglingIndices) WithErrorTrace() func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f DanglingIndicesListDanglingIndices) WithErrorTrace() func(*DanglingIndic } // WithFilterPath filters the properties of the response body. +// func (f DanglingIndicesListDanglingIndices) WithFilterPath(v ...string) func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f DanglingIndicesListDanglingIndices) WithFilterPath(v ...string) func(*Da } // WithHeader adds the headers to the HTTP request. +// func (f DanglingIndicesListDanglingIndices) WithHeader(h map[string]string) func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f DanglingIndicesListDanglingIndices) WithHeader(h map[string]string) func } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DanglingIndicesListDanglingIndices) WithOpaqueID(s string) func(*DanglingIndicesListDanglingIndicesRequest) { return func(r *DanglingIndicesListDanglingIndicesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete.go index 29fde2db7d7..d6c1e82d873 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newDeleteFunc(t Transport) Delete { // Delete removes a document from the index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html. +// type Delete func(index string, id string, o ...func(*DeleteRequest)) (*Response, error) // DeleteRequest configures the Delete API request. +// type DeleteRequest struct { Index string DocumentType string @@ -70,6 +72,7 @@ type DeleteRequest struct { } // Do executes the request and returns response or error. +// func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -187,6 +190,7 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Delete) WithContext(v context.Context) func(*DeleteRequest) { return func(r *DeleteRequest) { r.ctx = v @@ -194,6 +198,7 @@ func (f Delete) WithContext(v context.Context) func(*DeleteRequest) { } // WithDocumentType - the type of the document. +// func (f Delete) WithDocumentType(v string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.DocumentType = v @@ -201,6 +206,7 @@ func (f Delete) WithDocumentType(v string) func(*DeleteRequest) { } // WithIfPrimaryTerm - only perform the delete operation if the last operation that has changed the document has the specified primary term. +// func (f Delete) WithIfPrimaryTerm(v int) func(*DeleteRequest) { return func(r *DeleteRequest) { r.IfPrimaryTerm = &v @@ -208,6 +214,7 @@ func (f Delete) WithIfPrimaryTerm(v int) func(*DeleteRequest) { } // WithIfSeqNo - only perform the delete operation if the last operation that has changed the document has the specified sequence number. +// func (f Delete) WithIfSeqNo(v int) func(*DeleteRequest) { return func(r *DeleteRequest) { r.IfSeqNo = &v @@ -215,6 +222,7 @@ func (f Delete) WithIfSeqNo(v int) func(*DeleteRequest) { } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.. +// func (f Delete) WithRefresh(v string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.Refresh = v @@ -222,6 +230,7 @@ func (f Delete) WithRefresh(v string) func(*DeleteRequest) { } // WithRouting - specific routing value. +// func (f Delete) WithRouting(v string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.Routing = v @@ -229,6 +238,7 @@ func (f Delete) WithRouting(v string) func(*DeleteRequest) { } // WithTimeout - explicit operation timeout. +// func (f Delete) WithTimeout(v time.Duration) func(*DeleteRequest) { return func(r *DeleteRequest) { r.Timeout = v @@ -236,6 +246,7 @@ func (f Delete) WithTimeout(v time.Duration) func(*DeleteRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Delete) WithVersion(v int) func(*DeleteRequest) { return func(r *DeleteRequest) { r.Version = &v @@ -243,6 +254,7 @@ func (f Delete) WithVersion(v int) func(*DeleteRequest) { } // WithVersionType - specific version type. +// func (f Delete) WithVersionType(v string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.VersionType = v @@ -250,6 +262,7 @@ func (f Delete) WithVersionType(v string) func(*DeleteRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the delete operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f Delete) WithWaitForActiveShards(v string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.WaitForActiveShards = v @@ -257,6 +270,7 @@ func (f Delete) WithWaitForActiveShards(v string) func(*DeleteRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Delete) WithPretty() func(*DeleteRequest) { return func(r *DeleteRequest) { r.Pretty = true @@ -264,6 +278,7 @@ func (f Delete) WithPretty() func(*DeleteRequest) { } // WithHuman makes statistical values human-readable. +// func (f Delete) WithHuman() func(*DeleteRequest) { return func(r *DeleteRequest) { r.Human = true @@ -271,6 +286,7 @@ func (f Delete) WithHuman() func(*DeleteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Delete) WithErrorTrace() func(*DeleteRequest) { return func(r *DeleteRequest) { r.ErrorTrace = true @@ -278,6 +294,7 @@ func (f Delete) WithErrorTrace() func(*DeleteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Delete) WithFilterPath(v ...string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.FilterPath = v @@ -285,6 +302,7 @@ func (f Delete) WithFilterPath(v ...string) func(*DeleteRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Delete) WithHeader(h map[string]string) func(*DeleteRequest) { return func(r *DeleteRequest) { if r.Header == nil { @@ -297,6 +315,7 @@ func (f Delete) WithHeader(h map[string]string) func(*DeleteRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Delete) WithOpaqueID(s string) func(*DeleteRequest) { return func(r *DeleteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query.go index 0bb6cc09278..53d3377cd9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -45,9 +45,11 @@ func newDeleteByQueryFunc(t Transport) DeleteByQuery { // DeleteByQuery deletes documents matching the provided query. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html. +// type DeleteByQuery func(index []string, body io.Reader, o ...func(*DeleteByQueryRequest)) (*Response, error) // DeleteByQueryRequest configures the Delete By Query API request. +// type DeleteByQueryRequest struct { Index []string DocumentType []string @@ -96,6 +98,7 @@ type DeleteByQueryRequest struct { } // Do executes the request and returns response or error. +// func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -270,6 +273,10 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -282,10 +289,6 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -305,6 +308,7 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f DeleteByQuery) WithContext(v context.Context) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.ctx = v @@ -312,6 +316,7 @@ func (f DeleteByQuery) WithContext(v context.Context) func(*DeleteByQueryRequest } // WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// func (f DeleteByQuery) WithDocumentType(v ...string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.DocumentType = v @@ -319,6 +324,7 @@ func (f DeleteByQuery) WithDocumentType(v ...string) func(*DeleteByQueryRequest) } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f DeleteByQuery) WithAllowNoIndices(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.AllowNoIndices = &v @@ -326,6 +332,7 @@ func (f DeleteByQuery) WithAllowNoIndices(v bool) func(*DeleteByQueryRequest) { } // WithAnalyzer - the analyzer to use for the query string. +// func (f DeleteByQuery) WithAnalyzer(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Analyzer = v @@ -333,6 +340,7 @@ func (f DeleteByQuery) WithAnalyzer(v string) func(*DeleteByQueryRequest) { } // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). +// func (f DeleteByQuery) WithAnalyzeWildcard(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.AnalyzeWildcard = &v @@ -340,6 +348,7 @@ func (f DeleteByQuery) WithAnalyzeWildcard(v bool) func(*DeleteByQueryRequest) { } // WithConflicts - what to do when the delete by query hits version conflicts?. +// func (f DeleteByQuery) WithConflicts(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Conflicts = v @@ -347,6 +356,7 @@ func (f DeleteByQuery) WithConflicts(v string) func(*DeleteByQueryRequest) { } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f DeleteByQuery) WithDefaultOperator(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.DefaultOperator = v @@ -354,6 +364,7 @@ func (f DeleteByQuery) WithDefaultOperator(v string) func(*DeleteByQueryRequest) } // WithDf - the field to use as default where no field prefix is given in the query string. +// func (f DeleteByQuery) WithDf(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Df = v @@ -361,6 +372,7 @@ func (f DeleteByQuery) WithDf(v string) func(*DeleteByQueryRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f DeleteByQuery) WithExpandWildcards(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.ExpandWildcards = v @@ -368,6 +380,7 @@ func (f DeleteByQuery) WithExpandWildcards(v string) func(*DeleteByQueryRequest) } // WithFrom - starting offset (default: 0). +// func (f DeleteByQuery) WithFrom(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.From = &v @@ -375,6 +388,7 @@ func (f DeleteByQuery) WithFrom(v int) func(*DeleteByQueryRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f DeleteByQuery) WithIgnoreUnavailable(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.IgnoreUnavailable = &v @@ -382,6 +396,7 @@ func (f DeleteByQuery) WithIgnoreUnavailable(v bool) func(*DeleteByQueryRequest) } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f DeleteByQuery) WithLenient(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Lenient = &v @@ -389,6 +404,7 @@ func (f DeleteByQuery) WithLenient(v bool) func(*DeleteByQueryRequest) { } // WithMaxDocs - maximum number of documents to process (default: all documents). +// func (f DeleteByQuery) WithMaxDocs(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.MaxDocs = &v @@ -396,6 +412,7 @@ func (f DeleteByQuery) WithMaxDocs(v int) func(*DeleteByQueryRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f DeleteByQuery) WithPreference(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Preference = v @@ -403,6 +420,7 @@ func (f DeleteByQuery) WithPreference(v string) func(*DeleteByQueryRequest) { } // WithQuery - query in the lucene query string syntax. +// func (f DeleteByQuery) WithQuery(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Query = v @@ -410,6 +428,7 @@ func (f DeleteByQuery) WithQuery(v string) func(*DeleteByQueryRequest) { } // WithRefresh - should the effected indexes be refreshed?. +// func (f DeleteByQuery) WithRefresh(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Refresh = &v @@ -417,6 +436,7 @@ func (f DeleteByQuery) WithRefresh(v bool) func(*DeleteByQueryRequest) { } // WithRequestCache - specify if request cache should be used for this request or not, defaults to index level setting. +// func (f DeleteByQuery) WithRequestCache(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.RequestCache = &v @@ -424,6 +444,7 @@ func (f DeleteByQuery) WithRequestCache(v bool) func(*DeleteByQueryRequest) { } // WithRequestsPerSecond - the throttle for this request in sub-requests per second. -1 means no throttle.. +// func (f DeleteByQuery) WithRequestsPerSecond(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.RequestsPerSecond = &v @@ -431,6 +452,7 @@ func (f DeleteByQuery) WithRequestsPerSecond(v int) func(*DeleteByQueryRequest) } // WithRouting - a list of specific routing values. +// func (f DeleteByQuery) WithRouting(v ...string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Routing = v @@ -438,6 +460,7 @@ func (f DeleteByQuery) WithRouting(v ...string) func(*DeleteByQueryRequest) { } // WithScroll - specify how long a consistent view of the index should be maintained for scrolled search. +// func (f DeleteByQuery) WithScroll(v time.Duration) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Scroll = v @@ -445,6 +468,7 @@ func (f DeleteByQuery) WithScroll(v time.Duration) func(*DeleteByQueryRequest) { } // WithScrollSize - size on the scroll request powering the delete by query. +// func (f DeleteByQuery) WithScrollSize(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.ScrollSize = &v @@ -452,6 +476,7 @@ func (f DeleteByQuery) WithScrollSize(v int) func(*DeleteByQueryRequest) { } // WithSearchTimeout - explicit timeout for each search request. defaults to no timeout.. +// func (f DeleteByQuery) WithSearchTimeout(v time.Duration) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.SearchTimeout = v @@ -459,6 +484,7 @@ func (f DeleteByQuery) WithSearchTimeout(v time.Duration) func(*DeleteByQueryReq } // WithSearchType - search operation type. +// func (f DeleteByQuery) WithSearchType(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.SearchType = v @@ -466,6 +492,7 @@ func (f DeleteByQuery) WithSearchType(v string) func(*DeleteByQueryRequest) { } // WithSize - deprecated, please use `max_docs` instead. +// func (f DeleteByQuery) WithSize(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Size = &v @@ -473,6 +500,7 @@ func (f DeleteByQuery) WithSize(v int) func(*DeleteByQueryRequest) { } // WithSlices - the number of slices this task should be divided into. defaults to 1, meaning the task isn't sliced into subtasks. can be set to `auto`.. +// func (f DeleteByQuery) WithSlices(v interface{}) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Slices = v @@ -480,6 +508,7 @@ func (f DeleteByQuery) WithSlices(v interface{}) func(*DeleteByQueryRequest) { } // WithSort - a list of : pairs. +// func (f DeleteByQuery) WithSort(v ...string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Sort = v @@ -487,6 +516,7 @@ func (f DeleteByQuery) WithSort(v ...string) func(*DeleteByQueryRequest) { } // WithStats - specific 'tag' of the request for logging and statistical purposes. +// func (f DeleteByQuery) WithStats(v ...string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Stats = v @@ -494,6 +524,7 @@ func (f DeleteByQuery) WithStats(v ...string) func(*DeleteByQueryRequest) { } // WithTerminateAfter - the maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.. +// func (f DeleteByQuery) WithTerminateAfter(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.TerminateAfter = &v @@ -501,6 +532,7 @@ func (f DeleteByQuery) WithTerminateAfter(v int) func(*DeleteByQueryRequest) { } // WithTimeout - time each individual bulk request should wait for shards that are unavailable.. +// func (f DeleteByQuery) WithTimeout(v time.Duration) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Timeout = v @@ -508,6 +540,7 @@ func (f DeleteByQuery) WithTimeout(v time.Duration) func(*DeleteByQueryRequest) } // WithVersion - specify whether to return document version as part of a hit. +// func (f DeleteByQuery) WithVersion(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Version = &v @@ -515,6 +548,7 @@ func (f DeleteByQuery) WithVersion(v bool) func(*DeleteByQueryRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the delete by query operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f DeleteByQuery) WithWaitForActiveShards(v string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.WaitForActiveShards = v @@ -522,6 +556,7 @@ func (f DeleteByQuery) WithWaitForActiveShards(v string) func(*DeleteByQueryRequ } // WithWaitForCompletion - should the request should block until the delete by query is complete.. +// func (f DeleteByQuery) WithWaitForCompletion(v bool) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.WaitForCompletion = &v @@ -529,6 +564,7 @@ func (f DeleteByQuery) WithWaitForCompletion(v bool) func(*DeleteByQueryRequest) } // WithPretty makes the response body pretty-printed. +// func (f DeleteByQuery) WithPretty() func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Pretty = true @@ -536,6 +572,7 @@ func (f DeleteByQuery) WithPretty() func(*DeleteByQueryRequest) { } // WithHuman makes statistical values human-readable. +// func (f DeleteByQuery) WithHuman() func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.Human = true @@ -543,6 +580,7 @@ func (f DeleteByQuery) WithHuman() func(*DeleteByQueryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DeleteByQuery) WithErrorTrace() func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.ErrorTrace = true @@ -550,6 +588,7 @@ func (f DeleteByQuery) WithErrorTrace() func(*DeleteByQueryRequest) { } // WithFilterPath filters the properties of the response body. +// func (f DeleteByQuery) WithFilterPath(v ...string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.FilterPath = v @@ -557,6 +596,7 @@ func (f DeleteByQuery) WithFilterPath(v ...string) func(*DeleteByQueryRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f DeleteByQuery) WithHeader(h map[string]string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { if r.Header == nil { @@ -569,6 +609,7 @@ func (f DeleteByQuery) WithHeader(h map[string]string) func(*DeleteByQueryReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DeleteByQuery) WithOpaqueID(s string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query_rethrottle.go index 4b626c35143..2de832ba753 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_by_query_rethrottle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newDeleteByQueryRethrottleFunc(t Transport) DeleteByQueryRethrottle { // DeleteByQueryRethrottle changes the number of requests per second for a particular Delete By Query operation. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html. +// type DeleteByQueryRethrottle func(task_id string, requests_per_second *int, o ...func(*DeleteByQueryRethrottleRequest)) (*Response, error) // DeleteByQueryRethrottleRequest configures the Delete By Query Rethrottle API request. +// type DeleteByQueryRethrottleRequest struct { TaskID string @@ -60,6 +62,7 @@ type DeleteByQueryRethrottleRequest struct { } // Do executes the request and returns response or error. +// func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f DeleteByQueryRethrottle) WithContext(v context.Context) func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f DeleteByQueryRethrottle) WithContext(v context.Context) func(*DeleteByQu } // WithRequestsPerSecond - the throttle to set on this request in floating sub-requests per second. -1 means set no throttle.. +// func (f DeleteByQueryRethrottle) WithRequestsPerSecond(v int) func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { r.RequestsPerSecond = &v @@ -157,6 +162,7 @@ func (f DeleteByQueryRethrottle) WithRequestsPerSecond(v int) func(*DeleteByQuer } // WithPretty makes the response body pretty-printed. +// func (f DeleteByQueryRethrottle) WithPretty() func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f DeleteByQueryRethrottle) WithPretty() func(*DeleteByQueryRethrottleReque } // WithHuman makes statistical values human-readable. +// func (f DeleteByQueryRethrottle) WithHuman() func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f DeleteByQueryRethrottle) WithHuman() func(*DeleteByQueryRethrottleReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DeleteByQueryRethrottle) WithErrorTrace() func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f DeleteByQueryRethrottle) WithErrorTrace() func(*DeleteByQueryRethrottleR } // WithFilterPath filters the properties of the response body. +// func (f DeleteByQueryRethrottle) WithFilterPath(v ...string) func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f DeleteByQueryRethrottle) WithFilterPath(v ...string) func(*DeleteByQuery } // WithHeader adds the headers to the HTTP request. +// func (f DeleteByQueryRethrottle) WithHeader(h map[string]string) func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f DeleteByQueryRethrottle) WithHeader(h map[string]string) func(*DeleteByQ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DeleteByQueryRethrottle) WithOpaqueID(s string) func(*DeleteByQueryRethrottleRequest) { return func(r *DeleteByQueryRethrottleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_script.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_script.go index 9599b6d10e7..c5005ec76ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.delete_script.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newDeleteScriptFunc(t Transport) DeleteScript { // DeleteScript deletes a script. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// type DeleteScript func(id string, o ...func(*DeleteScriptRequest)) (*Response, error) // DeleteScriptRequest configures the Delete Script API request. +// type DeleteScriptRequest struct { ScriptID string @@ -61,6 +63,7 @@ type DeleteScriptRequest struct { } // Do executes the request and returns response or error. +// func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -146,6 +149,7 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f DeleteScript) WithContext(v context.Context) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.ctx = v @@ -153,6 +157,7 @@ func (f DeleteScript) WithContext(v context.Context) func(*DeleteScriptRequest) } // WithMasterTimeout - specify timeout for connection to master. +// func (f DeleteScript) WithMasterTimeout(v time.Duration) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.MasterTimeout = v @@ -160,6 +165,7 @@ func (f DeleteScript) WithMasterTimeout(v time.Duration) func(*DeleteScriptReque } // WithTimeout - explicit operation timeout. +// func (f DeleteScript) WithTimeout(v time.Duration) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.Timeout = v @@ -167,6 +173,7 @@ func (f DeleteScript) WithTimeout(v time.Duration) func(*DeleteScriptRequest) { } // WithPretty makes the response body pretty-printed. +// func (f DeleteScript) WithPretty() func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.Pretty = true @@ -174,6 +181,7 @@ func (f DeleteScript) WithPretty() func(*DeleteScriptRequest) { } // WithHuman makes statistical values human-readable. +// func (f DeleteScript) WithHuman() func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.Human = true @@ -181,6 +189,7 @@ func (f DeleteScript) WithHuman() func(*DeleteScriptRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DeleteScript) WithErrorTrace() func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.ErrorTrace = true @@ -188,6 +197,7 @@ func (f DeleteScript) WithErrorTrace() func(*DeleteScriptRequest) { } // WithFilterPath filters the properties of the response body. +// func (f DeleteScript) WithFilterPath(v ...string) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { r.FilterPath = v @@ -195,6 +205,7 @@ func (f DeleteScript) WithFilterPath(v ...string) func(*DeleteScriptRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f DeleteScript) WithHeader(h map[string]string) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { if r.Header == nil { @@ -207,6 +218,7 @@ func (f DeleteScript) WithHeader(h map[string]string) func(*DeleteScriptRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DeleteScript) WithOpaqueID(s string) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists.go index ad1fb0dbd9d..8d1a48d8f36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newExistsFunc(t Transport) Exists { // Exists returns information about whether a document exists in an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// type Exists func(index string, id string, o ...func(*ExistsRequest)) (*Response, error) // ExistsRequest configures the Exists API request. +// type ExistsRequest struct { Index string DocumentType string @@ -71,6 +73,7 @@ type ExistsRequest struct { } // Do executes the request and returns response or error. +// func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -196,6 +199,7 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Exists) WithContext(v context.Context) func(*ExistsRequest) { return func(r *ExistsRequest) { r.ctx = v @@ -203,6 +207,7 @@ func (f Exists) WithContext(v context.Context) func(*ExistsRequest) { } // WithDocumentType - the type of the document (use `_all` to fetch the first document matching the ID across all types). +// func (f Exists) WithDocumentType(v string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.DocumentType = v @@ -210,6 +215,7 @@ func (f Exists) WithDocumentType(v string) func(*ExistsRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f Exists) WithPreference(v string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Preference = v @@ -217,6 +223,7 @@ func (f Exists) WithPreference(v string) func(*ExistsRequest) { } // WithRealtime - specify whether to perform the operation in realtime or search mode. +// func (f Exists) WithRealtime(v bool) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Realtime = &v @@ -224,6 +231,7 @@ func (f Exists) WithRealtime(v bool) func(*ExistsRequest) { } // WithRefresh - refresh the shard containing the document before performing the operation. +// func (f Exists) WithRefresh(v bool) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Refresh = &v @@ -231,6 +239,7 @@ func (f Exists) WithRefresh(v bool) func(*ExistsRequest) { } // WithRouting - specific routing value. +// func (f Exists) WithRouting(v string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Routing = v @@ -238,6 +247,7 @@ func (f Exists) WithRouting(v string) func(*ExistsRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f Exists) WithSource(v ...string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Source = v @@ -245,6 +255,7 @@ func (f Exists) WithSource(v ...string) func(*ExistsRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f Exists) WithSourceExcludes(v ...string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.SourceExcludes = v @@ -252,6 +263,7 @@ func (f Exists) WithSourceExcludes(v ...string) func(*ExistsRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f Exists) WithSourceIncludes(v ...string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.SourceIncludes = v @@ -259,6 +271,7 @@ func (f Exists) WithSourceIncludes(v ...string) func(*ExistsRequest) { } // WithStoredFields - a list of stored fields to return in the response. +// func (f Exists) WithStoredFields(v ...string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.StoredFields = v @@ -266,6 +279,7 @@ func (f Exists) WithStoredFields(v ...string) func(*ExistsRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Exists) WithVersion(v int) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Version = &v @@ -273,6 +287,7 @@ func (f Exists) WithVersion(v int) func(*ExistsRequest) { } // WithVersionType - specific version type. +// func (f Exists) WithVersionType(v string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.VersionType = v @@ -280,6 +295,7 @@ func (f Exists) WithVersionType(v string) func(*ExistsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Exists) WithPretty() func(*ExistsRequest) { return func(r *ExistsRequest) { r.Pretty = true @@ -287,6 +303,7 @@ func (f Exists) WithPretty() func(*ExistsRequest) { } // WithHuman makes statistical values human-readable. +// func (f Exists) WithHuman() func(*ExistsRequest) { return func(r *ExistsRequest) { r.Human = true @@ -294,6 +311,7 @@ func (f Exists) WithHuman() func(*ExistsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Exists) WithErrorTrace() func(*ExistsRequest) { return func(r *ExistsRequest) { r.ErrorTrace = true @@ -301,6 +319,7 @@ func (f Exists) WithErrorTrace() func(*ExistsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Exists) WithFilterPath(v ...string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.FilterPath = v @@ -308,6 +327,7 @@ func (f Exists) WithFilterPath(v ...string) func(*ExistsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Exists) WithHeader(h map[string]string) func(*ExistsRequest) { return func(r *ExistsRequest) { if r.Header == nil { @@ -320,6 +340,7 @@ func (f Exists) WithHeader(h map[string]string) func(*ExistsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Exists) WithOpaqueID(s string) func(*ExistsRequest) { return func(r *ExistsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists_source.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists_source.go index 7cbb585436e..e3f7dc38570 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.exists_source.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newExistsSourceFunc(t Transport) ExistsSource { // ExistsSource returns information about whether a document source exists in an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// type ExistsSource func(index string, id string, o ...func(*ExistsSourceRequest)) (*Response, error) // ExistsSourceRequest configures the Exists Source API request. +// type ExistsSourceRequest struct { Index string DocumentType string @@ -70,6 +72,7 @@ type ExistsSourceRequest struct { } // Do executes the request and returns response or error. +// func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -189,6 +192,7 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f ExistsSource) WithContext(v context.Context) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.ctx = v @@ -196,6 +200,7 @@ func (f ExistsSource) WithContext(v context.Context) func(*ExistsSourceRequest) } // WithDocumentType - the type of the document; deprecated and optional starting with 7.0. +// func (f ExistsSource) WithDocumentType(v string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.DocumentType = v @@ -203,6 +208,7 @@ func (f ExistsSource) WithDocumentType(v string) func(*ExistsSourceRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f ExistsSource) WithPreference(v string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Preference = v @@ -210,6 +216,7 @@ func (f ExistsSource) WithPreference(v string) func(*ExistsSourceRequest) { } // WithRealtime - specify whether to perform the operation in realtime or search mode. +// func (f ExistsSource) WithRealtime(v bool) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Realtime = &v @@ -217,6 +224,7 @@ func (f ExistsSource) WithRealtime(v bool) func(*ExistsSourceRequest) { } // WithRefresh - refresh the shard containing the document before performing the operation. +// func (f ExistsSource) WithRefresh(v bool) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Refresh = &v @@ -224,6 +232,7 @@ func (f ExistsSource) WithRefresh(v bool) func(*ExistsSourceRequest) { } // WithRouting - specific routing value. +// func (f ExistsSource) WithRouting(v string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Routing = v @@ -231,6 +240,7 @@ func (f ExistsSource) WithRouting(v string) func(*ExistsSourceRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f ExistsSource) WithSource(v ...string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Source = v @@ -238,6 +248,7 @@ func (f ExistsSource) WithSource(v ...string) func(*ExistsSourceRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f ExistsSource) WithSourceExcludes(v ...string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.SourceExcludes = v @@ -245,6 +256,7 @@ func (f ExistsSource) WithSourceExcludes(v ...string) func(*ExistsSourceRequest) } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f ExistsSource) WithSourceIncludes(v ...string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.SourceIncludes = v @@ -252,6 +264,7 @@ func (f ExistsSource) WithSourceIncludes(v ...string) func(*ExistsSourceRequest) } // WithVersion - explicit version number for concurrency control. +// func (f ExistsSource) WithVersion(v int) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Version = &v @@ -259,6 +272,7 @@ func (f ExistsSource) WithVersion(v int) func(*ExistsSourceRequest) { } // WithVersionType - specific version type. +// func (f ExistsSource) WithVersionType(v string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.VersionType = v @@ -266,6 +280,7 @@ func (f ExistsSource) WithVersionType(v string) func(*ExistsSourceRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ExistsSource) WithPretty() func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Pretty = true @@ -273,6 +288,7 @@ func (f ExistsSource) WithPretty() func(*ExistsSourceRequest) { } // WithHuman makes statistical values human-readable. +// func (f ExistsSource) WithHuman() func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Human = true @@ -280,6 +296,7 @@ func (f ExistsSource) WithHuman() func(*ExistsSourceRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ExistsSource) WithErrorTrace() func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.ErrorTrace = true @@ -287,6 +304,7 @@ func (f ExistsSource) WithErrorTrace() func(*ExistsSourceRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ExistsSource) WithFilterPath(v ...string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.FilterPath = v @@ -294,6 +312,7 @@ func (f ExistsSource) WithFilterPath(v ...string) func(*ExistsSourceRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ExistsSource) WithHeader(h map[string]string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { if r.Header == nil { @@ -306,6 +325,7 @@ func (f ExistsSource) WithHeader(h map[string]string) func(*ExistsSourceRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ExistsSource) WithOpaqueID(s string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.explain.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.explain.go index d1c6cb41fe9..54524654c17 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.explain.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newExplainFunc(t Transport) Explain { // Explain returns information about why a specific matches (or doesn't match) a query. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html. +// type Explain func(index string, id string, o ...func(*ExplainRequest)) (*Response, error) // ExplainRequest configures the Explain API request. +// type ExplainRequest struct { Index string DocumentType string @@ -76,6 +78,7 @@ type ExplainRequest struct { } // Do executes the request and returns response or error. +// func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -180,6 +183,10 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -192,10 +199,6 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -215,6 +218,7 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Explain) WithContext(v context.Context) func(*ExplainRequest) { return func(r *ExplainRequest) { r.ctx = v @@ -222,6 +226,7 @@ func (f Explain) WithContext(v context.Context) func(*ExplainRequest) { } // WithBody - The query definition using the Query DSL. +// func (f Explain) WithBody(v io.Reader) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Body = v @@ -229,6 +234,7 @@ func (f Explain) WithBody(v io.Reader) func(*ExplainRequest) { } // WithDocumentType - the type of the document. +// func (f Explain) WithDocumentType(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.DocumentType = v @@ -236,6 +242,7 @@ func (f Explain) WithDocumentType(v string) func(*ExplainRequest) { } // WithAnalyzer - the analyzer for the query string query. +// func (f Explain) WithAnalyzer(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Analyzer = v @@ -243,6 +250,7 @@ func (f Explain) WithAnalyzer(v string) func(*ExplainRequest) { } // WithAnalyzeWildcard - specify whether wildcards and prefix queries in the query string query should be analyzed (default: false). +// func (f Explain) WithAnalyzeWildcard(v bool) func(*ExplainRequest) { return func(r *ExplainRequest) { r.AnalyzeWildcard = &v @@ -250,6 +258,7 @@ func (f Explain) WithAnalyzeWildcard(v bool) func(*ExplainRequest) { } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f Explain) WithDefaultOperator(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.DefaultOperator = v @@ -257,6 +266,7 @@ func (f Explain) WithDefaultOperator(v string) func(*ExplainRequest) { } // WithDf - the default field for query string query (default: _all). +// func (f Explain) WithDf(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Df = v @@ -264,6 +274,7 @@ func (f Explain) WithDf(v string) func(*ExplainRequest) { } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f Explain) WithLenient(v bool) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Lenient = &v @@ -271,6 +282,7 @@ func (f Explain) WithLenient(v bool) func(*ExplainRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f Explain) WithPreference(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Preference = v @@ -278,6 +290,7 @@ func (f Explain) WithPreference(v string) func(*ExplainRequest) { } // WithQuery - query in the lucene query string syntax. +// func (f Explain) WithQuery(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Query = v @@ -285,6 +298,7 @@ func (f Explain) WithQuery(v string) func(*ExplainRequest) { } // WithRouting - specific routing value. +// func (f Explain) WithRouting(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Routing = v @@ -292,6 +306,7 @@ func (f Explain) WithRouting(v string) func(*ExplainRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f Explain) WithSource(v ...string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Source = v @@ -299,6 +314,7 @@ func (f Explain) WithSource(v ...string) func(*ExplainRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f Explain) WithSourceExcludes(v ...string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.SourceExcludes = v @@ -306,6 +322,7 @@ func (f Explain) WithSourceExcludes(v ...string) func(*ExplainRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f Explain) WithSourceIncludes(v ...string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.SourceIncludes = v @@ -313,6 +330,7 @@ func (f Explain) WithSourceIncludes(v ...string) func(*ExplainRequest) { } // WithStoredFields - a list of stored fields to return in the response. +// func (f Explain) WithStoredFields(v ...string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.StoredFields = v @@ -320,6 +338,7 @@ func (f Explain) WithStoredFields(v ...string) func(*ExplainRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Explain) WithPretty() func(*ExplainRequest) { return func(r *ExplainRequest) { r.Pretty = true @@ -327,6 +346,7 @@ func (f Explain) WithPretty() func(*ExplainRequest) { } // WithHuman makes statistical values human-readable. +// func (f Explain) WithHuman() func(*ExplainRequest) { return func(r *ExplainRequest) { r.Human = true @@ -334,6 +354,7 @@ func (f Explain) WithHuman() func(*ExplainRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Explain) WithErrorTrace() func(*ExplainRequest) { return func(r *ExplainRequest) { r.ErrorTrace = true @@ -341,6 +362,7 @@ func (f Explain) WithErrorTrace() func(*ExplainRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Explain) WithFilterPath(v ...string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.FilterPath = v @@ -348,6 +370,7 @@ func (f Explain) WithFilterPath(v ...string) func(*ExplainRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Explain) WithHeader(h map[string]string) func(*ExplainRequest) { return func(r *ExplainRequest) { if r.Header == nil { @@ -360,6 +383,7 @@ func (f Explain) WithHeader(h map[string]string) func(*ExplainRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Explain) WithOpaqueID(s string) func(*ExplainRequest) { return func(r *ExplainRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.get_features.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.get_features.go index 62a6ad8cd2c..85994dd9502 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.get_features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.get_features.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newFeaturesGetFeaturesFunc(t Transport) FeaturesGetFeatures { // FeaturesGetFeatures gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-features-api.html. +// type FeaturesGetFeatures func(o ...func(*FeaturesGetFeaturesRequest)) (*Response, error) // FeaturesGetFeaturesRequest configures the Features Get Features API request. +// type FeaturesGetFeaturesRequest struct { MasterTimeout time.Duration @@ -58,6 +60,7 @@ type FeaturesGetFeaturesRequest struct { } // Do executes the request and returns response or error. +// func (r FeaturesGetFeaturesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r FeaturesGetFeaturesRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f FeaturesGetFeatures) WithContext(v context.Context) func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f FeaturesGetFeatures) WithContext(v context.Context) func(*FeaturesGetFea } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f FeaturesGetFeatures) WithMasterTimeout(v time.Duration) func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { r.MasterTimeout = v @@ -150,6 +155,7 @@ func (f FeaturesGetFeatures) WithMasterTimeout(v time.Duration) func(*FeaturesGe } // WithPretty makes the response body pretty-printed. +// func (f FeaturesGetFeatures) WithPretty() func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f FeaturesGetFeatures) WithPretty() func(*FeaturesGetFeaturesRequest) { } // WithHuman makes statistical values human-readable. +// func (f FeaturesGetFeatures) WithHuman() func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f FeaturesGetFeatures) WithHuman() func(*FeaturesGetFeaturesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f FeaturesGetFeatures) WithErrorTrace() func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f FeaturesGetFeatures) WithErrorTrace() func(*FeaturesGetFeaturesRequest) } // WithFilterPath filters the properties of the response body. +// func (f FeaturesGetFeatures) WithFilterPath(v ...string) func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f FeaturesGetFeatures) WithFilterPath(v ...string) func(*FeaturesGetFeatur } // WithHeader adds the headers to the HTTP request. +// func (f FeaturesGetFeatures) WithHeader(h map[string]string) func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f FeaturesGetFeatures) WithHeader(h map[string]string) func(*FeaturesGetFe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f FeaturesGetFeatures) WithOpaqueID(s string) func(*FeaturesGetFeaturesRequest) { return func(r *FeaturesGetFeaturesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.reset_features.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.reset_features.go index 765a552c7ef..c943dcbc7d5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.reset_features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.features.reset_features.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newFeaturesResetFeaturesFunc(t Transport) FeaturesResetFeatures { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type FeaturesResetFeatures func(o ...func(*FeaturesResetFeaturesRequest)) (*Response, error) // FeaturesResetFeaturesRequest configures the Features Reset Features API request. +// type FeaturesResetFeaturesRequest struct { Pretty bool Human bool @@ -57,6 +59,7 @@ type FeaturesResetFeaturesRequest struct { } // Do executes the request and returns response or error. +// func (r FeaturesResetFeaturesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -131,6 +134,7 @@ func (r FeaturesResetFeaturesRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f FeaturesResetFeatures) WithContext(v context.Context) func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { r.ctx = v @@ -138,6 +142,7 @@ func (f FeaturesResetFeatures) WithContext(v context.Context) func(*FeaturesRese } // WithPretty makes the response body pretty-printed. +// func (f FeaturesResetFeatures) WithPretty() func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { r.Pretty = true @@ -145,6 +150,7 @@ func (f FeaturesResetFeatures) WithPretty() func(*FeaturesResetFeaturesRequest) } // WithHuman makes statistical values human-readable. +// func (f FeaturesResetFeatures) WithHuman() func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { r.Human = true @@ -152,6 +158,7 @@ func (f FeaturesResetFeatures) WithHuman() func(*FeaturesResetFeaturesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f FeaturesResetFeatures) WithErrorTrace() func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { r.ErrorTrace = true @@ -159,6 +166,7 @@ func (f FeaturesResetFeatures) WithErrorTrace() func(*FeaturesResetFeaturesReque } // WithFilterPath filters the properties of the response body. +// func (f FeaturesResetFeatures) WithFilterPath(v ...string) func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { r.FilterPath = v @@ -166,6 +174,7 @@ func (f FeaturesResetFeatures) WithFilterPath(v ...string) func(*FeaturesResetFe } // WithHeader adds the headers to the HTTP request. +// func (f FeaturesResetFeatures) WithHeader(h map[string]string) func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { if r.Header == nil { @@ -178,6 +187,7 @@ func (f FeaturesResetFeatures) WithHeader(h map[string]string) func(*FeaturesRes } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f FeaturesResetFeatures) WithOpaqueID(s string) func(*FeaturesResetFeaturesRequest) { return func(r *FeaturesResetFeaturesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.field_caps.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.field_caps.go index 816096732de..d4f1660ae4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.field_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.field_caps.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newFieldCapsFunc(t Transport) FieldCaps { // FieldCaps returns the information about the capabilities of fields among multiple indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html. +// type FieldCaps func(o ...func(*FieldCapsRequest)) (*Response, error) // FieldCapsRequest configures the Field Caps API request. +// type FieldCapsRequest struct { Index []string @@ -67,6 +69,7 @@ type FieldCapsRequest struct { } // Do executes the request and returns response or error. +// func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -135,6 +138,10 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -147,10 +154,6 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -170,6 +173,7 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f FieldCaps) WithContext(v context.Context) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.ctx = v @@ -177,6 +181,7 @@ func (f FieldCaps) WithContext(v context.Context) func(*FieldCapsRequest) { } // WithBody - An index filter specified with the Query DSL. +// func (f FieldCaps) WithBody(v io.Reader) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.Body = v @@ -184,6 +189,7 @@ func (f FieldCaps) WithBody(v io.Reader) func(*FieldCapsRequest) { } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f FieldCaps) WithIndex(v ...string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.Index = v @@ -191,6 +197,7 @@ func (f FieldCaps) WithIndex(v ...string) func(*FieldCapsRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f FieldCaps) WithAllowNoIndices(v bool) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.AllowNoIndices = &v @@ -198,6 +205,7 @@ func (f FieldCaps) WithAllowNoIndices(v bool) func(*FieldCapsRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f FieldCaps) WithExpandWildcards(v string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.ExpandWildcards = v @@ -205,6 +213,7 @@ func (f FieldCaps) WithExpandWildcards(v string) func(*FieldCapsRequest) { } // WithFields - a list of field names. +// func (f FieldCaps) WithFields(v ...string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.Fields = v @@ -212,6 +221,7 @@ func (f FieldCaps) WithFields(v ...string) func(*FieldCapsRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f FieldCaps) WithIgnoreUnavailable(v bool) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.IgnoreUnavailable = &v @@ -219,6 +229,7 @@ func (f FieldCaps) WithIgnoreUnavailable(v bool) func(*FieldCapsRequest) { } // WithIncludeUnmapped - indicates whether unmapped fields should be included in the response.. +// func (f FieldCaps) WithIncludeUnmapped(v bool) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.IncludeUnmapped = &v @@ -226,6 +237,7 @@ func (f FieldCaps) WithIncludeUnmapped(v bool) func(*FieldCapsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f FieldCaps) WithPretty() func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.Pretty = true @@ -233,6 +245,7 @@ func (f FieldCaps) WithPretty() func(*FieldCapsRequest) { } // WithHuman makes statistical values human-readable. +// func (f FieldCaps) WithHuman() func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.Human = true @@ -240,6 +253,7 @@ func (f FieldCaps) WithHuman() func(*FieldCapsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f FieldCaps) WithErrorTrace() func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.ErrorTrace = true @@ -247,6 +261,7 @@ func (f FieldCaps) WithErrorTrace() func(*FieldCapsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f FieldCaps) WithFilterPath(v ...string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.FilterPath = v @@ -254,6 +269,7 @@ func (f FieldCaps) WithFilterPath(v ...string) func(*FieldCapsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f FieldCaps) WithHeader(h map[string]string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { if r.Header == nil { @@ -266,6 +282,7 @@ func (f FieldCaps) WithHeader(h map[string]string) func(*FieldCapsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f FieldCaps) WithOpaqueID(s string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.global_checkpoints.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.global_checkpoints.go index 74d69ce01a3..1ebf2b580ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.global_checkpoints.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.global_checkpoints.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newFleetGlobalCheckpointsFunc(t Transport) FleetGlobalCheckpoints { // FleetGlobalCheckpoints returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html. +// type FleetGlobalCheckpoints func(index string, o ...func(*FleetGlobalCheckpointsRequest)) (*Response, error) // FleetGlobalCheckpointsRequest configures the Fleet Global Checkpoints API request. +// type FleetGlobalCheckpointsRequest struct { Index string @@ -64,6 +66,7 @@ type FleetGlobalCheckpointsRequest struct { } // Do executes the request and returns response or error. +// func (r FleetGlobalCheckpointsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -159,6 +162,7 @@ func (r FleetGlobalCheckpointsRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f FleetGlobalCheckpoints) WithContext(v context.Context) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.ctx = v @@ -166,6 +170,7 @@ func (f FleetGlobalCheckpoints) WithContext(v context.Context) func(*FleetGlobal } // WithCheckpoints - comma separated list of checkpoints. +// func (f FleetGlobalCheckpoints) WithCheckpoints(v ...string) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.Checkpoints = v @@ -173,6 +178,7 @@ func (f FleetGlobalCheckpoints) WithCheckpoints(v ...string) func(*FleetGlobalCh } // WithTimeout - timeout to wait for global checkpoint to advance. +// func (f FleetGlobalCheckpoints) WithTimeout(v time.Duration) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.Timeout = v @@ -180,6 +186,7 @@ func (f FleetGlobalCheckpoints) WithTimeout(v time.Duration) func(*FleetGlobalCh } // WithWaitForAdvance - whether to wait for the global checkpoint to advance past the specified current checkpoints. +// func (f FleetGlobalCheckpoints) WithWaitForAdvance(v bool) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.WaitForAdvance = &v @@ -187,6 +194,7 @@ func (f FleetGlobalCheckpoints) WithWaitForAdvance(v bool) func(*FleetGlobalChec } // WithWaitForIndex - whether to wait for the target index to exist and all primary shards be active. +// func (f FleetGlobalCheckpoints) WithWaitForIndex(v bool) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.WaitForIndex = &v @@ -194,6 +202,7 @@ func (f FleetGlobalCheckpoints) WithWaitForIndex(v bool) func(*FleetGlobalCheckp } // WithPretty makes the response body pretty-printed. +// func (f FleetGlobalCheckpoints) WithPretty() func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.Pretty = true @@ -201,6 +210,7 @@ func (f FleetGlobalCheckpoints) WithPretty() func(*FleetGlobalCheckpointsRequest } // WithHuman makes statistical values human-readable. +// func (f FleetGlobalCheckpoints) WithHuman() func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.Human = true @@ -208,6 +218,7 @@ func (f FleetGlobalCheckpoints) WithHuman() func(*FleetGlobalCheckpointsRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f FleetGlobalCheckpoints) WithErrorTrace() func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.ErrorTrace = true @@ -215,6 +226,7 @@ func (f FleetGlobalCheckpoints) WithErrorTrace() func(*FleetGlobalCheckpointsReq } // WithFilterPath filters the properties of the response body. +// func (f FleetGlobalCheckpoints) WithFilterPath(v ...string) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { r.FilterPath = v @@ -222,6 +234,7 @@ func (f FleetGlobalCheckpoints) WithFilterPath(v ...string) func(*FleetGlobalChe } // WithHeader adds the headers to the HTTP request. +// func (f FleetGlobalCheckpoints) WithHeader(h map[string]string) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { if r.Header == nil { @@ -234,6 +247,7 @@ func (f FleetGlobalCheckpoints) WithHeader(h map[string]string) func(*FleetGloba } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f FleetGlobalCheckpoints) WithOpaqueID(s string) func(*FleetGlobalCheckpointsRequest) { return func(r *FleetGlobalCheckpointsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.msearch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.msearch.go index 8f08ac6e9c7..30181f01a7a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.msearch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newFleetMsearchFunc(t Transport) FleetMsearch { // FleetMsearch multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. // // This API is experimental. +// type FleetMsearch func(body io.Reader, o ...func(*FleetMsearchRequest)) (*Response, error) // FleetMsearchRequest configures the Fleet Msearch API request. +// type FleetMsearchRequest struct { Index string @@ -60,6 +62,7 @@ type FleetMsearchRequest struct { } // Do executes the request and returns response or error. +// func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -122,10 +129,6 @@ func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f FleetMsearch) WithContext(v context.Context) func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f FleetMsearch) WithContext(v context.Context) func(*FleetMsearchRequest) } // WithIndex - the index name to use as the default. +// func (f FleetMsearch) WithIndex(v string) func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { r.Index = v @@ -159,6 +164,7 @@ func (f FleetMsearch) WithIndex(v string) func(*FleetMsearchRequest) { } // WithPretty makes the response body pretty-printed. +// func (f FleetMsearch) WithPretty() func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f FleetMsearch) WithPretty() func(*FleetMsearchRequest) { } // WithHuman makes statistical values human-readable. +// func (f FleetMsearch) WithHuman() func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f FleetMsearch) WithHuman() func(*FleetMsearchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f FleetMsearch) WithErrorTrace() func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f FleetMsearch) WithErrorTrace() func(*FleetMsearchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f FleetMsearch) WithFilterPath(v ...string) func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f FleetMsearch) WithFilterPath(v ...string) func(*FleetMsearchRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f FleetMsearch) WithHeader(h map[string]string) func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f FleetMsearch) WithHeader(h map[string]string) func(*FleetMsearchRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f FleetMsearch) WithOpaqueID(s string) func(*FleetMsearchRequest) { return func(r *FleetMsearchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.search.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.search.go index c5f1d7a90b4..318d70fbabb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.fleet.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newFleetSearchFunc(t Transport) FleetSearch { // FleetSearch search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. // // This API is experimental. +// type FleetSearch func(index string, o ...func(*FleetSearchRequest)) (*Response, error) // FleetSearchRequest configures the Fleet Search API request. +// type FleetSearchRequest struct { Index string @@ -66,6 +68,7 @@ type FleetSearchRequest struct { } // Do executes the request and returns response or error. +// func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -126,6 +129,10 @@ func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Respo 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 @@ -138,10 +145,6 @@ func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Respo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -161,6 +164,7 @@ func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f FleetSearch) WithContext(v context.Context) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.ctx = v @@ -168,6 +172,7 @@ func (f FleetSearch) WithContext(v context.Context) func(*FleetSearchRequest) { } // WithBody - The search definition using the Query DSL. +// func (f FleetSearch) WithBody(v io.Reader) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.Body = v @@ -175,6 +180,7 @@ func (f FleetSearch) WithBody(v io.Reader) func(*FleetSearchRequest) { } // WithAllowPartialSearchResults - indicate if an error should be returned if there is a partial search failure or timeout. +// func (f FleetSearch) WithAllowPartialSearchResults(v bool) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.AllowPartialSearchResults = &v @@ -182,6 +188,7 @@ func (f FleetSearch) WithAllowPartialSearchResults(v bool) func(*FleetSearchRequ } // WithWaitForCheckpoints - comma separated list of checkpoints, one per shard. +// func (f FleetSearch) WithWaitForCheckpoints(v ...string) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.WaitForCheckpoints = v @@ -189,6 +196,7 @@ func (f FleetSearch) WithWaitForCheckpoints(v ...string) func(*FleetSearchReques } // WithWaitForCheckpointsTimeout - explicit wait_for_checkpoints timeout. +// func (f FleetSearch) WithWaitForCheckpointsTimeout(v time.Duration) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.WaitForCheckpointsTimeout = v @@ -196,6 +204,7 @@ func (f FleetSearch) WithWaitForCheckpointsTimeout(v time.Duration) func(*FleetS } // WithPretty makes the response body pretty-printed. +// func (f FleetSearch) WithPretty() func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.Pretty = true @@ -203,6 +212,7 @@ func (f FleetSearch) WithPretty() func(*FleetSearchRequest) { } // WithHuman makes statistical values human-readable. +// func (f FleetSearch) WithHuman() func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.Human = true @@ -210,6 +220,7 @@ func (f FleetSearch) WithHuman() func(*FleetSearchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f FleetSearch) WithErrorTrace() func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.ErrorTrace = true @@ -217,6 +228,7 @@ func (f FleetSearch) WithErrorTrace() func(*FleetSearchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f FleetSearch) WithFilterPath(v ...string) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { r.FilterPath = v @@ -224,6 +236,7 @@ func (f FleetSearch) WithFilterPath(v ...string) func(*FleetSearchRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f FleetSearch) WithHeader(h map[string]string) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { if r.Header == nil { @@ -236,6 +249,7 @@ func (f FleetSearch) WithHeader(h map[string]string) func(*FleetSearchRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f FleetSearch) WithOpaqueID(s string) func(*FleetSearchRequest) { return func(r *FleetSearchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get.go index 43bb31cb901..ab2a8fa701d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newGetFunc(t Transport) Get { // Get returns a document. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// type Get func(index string, id string, o ...func(*GetRequest)) (*Response, error) // GetRequest configures the Get API request. +// type GetRequest struct { Index string DocumentType string @@ -71,6 +73,7 @@ type GetRequest struct { } // Do executes the request and returns response or error. +// func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -196,6 +199,7 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err } // WithContext sets the request context. +// func (f Get) WithContext(v context.Context) func(*GetRequest) { return func(r *GetRequest) { r.ctx = v @@ -203,6 +207,7 @@ func (f Get) WithContext(v context.Context) func(*GetRequest) { } // WithDocumentType - the type of the document (use `_all` to fetch the first document matching the ID across all types). +// func (f Get) WithDocumentType(v string) func(*GetRequest) { return func(r *GetRequest) { r.DocumentType = v @@ -210,6 +215,7 @@ func (f Get) WithDocumentType(v string) func(*GetRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f Get) WithPreference(v string) func(*GetRequest) { return func(r *GetRequest) { r.Preference = v @@ -217,6 +223,7 @@ func (f Get) WithPreference(v string) func(*GetRequest) { } // WithRealtime - specify whether to perform the operation in realtime or search mode. +// func (f Get) WithRealtime(v bool) func(*GetRequest) { return func(r *GetRequest) { r.Realtime = &v @@ -224,6 +231,7 @@ func (f Get) WithRealtime(v bool) func(*GetRequest) { } // WithRefresh - refresh the shard containing the document before performing the operation. +// func (f Get) WithRefresh(v bool) func(*GetRequest) { return func(r *GetRequest) { r.Refresh = &v @@ -231,6 +239,7 @@ func (f Get) WithRefresh(v bool) func(*GetRequest) { } // WithRouting - specific routing value. +// func (f Get) WithRouting(v string) func(*GetRequest) { return func(r *GetRequest) { r.Routing = v @@ -238,6 +247,7 @@ func (f Get) WithRouting(v string) func(*GetRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f Get) WithSource(v ...string) func(*GetRequest) { return func(r *GetRequest) { r.Source = v @@ -245,6 +255,7 @@ func (f Get) WithSource(v ...string) func(*GetRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f Get) WithSourceExcludes(v ...string) func(*GetRequest) { return func(r *GetRequest) { r.SourceExcludes = v @@ -252,6 +263,7 @@ func (f Get) WithSourceExcludes(v ...string) func(*GetRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f Get) WithSourceIncludes(v ...string) func(*GetRequest) { return func(r *GetRequest) { r.SourceIncludes = v @@ -259,6 +271,7 @@ func (f Get) WithSourceIncludes(v ...string) func(*GetRequest) { } // WithStoredFields - a list of stored fields to return in the response. +// func (f Get) WithStoredFields(v ...string) func(*GetRequest) { return func(r *GetRequest) { r.StoredFields = v @@ -266,6 +279,7 @@ func (f Get) WithStoredFields(v ...string) func(*GetRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Get) WithVersion(v int) func(*GetRequest) { return func(r *GetRequest) { r.Version = &v @@ -273,6 +287,7 @@ func (f Get) WithVersion(v int) func(*GetRequest) { } // WithVersionType - specific version type. +// func (f Get) WithVersionType(v string) func(*GetRequest) { return func(r *GetRequest) { r.VersionType = v @@ -280,6 +295,7 @@ func (f Get) WithVersionType(v string) func(*GetRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Get) WithPretty() func(*GetRequest) { return func(r *GetRequest) { r.Pretty = true @@ -287,6 +303,7 @@ func (f Get) WithPretty() func(*GetRequest) { } // WithHuman makes statistical values human-readable. +// func (f Get) WithHuman() func(*GetRequest) { return func(r *GetRequest) { r.Human = true @@ -294,6 +311,7 @@ func (f Get) WithHuman() func(*GetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Get) WithErrorTrace() func(*GetRequest) { return func(r *GetRequest) { r.ErrorTrace = true @@ -301,6 +319,7 @@ func (f Get) WithErrorTrace() func(*GetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Get) WithFilterPath(v ...string) func(*GetRequest) { return func(r *GetRequest) { r.FilterPath = v @@ -308,6 +327,7 @@ func (f Get) WithFilterPath(v ...string) func(*GetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Get) WithHeader(h map[string]string) func(*GetRequest) { return func(r *GetRequest) { if r.Header == nil { @@ -320,6 +340,7 @@ func (f Get) WithHeader(h map[string]string) func(*GetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Get) WithOpaqueID(s string) func(*GetRequest) { return func(r *GetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script.go index 46e5b42df72..c5746a92ea1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newGetScriptFunc(t Transport) GetScript { // GetScript returns a script. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// type GetScript func(id string, o ...func(*GetScriptRequest)) (*Response, error) // GetScriptRequest configures the Get Script API request. +// type GetScriptRequest struct { ScriptID string @@ -60,6 +62,7 @@ type GetScriptRequest struct { } // Do executes the request and returns response or error. +// func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f GetScript) WithContext(v context.Context) func(*GetScriptRequest) { return func(r *GetScriptRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f GetScript) WithContext(v context.Context) func(*GetScriptRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f GetScript) WithMasterTimeout(v time.Duration) func(*GetScriptRequest) { return func(r *GetScriptRequest) { r.MasterTimeout = v @@ -155,6 +160,7 @@ func (f GetScript) WithMasterTimeout(v time.Duration) func(*GetScriptRequest) { } // WithPretty makes the response body pretty-printed. +// func (f GetScript) WithPretty() func(*GetScriptRequest) { return func(r *GetScriptRequest) { r.Pretty = true @@ -162,6 +168,7 @@ func (f GetScript) WithPretty() func(*GetScriptRequest) { } // WithHuman makes statistical values human-readable. +// func (f GetScript) WithHuman() func(*GetScriptRequest) { return func(r *GetScriptRequest) { r.Human = true @@ -169,6 +176,7 @@ func (f GetScript) WithHuman() func(*GetScriptRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f GetScript) WithErrorTrace() func(*GetScriptRequest) { return func(r *GetScriptRequest) { r.ErrorTrace = true @@ -176,6 +184,7 @@ func (f GetScript) WithErrorTrace() func(*GetScriptRequest) { } // WithFilterPath filters the properties of the response body. +// func (f GetScript) WithFilterPath(v ...string) func(*GetScriptRequest) { return func(r *GetScriptRequest) { r.FilterPath = v @@ -183,6 +192,7 @@ func (f GetScript) WithFilterPath(v ...string) func(*GetScriptRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f GetScript) WithHeader(h map[string]string) func(*GetScriptRequest) { return func(r *GetScriptRequest) { if r.Header == nil { @@ -195,6 +205,7 @@ func (f GetScript) WithHeader(h map[string]string) func(*GetScriptRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f GetScript) WithOpaqueID(s string) func(*GetScriptRequest) { return func(r *GetScriptRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_context.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_context.go index 3b7d587a71d..055ea823ab3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_context.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_context.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newGetScriptContextFunc(t Transport) GetScriptContext { // GetScriptContext returns all script contexts. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html. +// type GetScriptContext func(o ...func(*GetScriptContextRequest)) (*Response, error) // GetScriptContextRequest configures the Get Script Context API request. +// type GetScriptContextRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type GetScriptContextRequest struct { } // Do executes the request and returns response or error. +// func (r GetScriptContextRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r GetScriptContextRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f GetScriptContext) WithContext(v context.Context) func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f GetScriptContext) WithContext(v context.Context) func(*GetScriptContextR } // WithPretty makes the response body pretty-printed. +// func (f GetScriptContext) WithPretty() func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f GetScriptContext) WithPretty() func(*GetScriptContextRequest) { } // WithHuman makes statistical values human-readable. +// func (f GetScriptContext) WithHuman() func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f GetScriptContext) WithHuman() func(*GetScriptContextRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f GetScriptContext) WithErrorTrace() func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f GetScriptContext) WithErrorTrace() func(*GetScriptContextRequest) { } // WithFilterPath filters the properties of the response body. +// func (f GetScriptContext) WithFilterPath(v ...string) func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f GetScriptContext) WithFilterPath(v ...string) func(*GetScriptContextRequ } // WithHeader adds the headers to the HTTP request. +// func (f GetScriptContext) WithHeader(h map[string]string) func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f GetScriptContext) WithHeader(h map[string]string) func(*GetScriptContext } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f GetScriptContext) WithOpaqueID(s string) func(*GetScriptContextRequest) { return func(r *GetScriptContextRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_languages.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_languages.go index f393a7e3a4d..8eba9dc9385 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_languages.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_script_languages.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newGetScriptLanguagesFunc(t Transport) GetScriptLanguages { // GetScriptLanguages returns available script types, languages and contexts // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// type GetScriptLanguages func(o ...func(*GetScriptLanguagesRequest)) (*Response, error) // GetScriptLanguagesRequest configures the Get Script Languages API request. +// type GetScriptLanguagesRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type GetScriptLanguagesRequest struct { } // Do executes the request and returns response or error. +// func (r GetScriptLanguagesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r GetScriptLanguagesRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f GetScriptLanguages) WithContext(v context.Context) func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f GetScriptLanguages) WithContext(v context.Context) func(*GetScriptLangua } // WithPretty makes the response body pretty-printed. +// func (f GetScriptLanguages) WithPretty() func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f GetScriptLanguages) WithPretty() func(*GetScriptLanguagesRequest) { } // WithHuman makes statistical values human-readable. +// func (f GetScriptLanguages) WithHuman() func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f GetScriptLanguages) WithHuman() func(*GetScriptLanguagesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f GetScriptLanguages) WithErrorTrace() func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f GetScriptLanguages) WithErrorTrace() func(*GetScriptLanguagesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f GetScriptLanguages) WithFilterPath(v ...string) func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f GetScriptLanguages) WithFilterPath(v ...string) func(*GetScriptLanguages } // WithHeader adds the headers to the HTTP request. +// func (f GetScriptLanguages) WithHeader(h map[string]string) func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f GetScriptLanguages) WithHeader(h map[string]string) func(*GetScriptLangu } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f GetScriptLanguages) WithOpaqueID(s string) func(*GetScriptLanguagesRequest) { return func(r *GetScriptLanguagesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_source.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_source.go index acaa46c8c82..d0d8be5440d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.get_source.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newGetSourceFunc(t Transport) GetSource { // GetSource returns the source of a document. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// type GetSource func(index string, id string, o ...func(*GetSourceRequest)) (*Response, error) // GetSourceRequest configures the Get Source API request. +// type GetSourceRequest struct { Index string DocumentType string @@ -70,6 +72,7 @@ type GetSourceRequest struct { } // Do executes the request and returns response or error. +// func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -193,6 +196,7 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f GetSource) WithContext(v context.Context) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.ctx = v @@ -200,6 +204,7 @@ func (f GetSource) WithContext(v context.Context) func(*GetSourceRequest) { } // WithDocumentType - the type of the document; deprecated and optional starting with 7.0. +// func (f GetSource) WithDocumentType(v string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.DocumentType = v @@ -207,6 +212,7 @@ func (f GetSource) WithDocumentType(v string) func(*GetSourceRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f GetSource) WithPreference(v string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Preference = v @@ -214,6 +220,7 @@ func (f GetSource) WithPreference(v string) func(*GetSourceRequest) { } // WithRealtime - specify whether to perform the operation in realtime or search mode. +// func (f GetSource) WithRealtime(v bool) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Realtime = &v @@ -221,6 +228,7 @@ func (f GetSource) WithRealtime(v bool) func(*GetSourceRequest) { } // WithRefresh - refresh the shard containing the document before performing the operation. +// func (f GetSource) WithRefresh(v bool) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Refresh = &v @@ -228,6 +236,7 @@ func (f GetSource) WithRefresh(v bool) func(*GetSourceRequest) { } // WithRouting - specific routing value. +// func (f GetSource) WithRouting(v string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Routing = v @@ -235,6 +244,7 @@ func (f GetSource) WithRouting(v string) func(*GetSourceRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f GetSource) WithSource(v ...string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Source = v @@ -242,6 +252,7 @@ func (f GetSource) WithSource(v ...string) func(*GetSourceRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f GetSource) WithSourceExcludes(v ...string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.SourceExcludes = v @@ -249,6 +260,7 @@ func (f GetSource) WithSourceExcludes(v ...string) func(*GetSourceRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f GetSource) WithSourceIncludes(v ...string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.SourceIncludes = v @@ -256,6 +268,7 @@ func (f GetSource) WithSourceIncludes(v ...string) func(*GetSourceRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f GetSource) WithVersion(v int) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Version = &v @@ -263,6 +276,7 @@ func (f GetSource) WithVersion(v int) func(*GetSourceRequest) { } // WithVersionType - specific version type. +// func (f GetSource) WithVersionType(v string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.VersionType = v @@ -270,6 +284,7 @@ func (f GetSource) WithVersionType(v string) func(*GetSourceRequest) { } // WithPretty makes the response body pretty-printed. +// func (f GetSource) WithPretty() func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Pretty = true @@ -277,6 +292,7 @@ func (f GetSource) WithPretty() func(*GetSourceRequest) { } // WithHuman makes statistical values human-readable. +// func (f GetSource) WithHuman() func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Human = true @@ -284,6 +300,7 @@ func (f GetSource) WithHuman() func(*GetSourceRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f GetSource) WithErrorTrace() func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.ErrorTrace = true @@ -291,6 +308,7 @@ func (f GetSource) WithErrorTrace() func(*GetSourceRequest) { } // WithFilterPath filters the properties of the response body. +// func (f GetSource) WithFilterPath(v ...string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.FilterPath = v @@ -298,6 +316,7 @@ func (f GetSource) WithFilterPath(v ...string) func(*GetSourceRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f GetSource) WithHeader(h map[string]string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { if r.Header == nil { @@ -310,6 +329,7 @@ func (f GetSource) WithHeader(h map[string]string) func(*GetSourceRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f GetSource) WithOpaqueID(s string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.index.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.index.go index c137938d133..12f395e2930 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndexFunc(t Transport) Index { // Index creates or updates a document in an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. +// type Index func(index string, body io.Reader, o ...func(*IndexRequest)) (*Response, error) // IndexRequest configures the Index API request. +// type IndexRequest struct { Index string DocumentType string @@ -76,6 +78,7 @@ type IndexRequest struct { } // Do executes the request and returns response or error. +// func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -180,6 +183,10 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e 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 @@ -192,10 +199,6 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -215,6 +218,7 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e } // WithContext sets the request context. +// func (f Index) WithContext(v context.Context) func(*IndexRequest) { return func(r *IndexRequest) { r.ctx = v @@ -222,6 +226,7 @@ func (f Index) WithContext(v context.Context) func(*IndexRequest) { } // WithDocumentID - document ID. +// func (f Index) WithDocumentID(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.DocumentID = v @@ -229,6 +234,7 @@ func (f Index) WithDocumentID(v string) func(*IndexRequest) { } // WithDocumentType - the type of the document. +// func (f Index) WithDocumentType(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.DocumentType = v @@ -236,6 +242,7 @@ func (f Index) WithDocumentType(v string) func(*IndexRequest) { } // WithIfPrimaryTerm - only perform the index operation if the last operation that has changed the document has the specified primary term. +// func (f Index) WithIfPrimaryTerm(v int) func(*IndexRequest) { return func(r *IndexRequest) { r.IfPrimaryTerm = &v @@ -243,6 +250,7 @@ func (f Index) WithIfPrimaryTerm(v int) func(*IndexRequest) { } // WithIfSeqNo - only perform the index operation if the last operation that has changed the document has the specified sequence number. +// func (f Index) WithIfSeqNo(v int) func(*IndexRequest) { return func(r *IndexRequest) { r.IfSeqNo = &v @@ -250,6 +258,7 @@ func (f Index) WithIfSeqNo(v int) func(*IndexRequest) { } // WithOpType - explicit operation type. defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID. +// func (f Index) WithOpType(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.OpType = v @@ -257,6 +266,7 @@ func (f Index) WithOpType(v string) func(*IndexRequest) { } // WithPipeline - the pipeline ID to preprocess incoming documents with. +// func (f Index) WithPipeline(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.Pipeline = v @@ -264,6 +274,7 @@ func (f Index) WithPipeline(v string) func(*IndexRequest) { } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.. +// func (f Index) WithRefresh(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.Refresh = v @@ -271,6 +282,7 @@ func (f Index) WithRefresh(v string) func(*IndexRequest) { } // WithRequireAlias - when true, requires destination to be an alias. default is false. +// func (f Index) WithRequireAlias(v bool) func(*IndexRequest) { return func(r *IndexRequest) { r.RequireAlias = &v @@ -278,6 +290,7 @@ func (f Index) WithRequireAlias(v bool) func(*IndexRequest) { } // WithRouting - specific routing value. +// func (f Index) WithRouting(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.Routing = v @@ -285,6 +298,7 @@ func (f Index) WithRouting(v string) func(*IndexRequest) { } // WithTimeout - explicit operation timeout. +// func (f Index) WithTimeout(v time.Duration) func(*IndexRequest) { return func(r *IndexRequest) { r.Timeout = v @@ -292,6 +306,7 @@ func (f Index) WithTimeout(v time.Duration) func(*IndexRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Index) WithVersion(v int) func(*IndexRequest) { return func(r *IndexRequest) { r.Version = &v @@ -299,6 +314,7 @@ func (f Index) WithVersion(v int) func(*IndexRequest) { } // WithVersionType - specific version type. +// func (f Index) WithVersionType(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.VersionType = v @@ -306,6 +322,7 @@ func (f Index) WithVersionType(v string) func(*IndexRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the index operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f Index) WithWaitForActiveShards(v string) func(*IndexRequest) { return func(r *IndexRequest) { r.WaitForActiveShards = v @@ -313,6 +330,7 @@ func (f Index) WithWaitForActiveShards(v string) func(*IndexRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Index) WithPretty() func(*IndexRequest) { return func(r *IndexRequest) { r.Pretty = true @@ -320,6 +338,7 @@ func (f Index) WithPretty() func(*IndexRequest) { } // WithHuman makes statistical values human-readable. +// func (f Index) WithHuman() func(*IndexRequest) { return func(r *IndexRequest) { r.Human = true @@ -327,6 +346,7 @@ func (f Index) WithHuman() func(*IndexRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Index) WithErrorTrace() func(*IndexRequest) { return func(r *IndexRequest) { r.ErrorTrace = true @@ -334,6 +354,7 @@ func (f Index) WithErrorTrace() func(*IndexRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Index) WithFilterPath(v ...string) func(*IndexRequest) { return func(r *IndexRequest) { r.FilterPath = v @@ -341,6 +362,7 @@ func (f Index) WithFilterPath(v ...string) func(*IndexRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Index) WithHeader(h map[string]string) func(*IndexRequest) { return func(r *IndexRequest) { if r.Header == nil { @@ -353,6 +375,7 @@ func (f Index) WithHeader(h map[string]string) func(*IndexRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Index) WithOpaqueID(s string) func(*IndexRequest) { return func(r *IndexRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.add_block.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.add_block.go index 853121661e0..0438126f303 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.add_block.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.add_block.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesAddBlockFunc(t Transport) IndicesAddBlock { // IndicesAddBlock adds a block to an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html. +// type IndicesAddBlock func(index []string, block string, o ...func(*IndicesAddBlockRequest)) (*Response, error) // IndicesAddBlockRequest configures the Indices Add Block API request. +// type IndicesAddBlockRequest struct { Index []string @@ -68,6 +70,7 @@ type IndicesAddBlockRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -171,6 +174,7 @@ func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesAddBlock) WithContext(v context.Context) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.ctx = v @@ -178,6 +182,7 @@ func (f IndicesAddBlock) WithContext(v context.Context) func(*IndicesAddBlockReq } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesAddBlock) WithAllowNoIndices(v bool) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.AllowNoIndices = &v @@ -185,6 +190,7 @@ func (f IndicesAddBlock) WithAllowNoIndices(v bool) func(*IndicesAddBlockRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesAddBlock) WithExpandWildcards(v string) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.ExpandWildcards = v @@ -192,6 +198,7 @@ func (f IndicesAddBlock) WithExpandWildcards(v string) func(*IndicesAddBlockRequ } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesAddBlock) WithIgnoreUnavailable(v bool) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.IgnoreUnavailable = &v @@ -199,6 +206,7 @@ func (f IndicesAddBlock) WithIgnoreUnavailable(v bool) func(*IndicesAddBlockRequ } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesAddBlock) WithMasterTimeout(v time.Duration) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.MasterTimeout = v @@ -206,6 +214,7 @@ func (f IndicesAddBlock) WithMasterTimeout(v time.Duration) func(*IndicesAddBloc } // WithTimeout - explicit operation timeout. +// func (f IndicesAddBlock) WithTimeout(v time.Duration) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.Timeout = v @@ -213,6 +222,7 @@ func (f IndicesAddBlock) WithTimeout(v time.Duration) func(*IndicesAddBlockReque } // WithPretty makes the response body pretty-printed. +// func (f IndicesAddBlock) WithPretty() func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.Pretty = true @@ -220,6 +230,7 @@ func (f IndicesAddBlock) WithPretty() func(*IndicesAddBlockRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesAddBlock) WithHuman() func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.Human = true @@ -227,6 +238,7 @@ func (f IndicesAddBlock) WithHuman() func(*IndicesAddBlockRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesAddBlock) WithErrorTrace() func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.ErrorTrace = true @@ -234,6 +246,7 @@ func (f IndicesAddBlock) WithErrorTrace() func(*IndicesAddBlockRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesAddBlock) WithFilterPath(v ...string) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.FilterPath = v @@ -241,6 +254,7 @@ func (f IndicesAddBlock) WithFilterPath(v ...string) func(*IndicesAddBlockReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesAddBlock) WithHeader(h map[string]string) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { if r.Header == nil { @@ -253,6 +267,7 @@ func (f IndicesAddBlock) WithHeader(h map[string]string) func(*IndicesAddBlockRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesAddBlock) WithOpaqueID(s string) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.analyze.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.analyze.go index e4e34b9d881..035ab16c651 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.analyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.analyze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesAnalyzeFunc(t Transport) IndicesAnalyze { // IndicesAnalyze performs the analysis process on a text and return the tokens breakdown of the text. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html. +// type IndicesAnalyze func(o ...func(*IndicesAnalyzeRequest)) (*Response, error) // IndicesAnalyzeRequest configures the Indices Analyze API request. +// type IndicesAnalyzeRequest struct { Index string @@ -60,6 +62,7 @@ type IndicesAnalyzeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -112,6 +115,10 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -124,10 +131,6 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -147,6 +150,7 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f IndicesAnalyze) WithContext(v context.Context) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f IndicesAnalyze) WithContext(v context.Context) func(*IndicesAnalyzeReque } // WithBody - Define analyzer/tokenizer parameters and the text on which the analysis should be performed. +// func (f IndicesAnalyze) WithBody(v io.Reader) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.Body = v @@ -161,6 +166,7 @@ func (f IndicesAnalyze) WithBody(v io.Reader) func(*IndicesAnalyzeRequest) { } // WithIndex - the name of the index to scope the operation. +// func (f IndicesAnalyze) WithIndex(v string) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.Index = v @@ -168,6 +174,7 @@ func (f IndicesAnalyze) WithIndex(v string) func(*IndicesAnalyzeRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesAnalyze) WithPretty() func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.Pretty = true @@ -175,6 +182,7 @@ func (f IndicesAnalyze) WithPretty() func(*IndicesAnalyzeRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesAnalyze) WithHuman() func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.Human = true @@ -182,6 +190,7 @@ func (f IndicesAnalyze) WithHuman() func(*IndicesAnalyzeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesAnalyze) WithErrorTrace() func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.ErrorTrace = true @@ -189,6 +198,7 @@ func (f IndicesAnalyze) WithErrorTrace() func(*IndicesAnalyzeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesAnalyze) WithFilterPath(v ...string) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { r.FilterPath = v @@ -196,6 +206,7 @@ func (f IndicesAnalyze) WithFilterPath(v ...string) func(*IndicesAnalyzeRequest) } // WithHeader adds the headers to the HTTP request. +// func (f IndicesAnalyze) WithHeader(h map[string]string) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { if r.Header == nil { @@ -208,6 +219,7 @@ func (f IndicesAnalyze) WithHeader(h map[string]string) func(*IndicesAnalyzeRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesAnalyze) WithOpaqueID(s string) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clear_cache.go index 6cf29d260c5..97058ce6db4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clear_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesClearCacheFunc(t Transport) IndicesClearCache { // IndicesClearCache clears all or specific caches for one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html. +// type IndicesClearCache func(o ...func(*IndicesClearCacheRequest)) (*Response, error) // IndicesClearCacheRequest configures the Indices Clear Cache API request. +// type IndicesClearCacheRequest struct { Index []string @@ -66,6 +68,7 @@ type IndicesClearCacheRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -179,6 +182,7 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IndicesClearCache) WithContext(v context.Context) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.ctx = v @@ -186,6 +190,7 @@ func (f IndicesClearCache) WithContext(v context.Context) func(*IndicesClearCach } // WithIndex - a list of index name to limit the operation. +// func (f IndicesClearCache) WithIndex(v ...string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Index = v @@ -193,6 +198,7 @@ func (f IndicesClearCache) WithIndex(v ...string) func(*IndicesClearCacheRequest } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesClearCache) WithAllowNoIndices(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.AllowNoIndices = &v @@ -200,6 +206,7 @@ func (f IndicesClearCache) WithAllowNoIndices(v bool) func(*IndicesClearCacheReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesClearCache) WithExpandWildcards(v string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.ExpandWildcards = v @@ -207,6 +214,7 @@ func (f IndicesClearCache) WithExpandWildcards(v string) func(*IndicesClearCache } // WithFielddata - clear field data. +// func (f IndicesClearCache) WithFielddata(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Fielddata = &v @@ -214,6 +222,7 @@ func (f IndicesClearCache) WithFielddata(v bool) func(*IndicesClearCacheRequest) } // WithFields - a list of fields to clear when using the `fielddata` parameter (default: all). +// func (f IndicesClearCache) WithFields(v ...string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Fields = v @@ -221,6 +230,7 @@ func (f IndicesClearCache) WithFields(v ...string) func(*IndicesClearCacheReques } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesClearCache) WithIgnoreUnavailable(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.IgnoreUnavailable = &v @@ -228,6 +238,7 @@ func (f IndicesClearCache) WithIgnoreUnavailable(v bool) func(*IndicesClearCache } // WithQuery - clear query caches. +// func (f IndicesClearCache) WithQuery(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Query = &v @@ -235,6 +246,7 @@ func (f IndicesClearCache) WithQuery(v bool) func(*IndicesClearCacheRequest) { } // WithRequest - clear request cache. +// func (f IndicesClearCache) WithRequest(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Request = &v @@ -242,6 +254,7 @@ func (f IndicesClearCache) WithRequest(v bool) func(*IndicesClearCacheRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesClearCache) WithPretty() func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Pretty = true @@ -249,6 +262,7 @@ func (f IndicesClearCache) WithPretty() func(*IndicesClearCacheRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesClearCache) WithHuman() func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.Human = true @@ -256,6 +270,7 @@ func (f IndicesClearCache) WithHuman() func(*IndicesClearCacheRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesClearCache) WithErrorTrace() func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.ErrorTrace = true @@ -263,6 +278,7 @@ func (f IndicesClearCache) WithErrorTrace() func(*IndicesClearCacheRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesClearCache) WithFilterPath(v ...string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.FilterPath = v @@ -270,6 +286,7 @@ func (f IndicesClearCache) WithFilterPath(v ...string) func(*IndicesClearCacheRe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesClearCache) WithHeader(h map[string]string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { if r.Header == nil { @@ -282,6 +299,7 @@ func (f IndicesClearCache) WithHeader(h map[string]string) func(*IndicesClearCac } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesClearCache) WithOpaqueID(s string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clone.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clone.go index 96a10772081..b3fca7e8004 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clone.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.clone.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesCloneFunc(t Transport) IndicesClone { // IndicesClone clones an index // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html. +// type IndicesClone func(index string, target string, o ...func(*IndicesCloneRequest)) (*Response, error) // IndicesCloneRequest configures the Indices Clone API request. +// type IndicesCloneRequest struct { Index string @@ -67,6 +69,7 @@ type IndicesCloneRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -127,6 +130,10 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -139,10 +146,6 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -162,6 +165,7 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f IndicesClone) WithContext(v context.Context) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f IndicesClone) WithContext(v context.Context) func(*IndicesCloneRequest) } // WithBody - The configuration for the target index (`settings` and `aliases`). +// func (f IndicesClone) WithBody(v io.Reader) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.Body = v @@ -176,6 +181,7 @@ func (f IndicesClone) WithBody(v io.Reader) func(*IndicesCloneRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesClone) WithMasterTimeout(v time.Duration) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.MasterTimeout = v @@ -183,6 +189,7 @@ func (f IndicesClone) WithMasterTimeout(v time.Duration) func(*IndicesCloneReque } // WithTimeout - explicit operation timeout. +// func (f IndicesClone) WithTimeout(v time.Duration) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.Timeout = v @@ -190,6 +197,7 @@ func (f IndicesClone) WithTimeout(v time.Duration) func(*IndicesCloneRequest) { } // WithWaitForActiveShards - set the number of active shards to wait for on the cloned index before the operation returns.. +// func (f IndicesClone) WithWaitForActiveShards(v string) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.WaitForActiveShards = v @@ -197,6 +205,7 @@ func (f IndicesClone) WithWaitForActiveShards(v string) func(*IndicesCloneReques } // WithPretty makes the response body pretty-printed. +// func (f IndicesClone) WithPretty() func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.Pretty = true @@ -204,6 +213,7 @@ func (f IndicesClone) WithPretty() func(*IndicesCloneRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesClone) WithHuman() func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.Human = true @@ -211,6 +221,7 @@ func (f IndicesClone) WithHuman() func(*IndicesCloneRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesClone) WithErrorTrace() func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.ErrorTrace = true @@ -218,6 +229,7 @@ func (f IndicesClone) WithErrorTrace() func(*IndicesCloneRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesClone) WithFilterPath(v ...string) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { r.FilterPath = v @@ -225,6 +237,7 @@ func (f IndicesClone) WithFilterPath(v ...string) func(*IndicesCloneRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesClone) WithHeader(h map[string]string) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { if r.Header == nil { @@ -237,6 +250,7 @@ func (f IndicesClone) WithHeader(h map[string]string) func(*IndicesCloneRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesClone) WithOpaqueID(s string) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.close.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.close.go index 39791292142..e0e7b015c5d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.close.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.close.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesCloseFunc(t Transport) IndicesClose { // IndicesClose closes an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. +// type IndicesClose func(index []string, o ...func(*IndicesCloseRequest)) (*Response, error) // IndicesCloseRequest configures the Indices Close API request. +// type IndicesCloseRequest struct { Index []string @@ -67,6 +69,7 @@ type IndicesCloseRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -172,6 +175,7 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f IndicesClose) WithContext(v context.Context) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.ctx = v @@ -179,6 +183,7 @@ func (f IndicesClose) WithContext(v context.Context) func(*IndicesCloseRequest) } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesClose) WithAllowNoIndices(v bool) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.AllowNoIndices = &v @@ -186,6 +191,7 @@ func (f IndicesClose) WithAllowNoIndices(v bool) func(*IndicesCloseRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesClose) WithExpandWildcards(v string) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.ExpandWildcards = v @@ -193,6 +199,7 @@ func (f IndicesClose) WithExpandWildcards(v string) func(*IndicesCloseRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesClose) WithIgnoreUnavailable(v bool) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.IgnoreUnavailable = &v @@ -200,6 +207,7 @@ func (f IndicesClose) WithIgnoreUnavailable(v bool) func(*IndicesCloseRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesClose) WithMasterTimeout(v time.Duration) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.MasterTimeout = v @@ -207,6 +215,7 @@ func (f IndicesClose) WithMasterTimeout(v time.Duration) func(*IndicesCloseReque } // WithTimeout - explicit operation timeout. +// func (f IndicesClose) WithTimeout(v time.Duration) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.Timeout = v @@ -214,6 +223,7 @@ func (f IndicesClose) WithTimeout(v time.Duration) func(*IndicesCloseRequest) { } // WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns. set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. defaults to `0`.. +// func (f IndicesClose) WithWaitForActiveShards(v string) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.WaitForActiveShards = v @@ -221,6 +231,7 @@ func (f IndicesClose) WithWaitForActiveShards(v string) func(*IndicesCloseReques } // WithPretty makes the response body pretty-printed. +// func (f IndicesClose) WithPretty() func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.Pretty = true @@ -228,6 +239,7 @@ func (f IndicesClose) WithPretty() func(*IndicesCloseRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesClose) WithHuman() func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.Human = true @@ -235,6 +247,7 @@ func (f IndicesClose) WithHuman() func(*IndicesCloseRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesClose) WithErrorTrace() func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.ErrorTrace = true @@ -242,6 +255,7 @@ func (f IndicesClose) WithErrorTrace() func(*IndicesCloseRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesClose) WithFilterPath(v ...string) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.FilterPath = v @@ -249,6 +263,7 @@ func (f IndicesClose) WithFilterPath(v ...string) func(*IndicesCloseRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesClose) WithHeader(h map[string]string) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { if r.Header == nil { @@ -261,6 +276,7 @@ func (f IndicesClose) WithHeader(h map[string]string) func(*IndicesCloseRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesClose) WithOpaqueID(s string) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.create.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.create.go index f30dcf6f64b..beed749eb2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.create.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesCreateFunc(t Transport) IndicesCreate { // IndicesCreate creates an index with optional settings and mappings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html. +// type IndicesCreate func(index string, o ...func(*IndicesCreateRequest)) (*Response, error) // IndicesCreateRequest configures the Indices Create API request. +// type IndicesCreateRequest struct { Index string @@ -67,6 +69,7 @@ type IndicesCreateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -127,6 +130,10 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -139,10 +146,6 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -162,6 +165,7 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f IndicesCreate) WithContext(v context.Context) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f IndicesCreate) WithContext(v context.Context) func(*IndicesCreateRequest } // WithBody - The configuration for the index (`settings` and `mappings`). +// func (f IndicesCreate) WithBody(v io.Reader) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.Body = v @@ -176,6 +181,7 @@ func (f IndicesCreate) WithBody(v io.Reader) func(*IndicesCreateRequest) { } // WithIncludeTypeName - whether a type should be expected in the body of the mappings.. +// func (f IndicesCreate) WithIncludeTypeName(v bool) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.IncludeTypeName = &v @@ -183,6 +189,7 @@ func (f IndicesCreate) WithIncludeTypeName(v bool) func(*IndicesCreateRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesCreate) WithMasterTimeout(v time.Duration) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.MasterTimeout = v @@ -190,6 +197,7 @@ func (f IndicesCreate) WithMasterTimeout(v time.Duration) func(*IndicesCreateReq } // WithTimeout - explicit operation timeout. +// func (f IndicesCreate) WithTimeout(v time.Duration) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.Timeout = v @@ -197,6 +205,7 @@ func (f IndicesCreate) WithTimeout(v time.Duration) func(*IndicesCreateRequest) } // WithWaitForActiveShards - set the number of active shards to wait for before the operation returns.. +// func (f IndicesCreate) WithWaitForActiveShards(v string) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.WaitForActiveShards = v @@ -204,6 +213,7 @@ func (f IndicesCreate) WithWaitForActiveShards(v string) func(*IndicesCreateRequ } // WithPretty makes the response body pretty-printed. +// func (f IndicesCreate) WithPretty() func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.Pretty = true @@ -211,6 +221,7 @@ func (f IndicesCreate) WithPretty() func(*IndicesCreateRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesCreate) WithHuman() func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.Human = true @@ -218,6 +229,7 @@ func (f IndicesCreate) WithHuman() func(*IndicesCreateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesCreate) WithErrorTrace() func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.ErrorTrace = true @@ -225,6 +237,7 @@ func (f IndicesCreate) WithErrorTrace() func(*IndicesCreateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesCreate) WithFilterPath(v ...string) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { r.FilterPath = v @@ -232,6 +245,7 @@ func (f IndicesCreate) WithFilterPath(v ...string) func(*IndicesCreateRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesCreate) WithHeader(h map[string]string) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { if r.Header == nil { @@ -244,6 +258,7 @@ func (f IndicesCreate) WithHeader(h map[string]string) func(*IndicesCreateReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesCreate) WithOpaqueID(s string) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete.go index a8c3a7c1940..90bb336e8c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesDeleteFunc(t Transport) IndicesDelete { // IndicesDelete deletes an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html. +// type IndicesDelete func(index []string, o ...func(*IndicesDeleteRequest)) (*Response, error) // IndicesDeleteRequest configures the Indices Delete API request. +// type IndicesDeleteRequest struct { Index []string @@ -66,6 +68,7 @@ type IndicesDeleteRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -165,6 +168,7 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f IndicesDelete) WithContext(v context.Context) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f IndicesDelete) WithContext(v context.Context) func(*IndicesDeleteRequest } // WithAllowNoIndices - ignore if a wildcard expression resolves to no concrete indices (default: false). +// func (f IndicesDelete) WithAllowNoIndices(v bool) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.AllowNoIndices = &v @@ -179,6 +184,7 @@ func (f IndicesDelete) WithAllowNoIndices(v bool) func(*IndicesDeleteRequest) { } // WithExpandWildcards - whether wildcard expressions should get expanded to open, closed, or hidden indices. +// func (f IndicesDelete) WithExpandWildcards(v string) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.ExpandWildcards = v @@ -186,6 +192,7 @@ func (f IndicesDelete) WithExpandWildcards(v string) func(*IndicesDeleteRequest) } // WithIgnoreUnavailable - ignore unavailable indexes (default: false). +// func (f IndicesDelete) WithIgnoreUnavailable(v bool) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.IgnoreUnavailable = &v @@ -193,6 +200,7 @@ func (f IndicesDelete) WithIgnoreUnavailable(v bool) func(*IndicesDeleteRequest) } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesDelete) WithMasterTimeout(v time.Duration) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.MasterTimeout = v @@ -200,6 +208,7 @@ func (f IndicesDelete) WithMasterTimeout(v time.Duration) func(*IndicesDeleteReq } // WithTimeout - explicit operation timeout. +// func (f IndicesDelete) WithTimeout(v time.Duration) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.Timeout = v @@ -207,6 +216,7 @@ func (f IndicesDelete) WithTimeout(v time.Duration) func(*IndicesDeleteRequest) } // WithPretty makes the response body pretty-printed. +// func (f IndicesDelete) WithPretty() func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.Pretty = true @@ -214,6 +224,7 @@ func (f IndicesDelete) WithPretty() func(*IndicesDeleteRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesDelete) WithHuman() func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.Human = true @@ -221,6 +232,7 @@ func (f IndicesDelete) WithHuman() func(*IndicesDeleteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDelete) WithErrorTrace() func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.ErrorTrace = true @@ -228,6 +240,7 @@ func (f IndicesDelete) WithErrorTrace() func(*IndicesDeleteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesDelete) WithFilterPath(v ...string) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.FilterPath = v @@ -235,6 +248,7 @@ func (f IndicesDelete) WithFilterPath(v ...string) func(*IndicesDeleteRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDelete) WithHeader(h map[string]string) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { if r.Header == nil { @@ -247,6 +261,7 @@ func (f IndicesDelete) WithHeader(h map[string]string) func(*IndicesDeleteReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDelete) WithOpaqueID(s string) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_alias.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_alias.go index 06b9cd72a4a..a4814cf5bb9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesDeleteAliasFunc(t Transport) IndicesDeleteAlias { // IndicesDeleteAlias deletes an alias. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// type IndicesDeleteAlias func(index []string, name []string, o ...func(*IndicesDeleteAliasRequest)) (*Response, error) // IndicesDeleteAliasRequest configures the Indices Delete Alias API request. +// type IndicesDeleteAliasRequest struct { Index []string @@ -64,6 +66,7 @@ type IndicesDeleteAliasRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesDeleteAlias) WithContext(v context.Context) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f IndicesDeleteAlias) WithContext(v context.Context) func(*IndicesDeleteAl } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesDeleteAlias) WithMasterTimeout(v time.Duration) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.MasterTimeout = v @@ -172,6 +177,7 @@ func (f IndicesDeleteAlias) WithMasterTimeout(v time.Duration) func(*IndicesDele } // WithTimeout - explicit timestamp for the document. +// func (f IndicesDeleteAlias) WithTimeout(v time.Duration) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.Timeout = v @@ -179,6 +185,7 @@ func (f IndicesDeleteAlias) WithTimeout(v time.Duration) func(*IndicesDeleteAlia } // WithPretty makes the response body pretty-printed. +// func (f IndicesDeleteAlias) WithPretty() func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.Pretty = true @@ -186,6 +193,7 @@ func (f IndicesDeleteAlias) WithPretty() func(*IndicesDeleteAliasRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesDeleteAlias) WithHuman() func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.Human = true @@ -193,6 +201,7 @@ func (f IndicesDeleteAlias) WithHuman() func(*IndicesDeleteAliasRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDeleteAlias) WithErrorTrace() func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.ErrorTrace = true @@ -200,6 +209,7 @@ func (f IndicesDeleteAlias) WithErrorTrace() func(*IndicesDeleteAliasRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesDeleteAlias) WithFilterPath(v ...string) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { r.FilterPath = v @@ -207,6 +217,7 @@ func (f IndicesDeleteAlias) WithFilterPath(v ...string) func(*IndicesDeleteAlias } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDeleteAlias) WithHeader(h map[string]string) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { if r.Header == nil { @@ -219,6 +230,7 @@ func (f IndicesDeleteAlias) WithHeader(h map[string]string) func(*IndicesDeleteA } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDeleteAlias) WithOpaqueID(s string) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_index_template.go index 47584ec2814..f098dafacf3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesDeleteIndexTemplateFunc(t Transport) IndicesDeleteIndexTemplate { // IndicesDeleteIndexTemplate deletes an index template. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesDeleteIndexTemplate func(name string, o ...func(*IndicesDeleteIndexTemplateRequest)) (*Response, error) // IndicesDeleteIndexTemplateRequest configures the Indices Delete Index Template API request. +// type IndicesDeleteIndexTemplateRequest struct { Name string @@ -61,6 +63,7 @@ type IndicesDeleteIndexTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -146,6 +149,7 @@ func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f IndicesDeleteIndexTemplate) WithContext(v context.Context) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.ctx = v @@ -153,6 +157,7 @@ func (f IndicesDeleteIndexTemplate) WithContext(v context.Context) func(*Indices } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesDeleteIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.MasterTimeout = v @@ -160,6 +165,7 @@ func (f IndicesDeleteIndexTemplate) WithMasterTimeout(v time.Duration) func(*Ind } // WithTimeout - explicit operation timeout. +// func (f IndicesDeleteIndexTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.Timeout = v @@ -167,6 +173,7 @@ func (f IndicesDeleteIndexTemplate) WithTimeout(v time.Duration) func(*IndicesDe } // WithPretty makes the response body pretty-printed. +// func (f IndicesDeleteIndexTemplate) WithPretty() func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.Pretty = true @@ -174,6 +181,7 @@ func (f IndicesDeleteIndexTemplate) WithPretty() func(*IndicesDeleteIndexTemplat } // WithHuman makes statistical values human-readable. +// func (f IndicesDeleteIndexTemplate) WithHuman() func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.Human = true @@ -181,6 +189,7 @@ func (f IndicesDeleteIndexTemplate) WithHuman() func(*IndicesDeleteIndexTemplate } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDeleteIndexTemplate) WithErrorTrace() func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.ErrorTrace = true @@ -188,6 +197,7 @@ func (f IndicesDeleteIndexTemplate) WithErrorTrace() func(*IndicesDeleteIndexTem } // WithFilterPath filters the properties of the response body. +// func (f IndicesDeleteIndexTemplate) WithFilterPath(v ...string) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { r.FilterPath = v @@ -195,6 +205,7 @@ func (f IndicesDeleteIndexTemplate) WithFilterPath(v ...string) func(*IndicesDel } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDeleteIndexTemplate) WithHeader(h map[string]string) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { if r.Header == nil { @@ -207,6 +218,7 @@ func (f IndicesDeleteIndexTemplate) WithHeader(h map[string]string) func(*Indice } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDeleteIndexTemplate) WithOpaqueID(s string) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_template.go index d1283225302..b8827c0ca4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.delete_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { // IndicesDeleteTemplate deletes an index template. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateRequest)) (*Response, error) // IndicesDeleteTemplateRequest configures the Indices Delete Template API request. +// type IndicesDeleteTemplateRequest struct { Name string @@ -61,6 +63,7 @@ type IndicesDeleteTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -146,6 +149,7 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f IndicesDeleteTemplate) WithContext(v context.Context) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.ctx = v @@ -153,6 +157,7 @@ func (f IndicesDeleteTemplate) WithContext(v context.Context) func(*IndicesDelet } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesDeleteTemplate) WithMasterTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.MasterTimeout = v @@ -160,6 +165,7 @@ func (f IndicesDeleteTemplate) WithMasterTimeout(v time.Duration) func(*IndicesD } // WithTimeout - explicit operation timeout. +// func (f IndicesDeleteTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.Timeout = v @@ -167,6 +173,7 @@ func (f IndicesDeleteTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteT } // WithPretty makes the response body pretty-printed. +// func (f IndicesDeleteTemplate) WithPretty() func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.Pretty = true @@ -174,6 +181,7 @@ func (f IndicesDeleteTemplate) WithPretty() func(*IndicesDeleteTemplateRequest) } // WithHuman makes statistical values human-readable. +// func (f IndicesDeleteTemplate) WithHuman() func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.Human = true @@ -181,6 +189,7 @@ func (f IndicesDeleteTemplate) WithHuman() func(*IndicesDeleteTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDeleteTemplate) WithErrorTrace() func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.ErrorTrace = true @@ -188,6 +197,7 @@ func (f IndicesDeleteTemplate) WithErrorTrace() func(*IndicesDeleteTemplateReque } // WithFilterPath filters the properties of the response body. +// func (f IndicesDeleteTemplate) WithFilterPath(v ...string) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.FilterPath = v @@ -195,6 +205,7 @@ func (f IndicesDeleteTemplate) WithFilterPath(v ...string) func(*IndicesDeleteTe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { if r.Header == nil { @@ -207,6 +218,7 @@ func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDele } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDeleteTemplate) WithOpaqueID(s string) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.disk_usage.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.disk_usage.go index 75a4989f50e..d073f8eb75c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.disk_usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.disk_usage.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesDiskUsageFunc(t Transport) IndicesDiskUsage { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html. +// type IndicesDiskUsage func(index string, o ...func(*IndicesDiskUsageRequest)) (*Response, error) // IndicesDiskUsageRequest configures the Indices Disk Usage API request. +// type IndicesDiskUsageRequest struct { Index string @@ -66,6 +68,7 @@ type IndicesDiskUsageRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDiskUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -163,6 +166,7 @@ func (r IndicesDiskUsageRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f IndicesDiskUsage) WithContext(v context.Context) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.ctx = v @@ -170,6 +174,7 @@ func (f IndicesDiskUsage) WithContext(v context.Context) func(*IndicesDiskUsageR } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesDiskUsage) WithAllowNoIndices(v bool) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.AllowNoIndices = &v @@ -177,6 +182,7 @@ func (f IndicesDiskUsage) WithAllowNoIndices(v bool) func(*IndicesDiskUsageReque } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesDiskUsage) WithExpandWildcards(v string) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.ExpandWildcards = v @@ -184,6 +190,7 @@ func (f IndicesDiskUsage) WithExpandWildcards(v string) func(*IndicesDiskUsageRe } // WithFlush - whether flush or not before analyzing the index disk usage. defaults to true. +// func (f IndicesDiskUsage) WithFlush(v bool) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.Flush = &v @@ -191,6 +198,7 @@ func (f IndicesDiskUsage) WithFlush(v bool) func(*IndicesDiskUsageRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesDiskUsage) WithIgnoreUnavailable(v bool) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.IgnoreUnavailable = &v @@ -198,6 +206,7 @@ func (f IndicesDiskUsage) WithIgnoreUnavailable(v bool) func(*IndicesDiskUsageRe } // WithRunExpensiveTasks - must be set to [true] in order for the task to be performed. defaults to false.. +// func (f IndicesDiskUsage) WithRunExpensiveTasks(v bool) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.RunExpensiveTasks = &v @@ -205,6 +214,7 @@ func (f IndicesDiskUsage) WithRunExpensiveTasks(v bool) func(*IndicesDiskUsageRe } // WithPretty makes the response body pretty-printed. +// func (f IndicesDiskUsage) WithPretty() func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.Pretty = true @@ -212,6 +222,7 @@ func (f IndicesDiskUsage) WithPretty() func(*IndicesDiskUsageRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesDiskUsage) WithHuman() func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.Human = true @@ -219,6 +230,7 @@ func (f IndicesDiskUsage) WithHuman() func(*IndicesDiskUsageRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDiskUsage) WithErrorTrace() func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.ErrorTrace = true @@ -226,6 +238,7 @@ func (f IndicesDiskUsage) WithErrorTrace() func(*IndicesDiskUsageRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesDiskUsage) WithFilterPath(v ...string) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.FilterPath = v @@ -233,6 +246,7 @@ func (f IndicesDiskUsage) WithFilterPath(v ...string) func(*IndicesDiskUsageRequ } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDiskUsage) WithHeader(h map[string]string) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { if r.Header == nil { @@ -245,6 +259,7 @@ func (f IndicesDiskUsage) WithHeader(h map[string]string) func(*IndicesDiskUsage } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDiskUsage) WithOpaqueID(s string) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists.go index e7e5d8ac9b1..d2abb2efd20 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesExistsFunc(t Transport) IndicesExists { // IndicesExists returns information about whether a particular index exists. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html. +// type IndicesExists func(index []string, o ...func(*IndicesExistsRequest)) (*Response, error) // IndicesExistsRequest configures the Indices Exists API request. +// type IndicesExistsRequest struct { Index []string @@ -66,6 +68,7 @@ type IndicesExistsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -169,6 +172,7 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f IndicesExists) WithContext(v context.Context) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.ctx = v @@ -176,6 +180,7 @@ func (f IndicesExists) WithContext(v context.Context) func(*IndicesExistsRequest } // WithAllowNoIndices - ignore if a wildcard expression resolves to no concrete indices (default: false). +// func (f IndicesExists) WithAllowNoIndices(v bool) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.AllowNoIndices = &v @@ -183,6 +188,7 @@ func (f IndicesExists) WithAllowNoIndices(v bool) func(*IndicesExistsRequest) { } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). +// func (f IndicesExists) WithExpandWildcards(v string) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.ExpandWildcards = v @@ -190,6 +196,7 @@ func (f IndicesExists) WithExpandWildcards(v string) func(*IndicesExistsRequest) } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesExists) WithFlatSettings(v bool) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.FlatSettings = &v @@ -197,6 +204,7 @@ func (f IndicesExists) WithFlatSettings(v bool) func(*IndicesExistsRequest) { } // WithIgnoreUnavailable - ignore unavailable indexes (default: false). +// func (f IndicesExists) WithIgnoreUnavailable(v bool) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.IgnoreUnavailable = &v @@ -204,6 +212,7 @@ func (f IndicesExists) WithIgnoreUnavailable(v bool) func(*IndicesExistsRequest) } // WithIncludeDefaults - whether to return all default setting for each of the indices.. +// func (f IndicesExists) WithIncludeDefaults(v bool) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.IncludeDefaults = &v @@ -211,6 +220,7 @@ func (f IndicesExists) WithIncludeDefaults(v bool) func(*IndicesExistsRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesExists) WithLocal(v bool) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.Local = &v @@ -218,6 +228,7 @@ func (f IndicesExists) WithLocal(v bool) func(*IndicesExistsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesExists) WithPretty() func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.Pretty = true @@ -225,6 +236,7 @@ func (f IndicesExists) WithPretty() func(*IndicesExistsRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesExists) WithHuman() func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.Human = true @@ -232,6 +244,7 @@ func (f IndicesExists) WithHuman() func(*IndicesExistsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesExists) WithErrorTrace() func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.ErrorTrace = true @@ -239,6 +252,7 @@ func (f IndicesExists) WithErrorTrace() func(*IndicesExistsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesExists) WithFilterPath(v ...string) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.FilterPath = v @@ -246,6 +260,7 @@ func (f IndicesExists) WithFilterPath(v ...string) func(*IndicesExistsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesExists) WithHeader(h map[string]string) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { if r.Header == nil { @@ -258,6 +273,7 @@ func (f IndicesExists) WithHeader(h map[string]string) func(*IndicesExistsReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesExists) WithOpaqueID(s string) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_alias.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_alias.go index 266711ce448..8013b3688b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesExistsAliasFunc(t Transport) IndicesExistsAlias { // IndicesExistsAlias returns information about whether a particular alias exists. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// type IndicesExistsAlias func(name []string, o ...func(*IndicesExistsAliasRequest)) (*Response, error) // IndicesExistsAliasRequest configures the Indices Exists Alias API request. +// type IndicesExistsAliasRequest struct { Index []string @@ -66,6 +68,7 @@ type IndicesExistsAliasRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesExistsAlias) WithContext(v context.Context) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f IndicesExistsAlias) WithContext(v context.Context) func(*IndicesExistsAl } // WithIndex - a list of index names to filter aliases. +// func (f IndicesExistsAlias) WithIndex(v ...string) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.Index = v @@ -181,6 +186,7 @@ func (f IndicesExistsAlias) WithIndex(v ...string) func(*IndicesExistsAliasReque } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesExistsAlias) WithAllowNoIndices(v bool) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.AllowNoIndices = &v @@ -188,6 +194,7 @@ func (f IndicesExistsAlias) WithAllowNoIndices(v bool) func(*IndicesExistsAliasR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesExistsAlias) WithExpandWildcards(v string) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.ExpandWildcards = v @@ -195,6 +202,7 @@ func (f IndicesExistsAlias) WithExpandWildcards(v string) func(*IndicesExistsAli } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesExistsAlias) WithIgnoreUnavailable(v bool) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.IgnoreUnavailable = &v @@ -202,6 +210,7 @@ func (f IndicesExistsAlias) WithIgnoreUnavailable(v bool) func(*IndicesExistsAli } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesExistsAlias) WithLocal(v bool) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.Local = &v @@ -209,6 +218,7 @@ func (f IndicesExistsAlias) WithLocal(v bool) func(*IndicesExistsAliasRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesExistsAlias) WithPretty() func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.Pretty = true @@ -216,6 +226,7 @@ func (f IndicesExistsAlias) WithPretty() func(*IndicesExistsAliasRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesExistsAlias) WithHuman() func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.Human = true @@ -223,6 +234,7 @@ func (f IndicesExistsAlias) WithHuman() func(*IndicesExistsAliasRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesExistsAlias) WithErrorTrace() func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.ErrorTrace = true @@ -230,6 +242,7 @@ func (f IndicesExistsAlias) WithErrorTrace() func(*IndicesExistsAliasRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesExistsAlias) WithFilterPath(v ...string) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.FilterPath = v @@ -237,6 +250,7 @@ func (f IndicesExistsAlias) WithFilterPath(v ...string) func(*IndicesExistsAlias } // WithHeader adds the headers to the HTTP request. +// func (f IndicesExistsAlias) WithHeader(h map[string]string) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { if r.Header == nil { @@ -249,6 +263,7 @@ func (f IndicesExistsAlias) WithHeader(h map[string]string) func(*IndicesExistsA } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesExistsAlias) WithOpaqueID(s string) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_index_template.go index d6ea3668dfc..70a894b7723 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesExistsIndexTemplateFunc(t Transport) IndicesExistsIndexTemplate { // IndicesExistsIndexTemplate returns information about whether a particular index template exists. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesExistsIndexTemplate func(name string, o ...func(*IndicesExistsIndexTemplateRequest)) (*Response, error) // IndicesExistsIndexTemplateRequest configures the Indices Exists Index Template API request. +// type IndicesExistsIndexTemplateRequest struct { Name string @@ -63,6 +65,7 @@ type IndicesExistsIndexTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f IndicesExistsIndexTemplate) WithContext(v context.Context) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f IndicesExistsIndexTemplate) WithContext(v context.Context) func(*Indices } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesExistsIndexTemplate) WithFlatSettings(v bool) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.FlatSettings = &v @@ -166,6 +171,7 @@ func (f IndicesExistsIndexTemplate) WithFlatSettings(v bool) func(*IndicesExists } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesExistsIndexTemplate) WithLocal(v bool) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.Local = &v @@ -173,6 +179,7 @@ func (f IndicesExistsIndexTemplate) WithLocal(v bool) func(*IndicesExistsIndexTe } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IndicesExistsIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.MasterTimeout = v @@ -180,6 +187,7 @@ func (f IndicesExistsIndexTemplate) WithMasterTimeout(v time.Duration) func(*Ind } // WithPretty makes the response body pretty-printed. +// func (f IndicesExistsIndexTemplate) WithPretty() func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f IndicesExistsIndexTemplate) WithPretty() func(*IndicesExistsIndexTemplat } // WithHuman makes statistical values human-readable. +// func (f IndicesExistsIndexTemplate) WithHuman() func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f IndicesExistsIndexTemplate) WithHuman() func(*IndicesExistsIndexTemplate } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesExistsIndexTemplate) WithErrorTrace() func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f IndicesExistsIndexTemplate) WithErrorTrace() func(*IndicesExistsIndexTem } // WithFilterPath filters the properties of the response body. +// func (f IndicesExistsIndexTemplate) WithFilterPath(v ...string) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f IndicesExistsIndexTemplate) WithFilterPath(v ...string) func(*IndicesExi } // WithHeader adds the headers to the HTTP request. +// func (f IndicesExistsIndexTemplate) WithHeader(h map[string]string) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f IndicesExistsIndexTemplate) WithHeader(h map[string]string) func(*Indice } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesExistsIndexTemplate) WithOpaqueID(s string) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_template.go index 4642459b7eb..39b65f65db1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { // IndicesExistsTemplate returns information about whether a particular index template exists. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateRequest)) (*Response, error) // IndicesExistsTemplateRequest configures the Indices Exists Template API request. +// type IndicesExistsTemplateRequest struct { Name []string @@ -64,6 +66,7 @@ type IndicesExistsTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -157,6 +160,7 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f IndicesExistsTemplate) WithContext(v context.Context) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.ctx = v @@ -164,6 +168,7 @@ func (f IndicesExistsTemplate) WithContext(v context.Context) func(*IndicesExist } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesExistsTemplate) WithFlatSettings(v bool) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.FlatSettings = &v @@ -171,6 +176,7 @@ func (f IndicesExistsTemplate) WithFlatSettings(v bool) func(*IndicesExistsTempl } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesExistsTemplate) WithLocal(v bool) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.Local = &v @@ -178,6 +184,7 @@ func (f IndicesExistsTemplate) WithLocal(v bool) func(*IndicesExistsTemplateRequ } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IndicesExistsTemplate) WithMasterTimeout(v time.Duration) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.MasterTimeout = v @@ -185,6 +192,7 @@ func (f IndicesExistsTemplate) WithMasterTimeout(v time.Duration) func(*IndicesE } // WithPretty makes the response body pretty-printed. +// func (f IndicesExistsTemplate) WithPretty() func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.Pretty = true @@ -192,6 +200,7 @@ func (f IndicesExistsTemplate) WithPretty() func(*IndicesExistsTemplateRequest) } // WithHuman makes statistical values human-readable. +// func (f IndicesExistsTemplate) WithHuman() func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.Human = true @@ -199,6 +208,7 @@ func (f IndicesExistsTemplate) WithHuman() func(*IndicesExistsTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesExistsTemplate) WithErrorTrace() func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.ErrorTrace = true @@ -206,6 +216,7 @@ func (f IndicesExistsTemplate) WithErrorTrace() func(*IndicesExistsTemplateReque } // WithFilterPath filters the properties of the response body. +// func (f IndicesExistsTemplate) WithFilterPath(v ...string) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.FilterPath = v @@ -213,6 +224,7 @@ func (f IndicesExistsTemplate) WithFilterPath(v ...string) func(*IndicesExistsTe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { if r.Header == nil { @@ -225,6 +237,7 @@ func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExis } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesExistsTemplate) WithOpaqueID(s string) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_type.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_type.go index 03e0141f061..a5a7bd584f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_type.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.exists_type.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesExistsDocumentTypeFunc(t Transport) IndicesExistsDocumentType { // IndicesExistsDocumentType returns information about whether a particular document type exists. (DEPRECATED) // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html. +// type IndicesExistsDocumentType func(index []string, o ...func(*IndicesExistsDocumentTypeRequest)) (*Response, error) // IndicesExistsDocumentTypeRequest configures the Indices Exists Document Type API request. +// type IndicesExistsDocumentTypeRequest struct { Index []string DocumentType []string @@ -65,6 +67,7 @@ type IndicesExistsDocumentTypeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesExistsDocumentTypeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r IndicesExistsDocumentTypeRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f IndicesExistsDocumentType) WithContext(v context.Context) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f IndicesExistsDocumentType) WithContext(v context.Context) func(*IndicesE } // WithDocumentType - a list of document types to check. +// func (f IndicesExistsDocumentType) WithDocumentType(v ...string) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.DocumentType = v @@ -181,6 +186,7 @@ func (f IndicesExistsDocumentType) WithDocumentType(v ...string) func(*IndicesEx } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesExistsDocumentType) WithAllowNoIndices(v bool) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.AllowNoIndices = &v @@ -188,6 +194,7 @@ func (f IndicesExistsDocumentType) WithAllowNoIndices(v bool) func(*IndicesExist } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesExistsDocumentType) WithExpandWildcards(v string) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.ExpandWildcards = v @@ -195,6 +202,7 @@ func (f IndicesExistsDocumentType) WithExpandWildcards(v string) func(*IndicesEx } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesExistsDocumentType) WithIgnoreUnavailable(v bool) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.IgnoreUnavailable = &v @@ -202,6 +210,7 @@ func (f IndicesExistsDocumentType) WithIgnoreUnavailable(v bool) func(*IndicesEx } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesExistsDocumentType) WithLocal(v bool) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.Local = &v @@ -209,6 +218,7 @@ func (f IndicesExistsDocumentType) WithLocal(v bool) func(*IndicesExistsDocument } // WithPretty makes the response body pretty-printed. +// func (f IndicesExistsDocumentType) WithPretty() func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.Pretty = true @@ -216,6 +226,7 @@ func (f IndicesExistsDocumentType) WithPretty() func(*IndicesExistsDocumentTypeR } // WithHuman makes statistical values human-readable. +// func (f IndicesExistsDocumentType) WithHuman() func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.Human = true @@ -223,6 +234,7 @@ func (f IndicesExistsDocumentType) WithHuman() func(*IndicesExistsDocumentTypeRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesExistsDocumentType) WithErrorTrace() func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.ErrorTrace = true @@ -230,6 +242,7 @@ func (f IndicesExistsDocumentType) WithErrorTrace() func(*IndicesExistsDocumentT } // WithFilterPath filters the properties of the response body. +// func (f IndicesExistsDocumentType) WithFilterPath(v ...string) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { r.FilterPath = v @@ -237,6 +250,7 @@ func (f IndicesExistsDocumentType) WithFilterPath(v ...string) func(*IndicesExis } // WithHeader adds the headers to the HTTP request. +// func (f IndicesExistsDocumentType) WithHeader(h map[string]string) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { if r.Header == nil { @@ -249,6 +263,7 @@ func (f IndicesExistsDocumentType) WithHeader(h map[string]string) func(*Indices } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesExistsDocumentType) WithOpaqueID(s string) func(*IndicesExistsDocumentTypeRequest) { return func(r *IndicesExistsDocumentTypeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.field_usage_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.field_usage_stats.go index 76366cb2abb..2314644c2e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.field_usage_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.field_usage_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesFieldUsageStatsFunc(t Transport) IndicesFieldUsageStats { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html. +// type IndicesFieldUsageStats func(index string, o ...func(*IndicesFieldUsageStatsRequest)) (*Response, error) // IndicesFieldUsageStatsRequest configures the Indices Field Usage Stats API request. +// type IndicesFieldUsageStatsRequest struct { Index string @@ -65,6 +67,7 @@ type IndicesFieldUsageStatsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesFieldUsageStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r IndicesFieldUsageStatsRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f IndicesFieldUsageStats) WithContext(v context.Context) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f IndicesFieldUsageStats) WithContext(v context.Context) func(*IndicesFiel } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesFieldUsageStats) WithAllowNoIndices(v bool) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.AllowNoIndices = &v @@ -172,6 +177,7 @@ func (f IndicesFieldUsageStats) WithAllowNoIndices(v bool) func(*IndicesFieldUsa } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesFieldUsageStats) WithExpandWildcards(v string) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.ExpandWildcards = v @@ -179,6 +185,7 @@ func (f IndicesFieldUsageStats) WithExpandWildcards(v string) func(*IndicesField } // WithFields - a list of fields to include in the stats if only a subset of fields should be returned (supports wildcards). +// func (f IndicesFieldUsageStats) WithFields(v ...string) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.Fields = v @@ -186,6 +193,7 @@ func (f IndicesFieldUsageStats) WithFields(v ...string) func(*IndicesFieldUsageS } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesFieldUsageStats) WithIgnoreUnavailable(v bool) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.IgnoreUnavailable = &v @@ -193,6 +201,7 @@ func (f IndicesFieldUsageStats) WithIgnoreUnavailable(v bool) func(*IndicesField } // WithPretty makes the response body pretty-printed. +// func (f IndicesFieldUsageStats) WithPretty() func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.Pretty = true @@ -200,6 +209,7 @@ func (f IndicesFieldUsageStats) WithPretty() func(*IndicesFieldUsageStatsRequest } // WithHuman makes statistical values human-readable. +// func (f IndicesFieldUsageStats) WithHuman() func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.Human = true @@ -207,6 +217,7 @@ func (f IndicesFieldUsageStats) WithHuman() func(*IndicesFieldUsageStatsRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesFieldUsageStats) WithErrorTrace() func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.ErrorTrace = true @@ -214,6 +225,7 @@ func (f IndicesFieldUsageStats) WithErrorTrace() func(*IndicesFieldUsageStatsReq } // WithFilterPath filters the properties of the response body. +// func (f IndicesFieldUsageStats) WithFilterPath(v ...string) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.FilterPath = v @@ -221,6 +233,7 @@ func (f IndicesFieldUsageStats) WithFilterPath(v ...string) func(*IndicesFieldUs } // WithHeader adds the headers to the HTTP request. +// func (f IndicesFieldUsageStats) WithHeader(h map[string]string) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { if r.Header == nil { @@ -233,6 +246,7 @@ func (f IndicesFieldUsageStats) WithHeader(h map[string]string) func(*IndicesFie } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesFieldUsageStats) WithOpaqueID(s string) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush.go index 89bae53ffcd..a5bf28fe9ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesFlushFunc(t Transport) IndicesFlush { // IndicesFlush performs the flush operation on one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html. +// type IndicesFlush func(o ...func(*IndicesFlushRequest)) (*Response, error) // IndicesFlushRequest configures the Indices Flush API request. +// type IndicesFlushRequest struct { Index []string @@ -64,6 +66,7 @@ type IndicesFlushRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -163,6 +166,7 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f IndicesFlush) WithContext(v context.Context) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.ctx = v @@ -170,6 +174,7 @@ func (f IndicesFlush) WithContext(v context.Context) func(*IndicesFlushRequest) } // WithIndex - a list of index names; use _all for all indices. +// func (f IndicesFlush) WithIndex(v ...string) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.Index = v @@ -177,6 +182,7 @@ func (f IndicesFlush) WithIndex(v ...string) func(*IndicesFlushRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesFlush) WithAllowNoIndices(v bool) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.AllowNoIndices = &v @@ -184,6 +190,7 @@ func (f IndicesFlush) WithAllowNoIndices(v bool) func(*IndicesFlushRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesFlush) WithExpandWildcards(v string) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.ExpandWildcards = v @@ -191,6 +198,7 @@ func (f IndicesFlush) WithExpandWildcards(v string) func(*IndicesFlushRequest) { } // WithForce - whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. this is useful if transaction log ids should be incremented even if no uncommitted changes are present. (this setting can be considered as internal). +// func (f IndicesFlush) WithForce(v bool) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.Force = &v @@ -198,6 +206,7 @@ func (f IndicesFlush) WithForce(v bool) func(*IndicesFlushRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesFlush) WithIgnoreUnavailable(v bool) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.IgnoreUnavailable = &v @@ -205,6 +214,7 @@ func (f IndicesFlush) WithIgnoreUnavailable(v bool) func(*IndicesFlushRequest) { } // WithWaitIfOngoing - if set to true the flush operation will block until the flush can be executed if another flush operation is already executing. the default is true. if set to false the flush will be skipped iff if another flush operation is already running.. +// func (f IndicesFlush) WithWaitIfOngoing(v bool) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.WaitIfOngoing = &v @@ -212,6 +222,7 @@ func (f IndicesFlush) WithWaitIfOngoing(v bool) func(*IndicesFlushRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesFlush) WithPretty() func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.Pretty = true @@ -219,6 +230,7 @@ func (f IndicesFlush) WithPretty() func(*IndicesFlushRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesFlush) WithHuman() func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.Human = true @@ -226,6 +238,7 @@ func (f IndicesFlush) WithHuman() func(*IndicesFlushRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesFlush) WithErrorTrace() func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.ErrorTrace = true @@ -233,6 +246,7 @@ func (f IndicesFlush) WithErrorTrace() func(*IndicesFlushRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesFlush) WithFilterPath(v ...string) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.FilterPath = v @@ -240,6 +254,7 @@ func (f IndicesFlush) WithFilterPath(v ...string) func(*IndicesFlushRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesFlush) WithHeader(h map[string]string) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { if r.Header == nil { @@ -252,6 +267,7 @@ func (f IndicesFlush) WithHeader(h map[string]string) func(*IndicesFlushRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesFlush) WithOpaqueID(s string) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush_synced.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush_synced.go index 0d1ff4a2ae7..465144a2be6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush_synced.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.flush_synced.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesFlushSyncedFunc(t Transport) IndicesFlushSynced { // IndicesFlushSynced performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html. +// type IndicesFlushSynced func(o ...func(*IndicesFlushSyncedRequest)) (*Response, error) // IndicesFlushSyncedRequest configures the Indices Flush Synced API request. +// type IndicesFlushSyncedRequest struct { Index []string @@ -62,6 +64,7 @@ type IndicesFlushSyncedRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesFlushSyncedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,7 @@ func (r IndicesFlushSyncedRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesFlushSynced) WithContext(v context.Context) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.ctx = v @@ -162,6 +166,7 @@ func (f IndicesFlushSynced) WithContext(v context.Context) func(*IndicesFlushSyn } // WithIndex - a list of index names; use _all for all indices. +// func (f IndicesFlushSynced) WithIndex(v ...string) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.Index = v @@ -169,6 +174,7 @@ func (f IndicesFlushSynced) WithIndex(v ...string) func(*IndicesFlushSyncedReque } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesFlushSynced) WithAllowNoIndices(v bool) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.AllowNoIndices = &v @@ -176,6 +182,7 @@ func (f IndicesFlushSynced) WithAllowNoIndices(v bool) func(*IndicesFlushSyncedR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesFlushSynced) WithExpandWildcards(v string) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.ExpandWildcards = v @@ -183,6 +190,7 @@ func (f IndicesFlushSynced) WithExpandWildcards(v string) func(*IndicesFlushSync } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesFlushSynced) WithIgnoreUnavailable(v bool) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.IgnoreUnavailable = &v @@ -190,6 +198,7 @@ func (f IndicesFlushSynced) WithIgnoreUnavailable(v bool) func(*IndicesFlushSync } // WithPretty makes the response body pretty-printed. +// func (f IndicesFlushSynced) WithPretty() func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.Pretty = true @@ -197,6 +206,7 @@ func (f IndicesFlushSynced) WithPretty() func(*IndicesFlushSyncedRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesFlushSynced) WithHuman() func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.Human = true @@ -204,6 +214,7 @@ func (f IndicesFlushSynced) WithHuman() func(*IndicesFlushSyncedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesFlushSynced) WithErrorTrace() func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.ErrorTrace = true @@ -211,6 +222,7 @@ func (f IndicesFlushSynced) WithErrorTrace() func(*IndicesFlushSyncedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesFlushSynced) WithFilterPath(v ...string) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { r.FilterPath = v @@ -218,6 +230,7 @@ func (f IndicesFlushSynced) WithFilterPath(v ...string) func(*IndicesFlushSynced } // WithHeader adds the headers to the HTTP request. +// func (f IndicesFlushSynced) WithHeader(h map[string]string) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { if r.Header == nil { @@ -230,6 +243,7 @@ func (f IndicesFlushSynced) WithHeader(h map[string]string) func(*IndicesFlushSy } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesFlushSynced) WithOpaqueID(s string) func(*IndicesFlushSyncedRequest) { return func(r *IndicesFlushSyncedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.forcemerge.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.forcemerge.go index 366b94e2612..4839172bc34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.forcemerge.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.forcemerge.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesForcemergeFunc(t Transport) IndicesForcemerge { // IndicesForcemerge performs the force merge operation on one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html. +// type IndicesForcemerge func(o ...func(*IndicesForcemergeRequest)) (*Response, error) // IndicesForcemergeRequest configures the Indices Forcemerge API request. +// type IndicesForcemergeRequest struct { Index []string @@ -65,6 +67,7 @@ type IndicesForcemergeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -168,6 +171,7 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IndicesForcemerge) WithContext(v context.Context) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.ctx = v @@ -175,6 +179,7 @@ func (f IndicesForcemerge) WithContext(v context.Context) func(*IndicesForcemerg } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesForcemerge) WithIndex(v ...string) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.Index = v @@ -182,6 +187,7 @@ func (f IndicesForcemerge) WithIndex(v ...string) func(*IndicesForcemergeRequest } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesForcemerge) WithAllowNoIndices(v bool) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.AllowNoIndices = &v @@ -189,6 +195,7 @@ func (f IndicesForcemerge) WithAllowNoIndices(v bool) func(*IndicesForcemergeReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesForcemerge) WithExpandWildcards(v string) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.ExpandWildcards = v @@ -196,6 +203,7 @@ func (f IndicesForcemerge) WithExpandWildcards(v string) func(*IndicesForcemerge } // WithFlush - specify whether the index should be flushed after performing the operation (default: true). +// func (f IndicesForcemerge) WithFlush(v bool) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.Flush = &v @@ -203,6 +211,7 @@ func (f IndicesForcemerge) WithFlush(v bool) func(*IndicesForcemergeRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesForcemerge) WithIgnoreUnavailable(v bool) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.IgnoreUnavailable = &v @@ -210,6 +219,7 @@ func (f IndicesForcemerge) WithIgnoreUnavailable(v bool) func(*IndicesForcemerge } // WithMaxNumSegments - the number of segments the index should be merged into (default: dynamic). +// func (f IndicesForcemerge) WithMaxNumSegments(v int) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.MaxNumSegments = &v @@ -217,6 +227,7 @@ func (f IndicesForcemerge) WithMaxNumSegments(v int) func(*IndicesForcemergeRequ } // WithOnlyExpungeDeletes - specify whether the operation should only expunge deleted documents. +// func (f IndicesForcemerge) WithOnlyExpungeDeletes(v bool) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.OnlyExpungeDeletes = &v @@ -224,6 +235,7 @@ func (f IndicesForcemerge) WithOnlyExpungeDeletes(v bool) func(*IndicesForcemerg } // WithPretty makes the response body pretty-printed. +// func (f IndicesForcemerge) WithPretty() func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.Pretty = true @@ -231,6 +243,7 @@ func (f IndicesForcemerge) WithPretty() func(*IndicesForcemergeRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesForcemerge) WithHuman() func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.Human = true @@ -238,6 +251,7 @@ func (f IndicesForcemerge) WithHuman() func(*IndicesForcemergeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesForcemerge) WithErrorTrace() func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.ErrorTrace = true @@ -245,6 +259,7 @@ func (f IndicesForcemerge) WithErrorTrace() func(*IndicesForcemergeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesForcemerge) WithFilterPath(v ...string) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.FilterPath = v @@ -252,6 +267,7 @@ func (f IndicesForcemerge) WithFilterPath(v ...string) func(*IndicesForcemergeRe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesForcemerge) WithHeader(h map[string]string) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { if r.Header == nil { @@ -264,6 +280,7 @@ func (f IndicesForcemerge) WithHeader(h map[string]string) func(*IndicesForcemer } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesForcemerge) WithOpaqueID(s string) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get.go index 19a37e7cfd1..5296dde7ff4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesGetFunc(t Transport) IndicesGet { // IndicesGet returns information about one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html. +// type IndicesGet func(index []string, o ...func(*IndicesGetRequest)) (*Response, error) // IndicesGetRequest configures the Indices Get API request. +// type IndicesGetRequest struct { Index []string @@ -69,6 +71,7 @@ type IndicesGetRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -180,6 +183,7 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f IndicesGet) WithContext(v context.Context) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.ctx = v @@ -187,6 +191,7 @@ func (f IndicesGet) WithContext(v context.Context) func(*IndicesGetRequest) { } // WithAllowNoIndices - ignore if a wildcard expression resolves to no concrete indices (default: false). +// func (f IndicesGet) WithAllowNoIndices(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.AllowNoIndices = &v @@ -194,6 +199,7 @@ func (f IndicesGet) WithAllowNoIndices(v bool) func(*IndicesGetRequest) { } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). +// func (f IndicesGet) WithExpandWildcards(v string) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.ExpandWildcards = v @@ -201,6 +207,7 @@ func (f IndicesGet) WithExpandWildcards(v string) func(*IndicesGetRequest) { } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesGet) WithFlatSettings(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.FlatSettings = &v @@ -208,6 +215,7 @@ func (f IndicesGet) WithFlatSettings(v bool) func(*IndicesGetRequest) { } // WithIgnoreUnavailable - ignore unavailable indexes (default: false). +// func (f IndicesGet) WithIgnoreUnavailable(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.IgnoreUnavailable = &v @@ -215,6 +223,7 @@ func (f IndicesGet) WithIgnoreUnavailable(v bool) func(*IndicesGetRequest) { } // WithIncludeDefaults - whether to return all default setting for each of the indices.. +// func (f IndicesGet) WithIncludeDefaults(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.IncludeDefaults = &v @@ -222,6 +231,7 @@ func (f IndicesGet) WithIncludeDefaults(v bool) func(*IndicesGetRequest) { } // WithIncludeTypeName - whether to add the type name to the response (default: false). +// func (f IndicesGet) WithIncludeTypeName(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.IncludeTypeName = &v @@ -229,6 +239,7 @@ func (f IndicesGet) WithIncludeTypeName(v bool) func(*IndicesGetRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGet) WithLocal(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.Local = &v @@ -236,6 +247,7 @@ func (f IndicesGet) WithLocal(v bool) func(*IndicesGetRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesGet) WithMasterTimeout(v time.Duration) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.MasterTimeout = v @@ -243,6 +255,7 @@ func (f IndicesGet) WithMasterTimeout(v time.Duration) func(*IndicesGetRequest) } // WithPretty makes the response body pretty-printed. +// func (f IndicesGet) WithPretty() func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.Pretty = true @@ -250,6 +263,7 @@ func (f IndicesGet) WithPretty() func(*IndicesGetRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGet) WithHuman() func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.Human = true @@ -257,6 +271,7 @@ func (f IndicesGet) WithHuman() func(*IndicesGetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGet) WithErrorTrace() func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.ErrorTrace = true @@ -264,6 +279,7 @@ func (f IndicesGet) WithErrorTrace() func(*IndicesGetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesGet) WithFilterPath(v ...string) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.FilterPath = v @@ -271,6 +287,7 @@ func (f IndicesGet) WithFilterPath(v ...string) func(*IndicesGetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGet) WithHeader(h map[string]string) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { if r.Header == nil { @@ -283,6 +300,7 @@ func (f IndicesGet) WithHeader(h map[string]string) func(*IndicesGetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGet) WithOpaqueID(s string) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_alias.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_alias.go index 92a51c17da9..feb2c27909b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesGetAliasFunc(t Transport) IndicesGetAlias { // IndicesGetAlias returns an alias. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// type IndicesGetAlias func(o ...func(*IndicesGetAliasRequest)) (*Response, error) // IndicesGetAliasRequest configures the Indices Get Alias API request. +// type IndicesGetAliasRequest struct { Index []string @@ -65,6 +67,7 @@ type IndicesGetAliasRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -164,6 +167,7 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesGetAlias) WithContext(v context.Context) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.ctx = v @@ -171,6 +175,7 @@ func (f IndicesGetAlias) WithContext(v context.Context) func(*IndicesGetAliasReq } // WithIndex - a list of index names to filter aliases. +// func (f IndicesGetAlias) WithIndex(v ...string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.Index = v @@ -178,6 +183,7 @@ func (f IndicesGetAlias) WithIndex(v ...string) func(*IndicesGetAliasRequest) { } // WithName - a list of alias names to return. +// func (f IndicesGetAlias) WithName(v ...string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.Name = v @@ -185,6 +191,7 @@ func (f IndicesGetAlias) WithName(v ...string) func(*IndicesGetAliasRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesGetAlias) WithAllowNoIndices(v bool) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.AllowNoIndices = &v @@ -192,6 +199,7 @@ func (f IndicesGetAlias) WithAllowNoIndices(v bool) func(*IndicesGetAliasRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesGetAlias) WithExpandWildcards(v string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.ExpandWildcards = v @@ -199,6 +207,7 @@ func (f IndicesGetAlias) WithExpandWildcards(v string) func(*IndicesGetAliasRequ } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesGetAlias) WithIgnoreUnavailable(v bool) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.IgnoreUnavailable = &v @@ -206,6 +215,7 @@ func (f IndicesGetAlias) WithIgnoreUnavailable(v bool) func(*IndicesGetAliasRequ } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGetAlias) WithLocal(v bool) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.Local = &v @@ -213,6 +223,7 @@ func (f IndicesGetAlias) WithLocal(v bool) func(*IndicesGetAliasRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetAlias) WithPretty() func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.Pretty = true @@ -220,6 +231,7 @@ func (f IndicesGetAlias) WithPretty() func(*IndicesGetAliasRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGetAlias) WithHuman() func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.Human = true @@ -227,6 +239,7 @@ func (f IndicesGetAlias) WithHuman() func(*IndicesGetAliasRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetAlias) WithErrorTrace() func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.ErrorTrace = true @@ -234,6 +247,7 @@ func (f IndicesGetAlias) WithErrorTrace() func(*IndicesGetAliasRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetAlias) WithFilterPath(v ...string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.FilterPath = v @@ -241,6 +255,7 @@ func (f IndicesGetAlias) WithFilterPath(v ...string) func(*IndicesGetAliasReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetAlias) WithHeader(h map[string]string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { if r.Header == nil { @@ -253,6 +268,7 @@ func (f IndicesGetAlias) WithHeader(h map[string]string) func(*IndicesGetAliasRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetAlias) WithOpaqueID(s string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_field_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_field_mapping.go index 7d21f3d2f20..f057001cc59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_field_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_field_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesGetFieldMappingFunc(t Transport) IndicesGetFieldMapping { // IndicesGetFieldMapping returns mapping for one or more fields. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html. +// type IndicesGetFieldMapping func(fields []string, o ...func(*IndicesGetFieldMappingRequest)) (*Response, error) // IndicesGetFieldMappingRequest configures the Indices Get Field Mapping API request. +// type IndicesGetFieldMappingRequest struct { Index []string DocumentType []string @@ -69,6 +71,7 @@ type IndicesGetFieldMappingRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -184,6 +187,7 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f IndicesGetFieldMapping) WithContext(v context.Context) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.ctx = v @@ -191,6 +195,7 @@ func (f IndicesGetFieldMapping) WithContext(v context.Context) func(*IndicesGetF } // WithIndex - a list of index names. +// func (f IndicesGetFieldMapping) WithIndex(v ...string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.Index = v @@ -198,6 +203,7 @@ func (f IndicesGetFieldMapping) WithIndex(v ...string) func(*IndicesGetFieldMapp } // WithDocumentType - a list of document types. +// func (f IndicesGetFieldMapping) WithDocumentType(v ...string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.DocumentType = v @@ -205,6 +211,7 @@ func (f IndicesGetFieldMapping) WithDocumentType(v ...string) func(*IndicesGetFi } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesGetFieldMapping) WithAllowNoIndices(v bool) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.AllowNoIndices = &v @@ -212,6 +219,7 @@ func (f IndicesGetFieldMapping) WithAllowNoIndices(v bool) func(*IndicesGetField } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesGetFieldMapping) WithExpandWildcards(v string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.ExpandWildcards = v @@ -219,6 +227,7 @@ func (f IndicesGetFieldMapping) WithExpandWildcards(v string) func(*IndicesGetFi } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesGetFieldMapping) WithIgnoreUnavailable(v bool) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.IgnoreUnavailable = &v @@ -226,6 +235,7 @@ func (f IndicesGetFieldMapping) WithIgnoreUnavailable(v bool) func(*IndicesGetFi } // WithIncludeDefaults - whether the default mapping values should be returned as well. +// func (f IndicesGetFieldMapping) WithIncludeDefaults(v bool) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.IncludeDefaults = &v @@ -233,6 +243,7 @@ func (f IndicesGetFieldMapping) WithIncludeDefaults(v bool) func(*IndicesGetFiel } // WithIncludeTypeName - whether a type should be returned in the body of the mappings.. +// func (f IndicesGetFieldMapping) WithIncludeTypeName(v bool) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.IncludeTypeName = &v @@ -240,6 +251,7 @@ func (f IndicesGetFieldMapping) WithIncludeTypeName(v bool) func(*IndicesGetFiel } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGetFieldMapping) WithLocal(v bool) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.Local = &v @@ -247,6 +259,7 @@ func (f IndicesGetFieldMapping) WithLocal(v bool) func(*IndicesGetFieldMappingRe } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetFieldMapping) WithPretty() func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.Pretty = true @@ -254,6 +267,7 @@ func (f IndicesGetFieldMapping) WithPretty() func(*IndicesGetFieldMappingRequest } // WithHuman makes statistical values human-readable. +// func (f IndicesGetFieldMapping) WithHuman() func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.Human = true @@ -261,6 +275,7 @@ func (f IndicesGetFieldMapping) WithHuman() func(*IndicesGetFieldMappingRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetFieldMapping) WithErrorTrace() func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.ErrorTrace = true @@ -268,6 +283,7 @@ func (f IndicesGetFieldMapping) WithErrorTrace() func(*IndicesGetFieldMappingReq } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetFieldMapping) WithFilterPath(v ...string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.FilterPath = v @@ -275,6 +291,7 @@ func (f IndicesGetFieldMapping) WithFilterPath(v ...string) func(*IndicesGetFiel } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetFieldMapping) WithHeader(h map[string]string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { if r.Header == nil { @@ -287,6 +304,7 @@ func (f IndicesGetFieldMapping) WithHeader(h map[string]string) func(*IndicesGet } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetFieldMapping) WithOpaqueID(s string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_index_template.go index 74f24b141ad..42f016853d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesGetIndexTemplateFunc(t Transport) IndicesGetIndexTemplate { // IndicesGetIndexTemplate returns an index template. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesGetIndexTemplate func(o ...func(*IndicesGetIndexTemplateRequest)) (*Response, error) // IndicesGetIndexTemplateRequest configures the Indices Get Index Template API request. +// type IndicesGetIndexTemplateRequest struct { Name string @@ -63,6 +65,7 @@ type IndicesGetIndexTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -154,6 +157,7 @@ func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesGetIndexTemplate) WithContext(v context.Context) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f IndicesGetIndexTemplate) WithContext(v context.Context) func(*IndicesGet } // WithName - a pattern that returned template names must match. +// func (f IndicesGetIndexTemplate) WithName(v string) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.Name = v @@ -168,6 +173,7 @@ func (f IndicesGetIndexTemplate) WithName(v string) func(*IndicesGetIndexTemplat } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesGetIndexTemplate) WithFlatSettings(v bool) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.FlatSettings = &v @@ -175,6 +181,7 @@ func (f IndicesGetIndexTemplate) WithFlatSettings(v bool) func(*IndicesGetIndexT } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGetIndexTemplate) WithLocal(v bool) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.Local = &v @@ -182,6 +189,7 @@ func (f IndicesGetIndexTemplate) WithLocal(v bool) func(*IndicesGetIndexTemplate } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IndicesGetIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.MasterTimeout = v @@ -189,6 +197,7 @@ func (f IndicesGetIndexTemplate) WithMasterTimeout(v time.Duration) func(*Indice } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetIndexTemplate) WithPretty() func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.Pretty = true @@ -196,6 +205,7 @@ func (f IndicesGetIndexTemplate) WithPretty() func(*IndicesGetIndexTemplateReque } // WithHuman makes statistical values human-readable. +// func (f IndicesGetIndexTemplate) WithHuman() func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.Human = true @@ -203,6 +213,7 @@ func (f IndicesGetIndexTemplate) WithHuman() func(*IndicesGetIndexTemplateReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetIndexTemplate) WithErrorTrace() func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.ErrorTrace = true @@ -210,6 +221,7 @@ func (f IndicesGetIndexTemplate) WithErrorTrace() func(*IndicesGetIndexTemplateR } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetIndexTemplate) WithFilterPath(v ...string) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { r.FilterPath = v @@ -217,6 +229,7 @@ func (f IndicesGetIndexTemplate) WithFilterPath(v ...string) func(*IndicesGetInd } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetIndexTemplate) WithHeader(h map[string]string) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { if r.Header == nil { @@ -229,6 +242,7 @@ func (f IndicesGetIndexTemplate) WithHeader(h map[string]string) func(*IndicesGe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetIndexTemplate) WithOpaqueID(s string) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_mapping.go index c94bb51c49a..68fa5454512 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesGetMappingFunc(t Transport) IndicesGetMapping { // IndicesGetMapping returns mappings for one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html. +// type IndicesGetMapping func(o ...func(*IndicesGetMappingRequest)) (*Response, error) // IndicesGetMappingRequest configures the Indices Get Mapping API request. +// type IndicesGetMappingRequest struct { Index []string DocumentType []string @@ -67,6 +69,7 @@ type IndicesGetMappingRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -174,6 +177,7 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IndicesGetMapping) WithContext(v context.Context) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.ctx = v @@ -181,6 +185,7 @@ func (f IndicesGetMapping) WithContext(v context.Context) func(*IndicesGetMappin } // WithIndex - a list of index names. +// func (f IndicesGetMapping) WithIndex(v ...string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.Index = v @@ -188,6 +193,7 @@ func (f IndicesGetMapping) WithIndex(v ...string) func(*IndicesGetMappingRequest } // WithDocumentType - a list of document types. +// func (f IndicesGetMapping) WithDocumentType(v ...string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.DocumentType = v @@ -195,6 +201,7 @@ func (f IndicesGetMapping) WithDocumentType(v ...string) func(*IndicesGetMapping } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesGetMapping) WithAllowNoIndices(v bool) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.AllowNoIndices = &v @@ -202,6 +209,7 @@ func (f IndicesGetMapping) WithAllowNoIndices(v bool) func(*IndicesGetMappingReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesGetMapping) WithExpandWildcards(v string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.ExpandWildcards = v @@ -209,6 +217,7 @@ func (f IndicesGetMapping) WithExpandWildcards(v string) func(*IndicesGetMapping } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesGetMapping) WithIgnoreUnavailable(v bool) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.IgnoreUnavailable = &v @@ -216,6 +225,7 @@ func (f IndicesGetMapping) WithIgnoreUnavailable(v bool) func(*IndicesGetMapping } // WithIncludeTypeName - whether to add the type name to the response (default: false). +// func (f IndicesGetMapping) WithIncludeTypeName(v bool) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.IncludeTypeName = &v @@ -223,6 +233,7 @@ func (f IndicesGetMapping) WithIncludeTypeName(v bool) func(*IndicesGetMappingRe } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGetMapping) WithLocal(v bool) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.Local = &v @@ -230,6 +241,7 @@ func (f IndicesGetMapping) WithLocal(v bool) func(*IndicesGetMappingRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesGetMapping) WithMasterTimeout(v time.Duration) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.MasterTimeout = v @@ -237,6 +249,7 @@ func (f IndicesGetMapping) WithMasterTimeout(v time.Duration) func(*IndicesGetMa } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetMapping) WithPretty() func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.Pretty = true @@ -244,6 +257,7 @@ func (f IndicesGetMapping) WithPretty() func(*IndicesGetMappingRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGetMapping) WithHuman() func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.Human = true @@ -251,6 +265,7 @@ func (f IndicesGetMapping) WithHuman() func(*IndicesGetMappingRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetMapping) WithErrorTrace() func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.ErrorTrace = true @@ -258,6 +273,7 @@ func (f IndicesGetMapping) WithErrorTrace() func(*IndicesGetMappingRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetMapping) WithFilterPath(v ...string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.FilterPath = v @@ -265,6 +281,7 @@ func (f IndicesGetMapping) WithFilterPath(v ...string) func(*IndicesGetMappingRe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetMapping) WithHeader(h map[string]string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { if r.Header == nil { @@ -277,6 +294,7 @@ func (f IndicesGetMapping) WithHeader(h map[string]string) func(*IndicesGetMappi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetMapping) WithOpaqueID(s string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_settings.go index ad41d8ef753..b6f7b468965 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesGetSettingsFunc(t Transport) IndicesGetSettings { // IndicesGetSettings returns settings for one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html. +// type IndicesGetSettings func(o ...func(*IndicesGetSettingsRequest)) (*Response, error) // IndicesGetSettingsRequest configures the Indices Get Settings API request. +// type IndicesGetSettingsRequest struct { Index []string @@ -69,6 +71,7 @@ type IndicesGetSettingsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -180,6 +183,7 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesGetSettings) WithContext(v context.Context) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.ctx = v @@ -187,6 +191,7 @@ func (f IndicesGetSettings) WithContext(v context.Context) func(*IndicesGetSetti } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesGetSettings) WithIndex(v ...string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.Index = v @@ -194,6 +199,7 @@ func (f IndicesGetSettings) WithIndex(v ...string) func(*IndicesGetSettingsReque } // WithName - the name of the settings that should be included. +// func (f IndicesGetSettings) WithName(v ...string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.Name = v @@ -201,6 +207,7 @@ func (f IndicesGetSettings) WithName(v ...string) func(*IndicesGetSettingsReques } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesGetSettings) WithAllowNoIndices(v bool) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.AllowNoIndices = &v @@ -208,6 +215,7 @@ func (f IndicesGetSettings) WithAllowNoIndices(v bool) func(*IndicesGetSettingsR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesGetSettings) WithExpandWildcards(v string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.ExpandWildcards = v @@ -215,6 +223,7 @@ func (f IndicesGetSettings) WithExpandWildcards(v string) func(*IndicesGetSettin } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesGetSettings) WithFlatSettings(v bool) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.FlatSettings = &v @@ -222,6 +231,7 @@ func (f IndicesGetSettings) WithFlatSettings(v bool) func(*IndicesGetSettingsReq } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesGetSettings) WithIgnoreUnavailable(v bool) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.IgnoreUnavailable = &v @@ -229,6 +239,7 @@ func (f IndicesGetSettings) WithIgnoreUnavailable(v bool) func(*IndicesGetSettin } // WithIncludeDefaults - whether to return all default setting for each of the indices.. +// func (f IndicesGetSettings) WithIncludeDefaults(v bool) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.IncludeDefaults = &v @@ -236,6 +247,7 @@ func (f IndicesGetSettings) WithIncludeDefaults(v bool) func(*IndicesGetSettings } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGetSettings) WithLocal(v bool) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.Local = &v @@ -243,6 +255,7 @@ func (f IndicesGetSettings) WithLocal(v bool) func(*IndicesGetSettingsRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesGetSettings) WithMasterTimeout(v time.Duration) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.MasterTimeout = v @@ -250,6 +263,7 @@ func (f IndicesGetSettings) WithMasterTimeout(v time.Duration) func(*IndicesGetS } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetSettings) WithPretty() func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.Pretty = true @@ -257,6 +271,7 @@ func (f IndicesGetSettings) WithPretty() func(*IndicesGetSettingsRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGetSettings) WithHuman() func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.Human = true @@ -264,6 +279,7 @@ func (f IndicesGetSettings) WithHuman() func(*IndicesGetSettingsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetSettings) WithErrorTrace() func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.ErrorTrace = true @@ -271,6 +287,7 @@ func (f IndicesGetSettings) WithErrorTrace() func(*IndicesGetSettingsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetSettings) WithFilterPath(v ...string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.FilterPath = v @@ -278,6 +295,7 @@ func (f IndicesGetSettings) WithFilterPath(v ...string) func(*IndicesGetSettings } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetSettings) WithHeader(h map[string]string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { if r.Header == nil { @@ -290,6 +308,7 @@ func (f IndicesGetSettings) WithHeader(h map[string]string) func(*IndicesGetSett } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetSettings) WithOpaqueID(s string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_template.go index dcf6fcd2bc7..11e90e5e2b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { // IndicesGetTemplate returns an index template. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, error) // IndicesGetTemplateRequest configures the Indices Get Template API request. +// type IndicesGetTemplateRequest struct { Name []string @@ -64,6 +66,7 @@ type IndicesGetTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -159,6 +162,7 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesGetTemplate) WithContext(v context.Context) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.ctx = v @@ -166,6 +170,7 @@ func (f IndicesGetTemplate) WithContext(v context.Context) func(*IndicesGetTempl } // WithName - the comma separated names of the index templates. +// func (f IndicesGetTemplate) WithName(v ...string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Name = v @@ -173,6 +178,7 @@ func (f IndicesGetTemplate) WithName(v ...string) func(*IndicesGetTemplateReques } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesGetTemplate) WithFlatSettings(v bool) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.FlatSettings = &v @@ -180,6 +186,7 @@ func (f IndicesGetTemplate) WithFlatSettings(v bool) func(*IndicesGetTemplateReq } // WithIncludeTypeName - whether a type should be returned in the body of the mappings.. +// func (f IndicesGetTemplate) WithIncludeTypeName(v bool) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.IncludeTypeName = &v @@ -187,6 +194,7 @@ func (f IndicesGetTemplate) WithIncludeTypeName(v bool) func(*IndicesGetTemplate } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f IndicesGetTemplate) WithLocal(v bool) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Local = &v @@ -194,6 +202,7 @@ func (f IndicesGetTemplate) WithLocal(v bool) func(*IndicesGetTemplateRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IndicesGetTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.MasterTimeout = v @@ -201,6 +210,7 @@ func (f IndicesGetTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetT } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetTemplate) WithPretty() func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Pretty = true @@ -208,6 +218,7 @@ func (f IndicesGetTemplate) WithPretty() func(*IndicesGetTemplateRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGetTemplate) WithHuman() func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Human = true @@ -215,6 +226,7 @@ func (f IndicesGetTemplate) WithHuman() func(*IndicesGetTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetTemplate) WithErrorTrace() func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.ErrorTrace = true @@ -222,6 +234,7 @@ func (f IndicesGetTemplate) WithErrorTrace() func(*IndicesGetTemplateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetTemplate) WithFilterPath(v ...string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.FilterPath = v @@ -229,6 +242,7 @@ func (f IndicesGetTemplate) WithFilterPath(v ...string) func(*IndicesGetTemplate } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { if r.Header == nil { @@ -241,6 +255,7 @@ func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemp } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetTemplate) WithOpaqueID(s string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_upgrade.go index cbcfc241e59..c0554bc258b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.get_upgrade.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesGetUpgradeFunc(t Transport) IndicesGetUpgrade { // IndicesGetUpgrade deprecated Returns a progress status of current upgrade. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html. +// type IndicesGetUpgrade func(o ...func(*IndicesGetUpgradeRequest)) (*Response, error) // IndicesGetUpgradeRequest configures the Indices Get Upgrade API request. +// type IndicesGetUpgradeRequest struct { Index []string @@ -62,6 +64,7 @@ type IndicesGetUpgradeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetUpgradeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -153,6 +156,7 @@ func (r IndicesGetUpgradeRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IndicesGetUpgrade) WithContext(v context.Context) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f IndicesGetUpgrade) WithContext(v context.Context) func(*IndicesGetUpgrad } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesGetUpgrade) WithIndex(v ...string) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.Index = v @@ -167,6 +172,7 @@ func (f IndicesGetUpgrade) WithIndex(v ...string) func(*IndicesGetUpgradeRequest } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesGetUpgrade) WithAllowNoIndices(v bool) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.AllowNoIndices = &v @@ -174,6 +180,7 @@ func (f IndicesGetUpgrade) WithAllowNoIndices(v bool) func(*IndicesGetUpgradeReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesGetUpgrade) WithExpandWildcards(v string) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.ExpandWildcards = v @@ -181,6 +188,7 @@ func (f IndicesGetUpgrade) WithExpandWildcards(v string) func(*IndicesGetUpgrade } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesGetUpgrade) WithIgnoreUnavailable(v bool) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.IgnoreUnavailable = &v @@ -188,6 +196,7 @@ func (f IndicesGetUpgrade) WithIgnoreUnavailable(v bool) func(*IndicesGetUpgrade } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetUpgrade) WithPretty() func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.Pretty = true @@ -195,6 +204,7 @@ func (f IndicesGetUpgrade) WithPretty() func(*IndicesGetUpgradeRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGetUpgrade) WithHuman() func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.Human = true @@ -202,6 +212,7 @@ func (f IndicesGetUpgrade) WithHuman() func(*IndicesGetUpgradeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetUpgrade) WithErrorTrace() func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.ErrorTrace = true @@ -209,6 +220,7 @@ func (f IndicesGetUpgrade) WithErrorTrace() func(*IndicesGetUpgradeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetUpgrade) WithFilterPath(v ...string) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { r.FilterPath = v @@ -216,6 +228,7 @@ func (f IndicesGetUpgrade) WithFilterPath(v ...string) func(*IndicesGetUpgradeRe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetUpgrade) WithHeader(h map[string]string) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { if r.Header == nil { @@ -228,6 +241,7 @@ func (f IndicesGetUpgrade) WithHeader(h map[string]string) func(*IndicesGetUpgra } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetUpgrade) WithOpaqueID(s string) func(*IndicesGetUpgradeRequest) { return func(r *IndicesGetUpgradeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.modify_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.modify_data_stream.go index 600219be896..5a811c598d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.modify_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.modify_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesModifyDataStreamFunc(t Transport) IndicesModifyDataStream { // IndicesModifyDataStream modifies a data stream // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesModifyDataStream func(body io.Reader, o ...func(*IndicesModifyDataStreamRequest)) (*Response, error) // IndicesModifyDataStreamRequest configures the Indices Modify Data Stream API request. +// type IndicesModifyDataStreamRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type IndicesModifyDataStreamRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transp 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 @@ -113,10 +120,6 @@ func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesModifyDataStream) WithContext(v context.Context) func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f IndicesModifyDataStream) WithContext(v context.Context) func(*IndicesMod } // WithPretty makes the response body pretty-printed. +// func (f IndicesModifyDataStream) WithPretty() func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f IndicesModifyDataStream) WithPretty() func(*IndicesModifyDataStreamReque } // WithHuman makes statistical values human-readable. +// func (f IndicesModifyDataStream) WithHuman() func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f IndicesModifyDataStream) WithHuman() func(*IndicesModifyDataStreamReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesModifyDataStream) WithErrorTrace() func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f IndicesModifyDataStream) WithErrorTrace() func(*IndicesModifyDataStreamR } // WithFilterPath filters the properties of the response body. +// func (f IndicesModifyDataStream) WithFilterPath(v ...string) func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f IndicesModifyDataStream) WithFilterPath(v ...string) func(*IndicesModify } // WithHeader adds the headers to the HTTP request. +// func (f IndicesModifyDataStream) WithHeader(h map[string]string) func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f IndicesModifyDataStream) WithHeader(h map[string]string) func(*IndicesMo } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesModifyDataStream) WithOpaqueID(s string) func(*IndicesModifyDataStreamRequest) { return func(r *IndicesModifyDataStreamRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.open.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.open.go index 223c0ad988e..f7a17f59c96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.open.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.open.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesOpenFunc(t Transport) IndicesOpen { // IndicesOpen opens an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. +// type IndicesOpen func(index []string, o ...func(*IndicesOpenRequest)) (*Response, error) // IndicesOpenRequest configures the Indices Open API request. +// type IndicesOpenRequest struct { Index []string @@ -67,6 +69,7 @@ type IndicesOpenRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -172,6 +175,7 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f IndicesOpen) WithContext(v context.Context) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.ctx = v @@ -179,6 +183,7 @@ func (f IndicesOpen) WithContext(v context.Context) func(*IndicesOpenRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesOpen) WithAllowNoIndices(v bool) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.AllowNoIndices = &v @@ -186,6 +191,7 @@ func (f IndicesOpen) WithAllowNoIndices(v bool) func(*IndicesOpenRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesOpen) WithExpandWildcards(v string) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.ExpandWildcards = v @@ -193,6 +199,7 @@ func (f IndicesOpen) WithExpandWildcards(v string) func(*IndicesOpenRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesOpen) WithIgnoreUnavailable(v bool) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.IgnoreUnavailable = &v @@ -200,6 +207,7 @@ func (f IndicesOpen) WithIgnoreUnavailable(v bool) func(*IndicesOpenRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesOpen) WithMasterTimeout(v time.Duration) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.MasterTimeout = v @@ -207,6 +215,7 @@ func (f IndicesOpen) WithMasterTimeout(v time.Duration) func(*IndicesOpenRequest } // WithTimeout - explicit operation timeout. +// func (f IndicesOpen) WithTimeout(v time.Duration) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.Timeout = v @@ -214,6 +223,7 @@ func (f IndicesOpen) WithTimeout(v time.Duration) func(*IndicesOpenRequest) { } // WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns.. +// func (f IndicesOpen) WithWaitForActiveShards(v string) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.WaitForActiveShards = v @@ -221,6 +231,7 @@ func (f IndicesOpen) WithWaitForActiveShards(v string) func(*IndicesOpenRequest) } // WithPretty makes the response body pretty-printed. +// func (f IndicesOpen) WithPretty() func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.Pretty = true @@ -228,6 +239,7 @@ func (f IndicesOpen) WithPretty() func(*IndicesOpenRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesOpen) WithHuman() func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.Human = true @@ -235,6 +247,7 @@ func (f IndicesOpen) WithHuman() func(*IndicesOpenRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesOpen) WithErrorTrace() func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.ErrorTrace = true @@ -242,6 +255,7 @@ func (f IndicesOpen) WithErrorTrace() func(*IndicesOpenRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesOpen) WithFilterPath(v ...string) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.FilterPath = v @@ -249,6 +263,7 @@ func (f IndicesOpen) WithFilterPath(v ...string) func(*IndicesOpenRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesOpen) WithHeader(h map[string]string) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { if r.Header == nil { @@ -261,6 +276,7 @@ func (f IndicesOpen) WithHeader(h map[string]string) func(*IndicesOpenRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesOpen) WithOpaqueID(s string) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_alias.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_alias.go index 171acbf3f17..4948d455875 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesPutAliasFunc(t Transport) IndicesPutAlias { // IndicesPutAlias creates or updates an alias. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// type IndicesPutAlias func(index []string, name string, o ...func(*IndicesPutAliasRequest)) (*Response, error) // IndicesPutAliasRequest configures the Indices Put Alias API request. +// type IndicesPutAliasRequest struct { Index []string @@ -67,6 +69,7 @@ type IndicesPutAliasRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -127,6 +130,10 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -139,10 +146,6 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -162,6 +165,7 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesPutAlias) WithContext(v context.Context) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f IndicesPutAlias) WithContext(v context.Context) func(*IndicesPutAliasReq } // WithBody - The settings for the alias, such as `routing` or `filter`. +// func (f IndicesPutAlias) WithBody(v io.Reader) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.Body = v @@ -176,6 +181,7 @@ func (f IndicesPutAlias) WithBody(v io.Reader) func(*IndicesPutAliasRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesPutAlias) WithMasterTimeout(v time.Duration) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.MasterTimeout = v @@ -183,6 +189,7 @@ func (f IndicesPutAlias) WithMasterTimeout(v time.Duration) func(*IndicesPutAlia } // WithTimeout - explicit timestamp for the document. +// func (f IndicesPutAlias) WithTimeout(v time.Duration) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.Timeout = v @@ -190,6 +197,7 @@ func (f IndicesPutAlias) WithTimeout(v time.Duration) func(*IndicesPutAliasReque } // WithPretty makes the response body pretty-printed. +// func (f IndicesPutAlias) WithPretty() func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.Pretty = true @@ -197,6 +205,7 @@ func (f IndicesPutAlias) WithPretty() func(*IndicesPutAliasRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesPutAlias) WithHuman() func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.Human = true @@ -204,6 +213,7 @@ func (f IndicesPutAlias) WithHuman() func(*IndicesPutAliasRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesPutAlias) WithErrorTrace() func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.ErrorTrace = true @@ -211,6 +221,7 @@ func (f IndicesPutAlias) WithErrorTrace() func(*IndicesPutAliasRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesPutAlias) WithFilterPath(v ...string) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { r.FilterPath = v @@ -218,6 +229,7 @@ func (f IndicesPutAlias) WithFilterPath(v ...string) func(*IndicesPutAliasReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesPutAlias) WithHeader(h map[string]string) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { if r.Header == nil { @@ -230,6 +242,7 @@ func (f IndicesPutAlias) WithHeader(h map[string]string) func(*IndicesPutAliasRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesPutAlias) WithOpaqueID(s string) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_index_template.go index d3773acda12..d09d7d93288 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesPutIndexTemplateFunc(t Transport) IndicesPutIndexTemplate { // IndicesPutIndexTemplate creates or updates an index template. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesPutIndexTemplate func(name string, body io.Reader, o ...func(*IndicesPutIndexTemplateRequest)) (*Response, error) // IndicesPutIndexTemplateRequest configures the Indices Put Index Template API request. +// type IndicesPutIndexTemplateRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type IndicesPutIndexTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -124,6 +127,10 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp 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 @@ -136,10 +143,6 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -159,6 +162,7 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesPutIndexTemplate) WithContext(v context.Context) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.ctx = v @@ -166,6 +170,7 @@ func (f IndicesPutIndexTemplate) WithContext(v context.Context) func(*IndicesPut } // WithCause - user defined reason for creating/updating the index template. +// func (f IndicesPutIndexTemplate) WithCause(v string) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.Cause = v @@ -173,6 +178,7 @@ func (f IndicesPutIndexTemplate) WithCause(v string) func(*IndicesPutIndexTempla } // WithCreate - whether the index template should only be added if new or can also replace an existing one. +// func (f IndicesPutIndexTemplate) WithCreate(v bool) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.Create = &v @@ -180,6 +186,7 @@ func (f IndicesPutIndexTemplate) WithCreate(v bool) func(*IndicesPutIndexTemplat } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesPutIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.MasterTimeout = v @@ -187,6 +194,7 @@ func (f IndicesPutIndexTemplate) WithMasterTimeout(v time.Duration) func(*Indice } // WithPretty makes the response body pretty-printed. +// func (f IndicesPutIndexTemplate) WithPretty() func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.Pretty = true @@ -194,6 +202,7 @@ func (f IndicesPutIndexTemplate) WithPretty() func(*IndicesPutIndexTemplateReque } // WithHuman makes statistical values human-readable. +// func (f IndicesPutIndexTemplate) WithHuman() func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.Human = true @@ -201,6 +210,7 @@ func (f IndicesPutIndexTemplate) WithHuman() func(*IndicesPutIndexTemplateReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesPutIndexTemplate) WithErrorTrace() func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.ErrorTrace = true @@ -208,6 +218,7 @@ func (f IndicesPutIndexTemplate) WithErrorTrace() func(*IndicesPutIndexTemplateR } // WithFilterPath filters the properties of the response body. +// func (f IndicesPutIndexTemplate) WithFilterPath(v ...string) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { r.FilterPath = v @@ -215,6 +226,7 @@ func (f IndicesPutIndexTemplate) WithFilterPath(v ...string) func(*IndicesPutInd } // WithHeader adds the headers to the HTTP request. +// func (f IndicesPutIndexTemplate) WithHeader(h map[string]string) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { if r.Header == nil { @@ -227,6 +239,7 @@ func (f IndicesPutIndexTemplate) WithHeader(h map[string]string) func(*IndicesPu } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesPutIndexTemplate) WithOpaqueID(s string) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_mapping.go index 2980406a664..697ceba2a81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesPutMappingFunc(t Transport) IndicesPutMapping { // IndicesPutMapping updates the index mappings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html. +// type IndicesPutMapping func(body io.Reader, o ...func(*IndicesPutMappingRequest)) (*Response, error) // IndicesPutMappingRequest configures the Indices Put Mapping API request. +// type IndicesPutMappingRequest struct { Index []string DocumentType string @@ -71,6 +73,7 @@ type IndicesPutMappingRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -151,6 +154,10 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( 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 @@ -163,10 +170,6 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -186,6 +189,7 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IndicesPutMapping) WithContext(v context.Context) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.ctx = v @@ -193,6 +197,7 @@ func (f IndicesPutMapping) WithContext(v context.Context) func(*IndicesPutMappin } // WithIndex - a list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.. +// func (f IndicesPutMapping) WithIndex(v ...string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.Index = v @@ -200,6 +205,7 @@ func (f IndicesPutMapping) WithIndex(v ...string) func(*IndicesPutMappingRequest } // WithDocumentType - the name of the document type. +// func (f IndicesPutMapping) WithDocumentType(v string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.DocumentType = v @@ -207,6 +213,7 @@ func (f IndicesPutMapping) WithDocumentType(v string) func(*IndicesPutMappingReq } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesPutMapping) WithAllowNoIndices(v bool) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.AllowNoIndices = &v @@ -214,6 +221,7 @@ func (f IndicesPutMapping) WithAllowNoIndices(v bool) func(*IndicesPutMappingReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesPutMapping) WithExpandWildcards(v string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.ExpandWildcards = v @@ -221,6 +229,7 @@ func (f IndicesPutMapping) WithExpandWildcards(v string) func(*IndicesPutMapping } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesPutMapping) WithIgnoreUnavailable(v bool) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.IgnoreUnavailable = &v @@ -228,6 +237,7 @@ func (f IndicesPutMapping) WithIgnoreUnavailable(v bool) func(*IndicesPutMapping } // WithIncludeTypeName - whether a type should be expected in the body of the mappings.. +// func (f IndicesPutMapping) WithIncludeTypeName(v bool) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.IncludeTypeName = &v @@ -235,6 +245,7 @@ func (f IndicesPutMapping) WithIncludeTypeName(v bool) func(*IndicesPutMappingRe } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesPutMapping) WithMasterTimeout(v time.Duration) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.MasterTimeout = v @@ -242,6 +253,7 @@ func (f IndicesPutMapping) WithMasterTimeout(v time.Duration) func(*IndicesPutMa } // WithTimeout - explicit operation timeout. +// func (f IndicesPutMapping) WithTimeout(v time.Duration) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.Timeout = v @@ -249,6 +261,7 @@ func (f IndicesPutMapping) WithTimeout(v time.Duration) func(*IndicesPutMappingR } // WithWriteIndexOnly - when true, applies mappings only to the write index of an alias or data stream. +// func (f IndicesPutMapping) WithWriteIndexOnly(v bool) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.WriteIndexOnly = &v @@ -256,6 +269,7 @@ func (f IndicesPutMapping) WithWriteIndexOnly(v bool) func(*IndicesPutMappingReq } // WithPretty makes the response body pretty-printed. +// func (f IndicesPutMapping) WithPretty() func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.Pretty = true @@ -263,6 +277,7 @@ func (f IndicesPutMapping) WithPretty() func(*IndicesPutMappingRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesPutMapping) WithHuman() func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.Human = true @@ -270,6 +285,7 @@ func (f IndicesPutMapping) WithHuman() func(*IndicesPutMappingRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesPutMapping) WithErrorTrace() func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.ErrorTrace = true @@ -277,6 +293,7 @@ func (f IndicesPutMapping) WithErrorTrace() func(*IndicesPutMappingRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesPutMapping) WithFilterPath(v ...string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.FilterPath = v @@ -284,6 +301,7 @@ func (f IndicesPutMapping) WithFilterPath(v ...string) func(*IndicesPutMappingRe } // WithHeader adds the headers to the HTTP request. +// func (f IndicesPutMapping) WithHeader(h map[string]string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { if r.Header == nil { @@ -296,6 +314,7 @@ func (f IndicesPutMapping) WithHeader(h map[string]string) func(*IndicesPutMappi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesPutMapping) WithOpaqueID(s string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_settings.go index 35c6de91267..25c38f355ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesPutSettingsFunc(t Transport) IndicesPutSettings { // IndicesPutSettings updates the index settings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html. +// type IndicesPutSettings func(body io.Reader, o ...func(*IndicesPutSettingsRequest)) (*Response, error) // IndicesPutSettingsRequest configures the Indices Put Settings API request. +// type IndicesPutSettingsRequest struct { Index []string @@ -70,6 +72,7 @@ type IndicesPutSettingsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -146,6 +149,10 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) 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 @@ -158,10 +165,6 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -181,6 +184,7 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesPutSettings) WithContext(v context.Context) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.ctx = v @@ -188,6 +192,7 @@ func (f IndicesPutSettings) WithContext(v context.Context) func(*IndicesPutSetti } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesPutSettings) WithIndex(v ...string) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.Index = v @@ -195,6 +200,7 @@ func (f IndicesPutSettings) WithIndex(v ...string) func(*IndicesPutSettingsReque } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesPutSettings) WithAllowNoIndices(v bool) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.AllowNoIndices = &v @@ -202,6 +208,7 @@ func (f IndicesPutSettings) WithAllowNoIndices(v bool) func(*IndicesPutSettingsR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesPutSettings) WithExpandWildcards(v string) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.ExpandWildcards = v @@ -209,6 +216,7 @@ func (f IndicesPutSettings) WithExpandWildcards(v string) func(*IndicesPutSettin } // WithFlatSettings - return settings in flat format (default: false). +// func (f IndicesPutSettings) WithFlatSettings(v bool) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.FlatSettings = &v @@ -216,6 +224,7 @@ func (f IndicesPutSettings) WithFlatSettings(v bool) func(*IndicesPutSettingsReq } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesPutSettings) WithIgnoreUnavailable(v bool) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.IgnoreUnavailable = &v @@ -223,6 +232,7 @@ func (f IndicesPutSettings) WithIgnoreUnavailable(v bool) func(*IndicesPutSettin } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesPutSettings) WithMasterTimeout(v time.Duration) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.MasterTimeout = v @@ -230,6 +240,7 @@ func (f IndicesPutSettings) WithMasterTimeout(v time.Duration) func(*IndicesPutS } // WithPreserveExisting - whether to update existing settings. if set to `true` existing settings on an index remain unchanged, the default is `false`. +// func (f IndicesPutSettings) WithPreserveExisting(v bool) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.PreserveExisting = &v @@ -237,6 +248,7 @@ func (f IndicesPutSettings) WithPreserveExisting(v bool) func(*IndicesPutSetting } // WithTimeout - explicit operation timeout. +// func (f IndicesPutSettings) WithTimeout(v time.Duration) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.Timeout = v @@ -244,6 +256,7 @@ func (f IndicesPutSettings) WithTimeout(v time.Duration) func(*IndicesPutSetting } // WithPretty makes the response body pretty-printed. +// func (f IndicesPutSettings) WithPretty() func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.Pretty = true @@ -251,6 +264,7 @@ func (f IndicesPutSettings) WithPretty() func(*IndicesPutSettingsRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesPutSettings) WithHuman() func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.Human = true @@ -258,6 +272,7 @@ func (f IndicesPutSettings) WithHuman() func(*IndicesPutSettingsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesPutSettings) WithErrorTrace() func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.ErrorTrace = true @@ -265,6 +280,7 @@ func (f IndicesPutSettings) WithErrorTrace() func(*IndicesPutSettingsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesPutSettings) WithFilterPath(v ...string) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.FilterPath = v @@ -272,6 +288,7 @@ func (f IndicesPutSettings) WithFilterPath(v ...string) func(*IndicesPutSettings } // WithHeader adds the headers to the HTTP request. +// func (f IndicesPutSettings) WithHeader(h map[string]string) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { if r.Header == nil { @@ -284,6 +301,7 @@ func (f IndicesPutSettings) WithHeader(h map[string]string) func(*IndicesPutSett } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesPutSettings) WithOpaqueID(s string) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_template.go index 176420722be..7bdb1b7f59c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.put_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { // IndicesPutTemplate creates or updates an index template. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesPutTemplate func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) // IndicesPutTemplateRequest configures the Indices Put Template API request. +// type IndicesPutTemplateRequest struct { Body io.Reader @@ -67,6 +69,7 @@ type IndicesPutTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,10 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) 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 @@ -141,10 +148,6 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -164,6 +167,7 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesPutTemplate) WithContext(v context.Context) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.ctx = v @@ -171,6 +175,7 @@ func (f IndicesPutTemplate) WithContext(v context.Context) func(*IndicesPutTempl } // WithCreate - whether the index template should only be added if new or can also replace an existing one. +// func (f IndicesPutTemplate) WithCreate(v bool) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Create = &v @@ -178,6 +183,7 @@ func (f IndicesPutTemplate) WithCreate(v bool) func(*IndicesPutTemplateRequest) } // WithIncludeTypeName - whether a type should be returned in the body of the mappings.. +// func (f IndicesPutTemplate) WithIncludeTypeName(v bool) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.IncludeTypeName = &v @@ -185,6 +191,7 @@ func (f IndicesPutTemplate) WithIncludeTypeName(v bool) func(*IndicesPutTemplate } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesPutTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.MasterTimeout = v @@ -192,6 +199,7 @@ func (f IndicesPutTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutT } // WithOrder - the order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers). +// func (f IndicesPutTemplate) WithOrder(v int) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Order = &v @@ -199,6 +207,7 @@ func (f IndicesPutTemplate) WithOrder(v int) func(*IndicesPutTemplateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesPutTemplate) WithPretty() func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Pretty = true @@ -206,6 +215,7 @@ func (f IndicesPutTemplate) WithPretty() func(*IndicesPutTemplateRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesPutTemplate) WithHuman() func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Human = true @@ -213,6 +223,7 @@ func (f IndicesPutTemplate) WithHuman() func(*IndicesPutTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesPutTemplate) WithErrorTrace() func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.ErrorTrace = true @@ -220,6 +231,7 @@ func (f IndicesPutTemplate) WithErrorTrace() func(*IndicesPutTemplateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesPutTemplate) WithFilterPath(v ...string) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.FilterPath = v @@ -227,6 +239,7 @@ func (f IndicesPutTemplate) WithFilterPath(v ...string) func(*IndicesPutTemplate } // WithHeader adds the headers to the HTTP request. +// func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { if r.Header == nil { @@ -239,6 +252,7 @@ func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemp } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesPutTemplate) WithOpaqueID(s string) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.recovery.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.recovery.go index d586da9fdaf..f82ebbf696b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.recovery.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesRecoveryFunc(t Transport) IndicesRecovery { // IndicesRecovery returns information about ongoing index shard recoveries. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html. +// type IndicesRecovery func(o ...func(*IndicesRecoveryRequest)) (*Response, error) // IndicesRecoveryRequest configures the Indices Recovery API request. +// type IndicesRecoveryRequest struct { Index []string @@ -61,6 +63,7 @@ type IndicesRecoveryRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesRecovery) WithContext(v context.Context) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f IndicesRecovery) WithContext(v context.Context) func(*IndicesRecoveryReq } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesRecovery) WithIndex(v ...string) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.Index = v @@ -162,6 +167,7 @@ func (f IndicesRecovery) WithIndex(v ...string) func(*IndicesRecoveryRequest) { } // WithActiveOnly - display only those recoveries that are currently on-going. +// func (f IndicesRecovery) WithActiveOnly(v bool) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.ActiveOnly = &v @@ -169,6 +175,7 @@ func (f IndicesRecovery) WithActiveOnly(v bool) func(*IndicesRecoveryRequest) { } // WithDetailed - whether to display detailed information about shard recovery. +// func (f IndicesRecovery) WithDetailed(v bool) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.Detailed = &v @@ -176,6 +183,7 @@ func (f IndicesRecovery) WithDetailed(v bool) func(*IndicesRecoveryRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesRecovery) WithPretty() func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.Pretty = true @@ -183,6 +191,7 @@ func (f IndicesRecovery) WithPretty() func(*IndicesRecoveryRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesRecovery) WithHuman() func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.Human = true @@ -190,6 +199,7 @@ func (f IndicesRecovery) WithHuman() func(*IndicesRecoveryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesRecovery) WithErrorTrace() func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.ErrorTrace = true @@ -197,6 +207,7 @@ func (f IndicesRecovery) WithErrorTrace() func(*IndicesRecoveryRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesRecovery) WithFilterPath(v ...string) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.FilterPath = v @@ -204,6 +215,7 @@ func (f IndicesRecovery) WithFilterPath(v ...string) func(*IndicesRecoveryReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesRecovery) WithHeader(h map[string]string) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { if r.Header == nil { @@ -216,6 +228,7 @@ func (f IndicesRecovery) WithHeader(h map[string]string) func(*IndicesRecoveryRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesRecovery) WithOpaqueID(s string) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.refresh.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.refresh.go index 6c791766679..834bd9d6781 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.refresh.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.refresh.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesRefreshFunc(t Transport) IndicesRefresh { // IndicesRefresh performs the refresh operation in one or more indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html. +// type IndicesRefresh func(o ...func(*IndicesRefreshRequest)) (*Response, error) // IndicesRefreshRequest configures the Indices Refresh API request. +// type IndicesRefreshRequest struct { Index []string @@ -62,6 +64,7 @@ type IndicesRefreshRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -153,6 +156,7 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f IndicesRefresh) WithContext(v context.Context) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f IndicesRefresh) WithContext(v context.Context) func(*IndicesRefreshReque } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesRefresh) WithIndex(v ...string) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.Index = v @@ -167,6 +172,7 @@ func (f IndicesRefresh) WithIndex(v ...string) func(*IndicesRefreshRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesRefresh) WithAllowNoIndices(v bool) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.AllowNoIndices = &v @@ -174,6 +180,7 @@ func (f IndicesRefresh) WithAllowNoIndices(v bool) func(*IndicesRefreshRequest) } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesRefresh) WithExpandWildcards(v string) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.ExpandWildcards = v @@ -181,6 +188,7 @@ func (f IndicesRefresh) WithExpandWildcards(v string) func(*IndicesRefreshReques } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesRefresh) WithIgnoreUnavailable(v bool) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.IgnoreUnavailable = &v @@ -188,6 +196,7 @@ func (f IndicesRefresh) WithIgnoreUnavailable(v bool) func(*IndicesRefreshReques } // WithPretty makes the response body pretty-printed. +// func (f IndicesRefresh) WithPretty() func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.Pretty = true @@ -195,6 +204,7 @@ func (f IndicesRefresh) WithPretty() func(*IndicesRefreshRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesRefresh) WithHuman() func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.Human = true @@ -202,6 +212,7 @@ func (f IndicesRefresh) WithHuman() func(*IndicesRefreshRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesRefresh) WithErrorTrace() func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.ErrorTrace = true @@ -209,6 +220,7 @@ func (f IndicesRefresh) WithErrorTrace() func(*IndicesRefreshRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesRefresh) WithFilterPath(v ...string) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.FilterPath = v @@ -216,6 +228,7 @@ func (f IndicesRefresh) WithFilterPath(v ...string) func(*IndicesRefreshRequest) } // WithHeader adds the headers to the HTTP request. +// func (f IndicesRefresh) WithHeader(h map[string]string) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { if r.Header == nil { @@ -228,6 +241,7 @@ func (f IndicesRefresh) WithHeader(h map[string]string) func(*IndicesRefreshRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesRefresh) WithOpaqueID(s string) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.resolve_index.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.resolve_index.go index ba9d7f13f53..5c6f820b3db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.resolve_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.resolve_index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesResolveIndexFunc(t Transport) IndicesResolveIndex { // IndicesResolveIndex returns information about any matching indices, aliases, and data streams // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html. +// type IndicesResolveIndex func(name []string, o ...func(*IndicesResolveIndexRequest)) (*Response, error) // IndicesResolveIndexRequest configures the Indices Resolve Index API request. +// type IndicesResolveIndexRequest struct { Name []string @@ -60,6 +62,7 @@ type IndicesResolveIndexRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesResolveIndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -147,6 +150,7 @@ func (r IndicesResolveIndexRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesResolveIndex) WithContext(v context.Context) func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f IndicesResolveIndex) WithContext(v context.Context) func(*IndicesResolve } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). +// func (f IndicesResolveIndex) WithExpandWildcards(v string) func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.ExpandWildcards = v @@ -161,6 +166,7 @@ func (f IndicesResolveIndex) WithExpandWildcards(v string) func(*IndicesResolveI } // WithPretty makes the response body pretty-printed. +// func (f IndicesResolveIndex) WithPretty() func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.Pretty = true @@ -168,6 +174,7 @@ func (f IndicesResolveIndex) WithPretty() func(*IndicesResolveIndexRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesResolveIndex) WithHuman() func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.Human = true @@ -175,6 +182,7 @@ func (f IndicesResolveIndex) WithHuman() func(*IndicesResolveIndexRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesResolveIndex) WithErrorTrace() func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.ErrorTrace = true @@ -182,6 +190,7 @@ func (f IndicesResolveIndex) WithErrorTrace() func(*IndicesResolveIndexRequest) } // WithFilterPath filters the properties of the response body. +// func (f IndicesResolveIndex) WithFilterPath(v ...string) func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.FilterPath = v @@ -189,6 +198,7 @@ func (f IndicesResolveIndex) WithFilterPath(v ...string) func(*IndicesResolveInd } // WithHeader adds the headers to the HTTP request. +// func (f IndicesResolveIndex) WithHeader(h map[string]string) func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { if r.Header == nil { @@ -201,6 +211,7 @@ func (f IndicesResolveIndex) WithHeader(h map[string]string) func(*IndicesResolv } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesResolveIndex) WithOpaqueID(s string) func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.rollover.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.rollover.go index 30c75a92258..13ce4ca1a5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.rollover.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.rollover.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newIndicesRolloverFunc(t Transport) IndicesRollover { // is considered to be too large or too old. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html. +// type IndicesRollover func(alias string, o ...func(*IndicesRolloverRequest)) (*Response, error) // IndicesRolloverRequest configures the Indices Rollover API request. +// type IndicesRolloverRequest struct { Body io.Reader @@ -70,6 +72,7 @@ type IndicesRolloverRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -140,6 +143,10 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -152,10 +159,6 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -175,6 +178,7 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesRollover) WithContext(v context.Context) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.ctx = v @@ -182,6 +186,7 @@ func (f IndicesRollover) WithContext(v context.Context) func(*IndicesRolloverReq } // WithBody - The conditions that needs to be met for executing rollover. +// func (f IndicesRollover) WithBody(v io.Reader) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.Body = v @@ -189,6 +194,7 @@ func (f IndicesRollover) WithBody(v io.Reader) func(*IndicesRolloverRequest) { } // WithNewIndex - the name of the rollover index. +// func (f IndicesRollover) WithNewIndex(v string) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.NewIndex = v @@ -196,6 +202,7 @@ func (f IndicesRollover) WithNewIndex(v string) func(*IndicesRolloverRequest) { } // WithDryRun - if set to true the rollover action will only be validated but not actually performed even if a condition matches. the default is false. +// func (f IndicesRollover) WithDryRun(v bool) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.DryRun = &v @@ -203,6 +210,7 @@ func (f IndicesRollover) WithDryRun(v bool) func(*IndicesRolloverRequest) { } // WithIncludeTypeName - whether a type should be included in the body of the mappings.. +// func (f IndicesRollover) WithIncludeTypeName(v bool) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.IncludeTypeName = &v @@ -210,6 +218,7 @@ func (f IndicesRollover) WithIncludeTypeName(v bool) func(*IndicesRolloverReques } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesRollover) WithMasterTimeout(v time.Duration) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.MasterTimeout = v @@ -217,6 +226,7 @@ func (f IndicesRollover) WithMasterTimeout(v time.Duration) func(*IndicesRollove } // WithTimeout - explicit operation timeout. +// func (f IndicesRollover) WithTimeout(v time.Duration) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.Timeout = v @@ -224,6 +234,7 @@ func (f IndicesRollover) WithTimeout(v time.Duration) func(*IndicesRolloverReque } // WithWaitForActiveShards - set the number of active shards to wait for on the newly created rollover index before the operation returns.. +// func (f IndicesRollover) WithWaitForActiveShards(v string) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.WaitForActiveShards = v @@ -231,6 +242,7 @@ func (f IndicesRollover) WithWaitForActiveShards(v string) func(*IndicesRollover } // WithPretty makes the response body pretty-printed. +// func (f IndicesRollover) WithPretty() func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.Pretty = true @@ -238,6 +250,7 @@ func (f IndicesRollover) WithPretty() func(*IndicesRolloverRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesRollover) WithHuman() func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.Human = true @@ -245,6 +258,7 @@ func (f IndicesRollover) WithHuman() func(*IndicesRolloverRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesRollover) WithErrorTrace() func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.ErrorTrace = true @@ -252,6 +266,7 @@ func (f IndicesRollover) WithErrorTrace() func(*IndicesRolloverRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesRollover) WithFilterPath(v ...string) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { r.FilterPath = v @@ -259,6 +274,7 @@ func (f IndicesRollover) WithFilterPath(v ...string) func(*IndicesRolloverReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesRollover) WithHeader(h map[string]string) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { if r.Header == nil { @@ -271,6 +287,7 @@ func (f IndicesRollover) WithHeader(h map[string]string) func(*IndicesRolloverRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesRollover) WithOpaqueID(s string) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.segments.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.segments.go index 50b1b9377f2..70b35d16040 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.segments.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesSegmentsFunc(t Transport) IndicesSegments { // IndicesSegments provides low-level information about segments in a Lucene index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html. +// type IndicesSegments func(o ...func(*IndicesSegmentsRequest)) (*Response, error) // IndicesSegmentsRequest configures the Indices Segments API request. +// type IndicesSegmentsRequest struct { Index []string @@ -63,6 +65,7 @@ type IndicesSegmentsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesSegments) WithContext(v context.Context) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f IndicesSegments) WithContext(v context.Context) func(*IndicesSegmentsReq } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesSegments) WithIndex(v ...string) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.Index = v @@ -172,6 +177,7 @@ func (f IndicesSegments) WithIndex(v ...string) func(*IndicesSegmentsRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesSegments) WithAllowNoIndices(v bool) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.AllowNoIndices = &v @@ -179,6 +185,7 @@ func (f IndicesSegments) WithAllowNoIndices(v bool) func(*IndicesSegmentsRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesSegments) WithExpandWildcards(v string) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.ExpandWildcards = v @@ -186,6 +193,7 @@ func (f IndicesSegments) WithExpandWildcards(v string) func(*IndicesSegmentsRequ } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesSegments) WithIgnoreUnavailable(v bool) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.IgnoreUnavailable = &v @@ -193,6 +201,7 @@ func (f IndicesSegments) WithIgnoreUnavailable(v bool) func(*IndicesSegmentsRequ } // WithVerbose - includes detailed memory usage by lucene.. +// func (f IndicesSegments) WithVerbose(v bool) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.Verbose = &v @@ -200,6 +209,7 @@ func (f IndicesSegments) WithVerbose(v bool) func(*IndicesSegmentsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesSegments) WithPretty() func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.Pretty = true @@ -207,6 +217,7 @@ func (f IndicesSegments) WithPretty() func(*IndicesSegmentsRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesSegments) WithHuman() func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.Human = true @@ -214,6 +225,7 @@ func (f IndicesSegments) WithHuman() func(*IndicesSegmentsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesSegments) WithErrorTrace() func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.ErrorTrace = true @@ -221,6 +233,7 @@ func (f IndicesSegments) WithErrorTrace() func(*IndicesSegmentsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesSegments) WithFilterPath(v ...string) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.FilterPath = v @@ -228,6 +241,7 @@ func (f IndicesSegments) WithFilterPath(v ...string) func(*IndicesSegmentsReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesSegments) WithHeader(h map[string]string) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { if r.Header == nil { @@ -240,6 +254,7 @@ func (f IndicesSegments) WithHeader(h map[string]string) func(*IndicesSegmentsRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesSegments) WithOpaqueID(s string) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shard_stores.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shard_stores.go index c47c00144d2..fa363c804d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shard_stores.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shard_stores.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesShardStoresFunc(t Transport) IndicesShardStores { // IndicesShardStores provides store information for shard copies of indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html. +// type IndicesShardStores func(o ...func(*IndicesShardStoresRequest)) (*Response, error) // IndicesShardStoresRequest configures the Indices Shard Stores API request. +// type IndicesShardStoresRequest struct { Index []string @@ -63,6 +65,7 @@ type IndicesShardStoresRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IndicesShardStores) WithContext(v context.Context) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f IndicesShardStores) WithContext(v context.Context) func(*IndicesShardSto } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesShardStores) WithIndex(v ...string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.Index = v @@ -172,6 +177,7 @@ func (f IndicesShardStores) WithIndex(v ...string) func(*IndicesShardStoresReque } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesShardStores) WithAllowNoIndices(v bool) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.AllowNoIndices = &v @@ -179,6 +185,7 @@ func (f IndicesShardStores) WithAllowNoIndices(v bool) func(*IndicesShardStoresR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesShardStores) WithExpandWildcards(v string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.ExpandWildcards = v @@ -186,6 +193,7 @@ func (f IndicesShardStores) WithExpandWildcards(v string) func(*IndicesShardStor } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesShardStores) WithIgnoreUnavailable(v bool) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.IgnoreUnavailable = &v @@ -193,6 +201,7 @@ func (f IndicesShardStores) WithIgnoreUnavailable(v bool) func(*IndicesShardStor } // WithStatus - a list of statuses used to filter on shards to get store information for. +// func (f IndicesShardStores) WithStatus(v ...string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.Status = v @@ -200,6 +209,7 @@ func (f IndicesShardStores) WithStatus(v ...string) func(*IndicesShardStoresRequ } // WithPretty makes the response body pretty-printed. +// func (f IndicesShardStores) WithPretty() func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.Pretty = true @@ -207,6 +217,7 @@ func (f IndicesShardStores) WithPretty() func(*IndicesShardStoresRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesShardStores) WithHuman() func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.Human = true @@ -214,6 +225,7 @@ func (f IndicesShardStores) WithHuman() func(*IndicesShardStoresRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesShardStores) WithErrorTrace() func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.ErrorTrace = true @@ -221,6 +233,7 @@ func (f IndicesShardStores) WithErrorTrace() func(*IndicesShardStoresRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesShardStores) WithFilterPath(v ...string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.FilterPath = v @@ -228,6 +241,7 @@ func (f IndicesShardStores) WithFilterPath(v ...string) func(*IndicesShardStores } // WithHeader adds the headers to the HTTP request. +// func (f IndicesShardStores) WithHeader(h map[string]string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { if r.Header == nil { @@ -240,6 +254,7 @@ func (f IndicesShardStores) WithHeader(h map[string]string) func(*IndicesShardSt } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesShardStores) WithOpaqueID(s string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shrink.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shrink.go index 565f667e084..f95888adaa7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shrink.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.shrink.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesShrinkFunc(t Transport) IndicesShrink { // IndicesShrink allow to shrink an existing index into a new index with fewer primary shards. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html. +// type IndicesShrink func(index string, target string, o ...func(*IndicesShrinkRequest)) (*Response, error) // IndicesShrinkRequest configures the Indices Shrink API request. +// type IndicesShrinkRequest struct { Index string @@ -69,6 +71,7 @@ type IndicesShrinkRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -133,6 +136,10 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -145,10 +152,6 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -168,6 +171,7 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f IndicesShrink) WithContext(v context.Context) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.ctx = v @@ -175,6 +179,7 @@ func (f IndicesShrink) WithContext(v context.Context) func(*IndicesShrinkRequest } // WithBody - The configuration for the target index (`settings` and `aliases`). +// func (f IndicesShrink) WithBody(v io.Reader) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.Body = v @@ -182,6 +187,7 @@ func (f IndicesShrink) WithBody(v io.Reader) func(*IndicesShrinkRequest) { } // WithCopySettings - whether or not to copy settings from the source index (defaults to false). +// func (f IndicesShrink) WithCopySettings(v bool) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.CopySettings = &v @@ -189,6 +195,7 @@ func (f IndicesShrink) WithCopySettings(v bool) func(*IndicesShrinkRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesShrink) WithMasterTimeout(v time.Duration) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.MasterTimeout = v @@ -196,6 +203,7 @@ func (f IndicesShrink) WithMasterTimeout(v time.Duration) func(*IndicesShrinkReq } // WithTimeout - explicit operation timeout. +// func (f IndicesShrink) WithTimeout(v time.Duration) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.Timeout = v @@ -203,6 +211,7 @@ func (f IndicesShrink) WithTimeout(v time.Duration) func(*IndicesShrinkRequest) } // WithWaitForActiveShards - set the number of active shards to wait for on the shrunken index before the operation returns.. +// func (f IndicesShrink) WithWaitForActiveShards(v string) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.WaitForActiveShards = v @@ -210,6 +219,7 @@ func (f IndicesShrink) WithWaitForActiveShards(v string) func(*IndicesShrinkRequ } // WithPretty makes the response body pretty-printed. +// func (f IndicesShrink) WithPretty() func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.Pretty = true @@ -217,6 +227,7 @@ func (f IndicesShrink) WithPretty() func(*IndicesShrinkRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesShrink) WithHuman() func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.Human = true @@ -224,6 +235,7 @@ func (f IndicesShrink) WithHuman() func(*IndicesShrinkRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesShrink) WithErrorTrace() func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.ErrorTrace = true @@ -231,6 +243,7 @@ func (f IndicesShrink) WithErrorTrace() func(*IndicesShrinkRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesShrink) WithFilterPath(v ...string) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { r.FilterPath = v @@ -238,6 +251,7 @@ func (f IndicesShrink) WithFilterPath(v ...string) func(*IndicesShrinkRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesShrink) WithHeader(h map[string]string) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { if r.Header == nil { @@ -250,6 +264,7 @@ func (f IndicesShrink) WithHeader(h map[string]string) func(*IndicesShrinkReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesShrink) WithOpaqueID(s string) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_index_template.go index f558525e972..a832617ab82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesSimulateIndexTemplateFunc(t Transport) IndicesSimulateIndexTempla // IndicesSimulateIndexTemplate simulate matching the given index name against the index templates in the system // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesSimulateIndexTemplate func(name string, o ...func(*IndicesSimulateIndexTemplateRequest)) (*Response, error) // IndicesSimulateIndexTemplateRequest configures the Indices Simulate Index Template API request. +// type IndicesSimulateIndexTemplateRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type IndicesSimulateIndexTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -126,6 +129,10 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T 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 @@ -138,10 +145,6 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -161,6 +164,7 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T } // WithContext sets the request context. +// func (f IndicesSimulateIndexTemplate) WithContext(v context.Context) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.ctx = v @@ -168,6 +172,7 @@ func (f IndicesSimulateIndexTemplate) WithContext(v context.Context) func(*Indic } // WithBody - New index template definition, which will be included in the simulation, as if it already exists in the system. +// func (f IndicesSimulateIndexTemplate) WithBody(v io.Reader) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.Body = v @@ -175,6 +180,7 @@ func (f IndicesSimulateIndexTemplate) WithBody(v io.Reader) func(*IndicesSimulat } // WithCause - user defined reason for dry-run creating the new template for simulation purposes. +// func (f IndicesSimulateIndexTemplate) WithCause(v string) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.Cause = v @@ -182,6 +188,7 @@ func (f IndicesSimulateIndexTemplate) WithCause(v string) func(*IndicesSimulateI } // WithCreate - whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one. +// func (f IndicesSimulateIndexTemplate) WithCreate(v bool) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.Create = &v @@ -189,6 +196,7 @@ func (f IndicesSimulateIndexTemplate) WithCreate(v bool) func(*IndicesSimulateIn } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesSimulateIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.MasterTimeout = v @@ -196,6 +204,7 @@ func (f IndicesSimulateIndexTemplate) WithMasterTimeout(v time.Duration) func(*I } // WithPretty makes the response body pretty-printed. +// func (f IndicesSimulateIndexTemplate) WithPretty() func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.Pretty = true @@ -203,6 +212,7 @@ func (f IndicesSimulateIndexTemplate) WithPretty() func(*IndicesSimulateIndexTem } // WithHuman makes statistical values human-readable. +// func (f IndicesSimulateIndexTemplate) WithHuman() func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.Human = true @@ -210,6 +220,7 @@ func (f IndicesSimulateIndexTemplate) WithHuman() func(*IndicesSimulateIndexTemp } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesSimulateIndexTemplate) WithErrorTrace() func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.ErrorTrace = true @@ -217,6 +228,7 @@ func (f IndicesSimulateIndexTemplate) WithErrorTrace() func(*IndicesSimulateInde } // WithFilterPath filters the properties of the response body. +// func (f IndicesSimulateIndexTemplate) WithFilterPath(v ...string) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { r.FilterPath = v @@ -224,6 +236,7 @@ func (f IndicesSimulateIndexTemplate) WithFilterPath(v ...string) func(*IndicesS } // WithHeader adds the headers to the HTTP request. +// func (f IndicesSimulateIndexTemplate) WithHeader(h map[string]string) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { if r.Header == nil { @@ -236,6 +249,7 @@ func (f IndicesSimulateIndexTemplate) WithHeader(h map[string]string) func(*Indi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesSimulateIndexTemplate) WithOpaqueID(s string) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_template.go index ce445f2408d..dc22d6bf0b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.simulate_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesSimulateTemplateFunc(t Transport) IndicesSimulateTemplate { // IndicesSimulateTemplate simulate resolving the given template name or body // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// type IndicesSimulateTemplate func(o ...func(*IndicesSimulateTemplateRequest)) (*Response, error) // IndicesSimulateTemplateRequest configures the Indices Simulate Template API request. +// type IndicesSimulateTemplateRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type IndicesSimulateTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -128,6 +131,10 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp 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 @@ -140,10 +147,6 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -163,6 +166,7 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesSimulateTemplate) WithContext(v context.Context) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.ctx = v @@ -170,6 +174,7 @@ func (f IndicesSimulateTemplate) WithContext(v context.Context) func(*IndicesSim } // WithBody - New index template definition to be simulated, if no index template name is specified. +// func (f IndicesSimulateTemplate) WithBody(v io.Reader) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.Body = v @@ -177,6 +182,7 @@ func (f IndicesSimulateTemplate) WithBody(v io.Reader) func(*IndicesSimulateTemp } // WithName - the name of the index template. +// func (f IndicesSimulateTemplate) WithName(v string) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.Name = v @@ -184,6 +190,7 @@ func (f IndicesSimulateTemplate) WithName(v string) func(*IndicesSimulateTemplat } // WithCause - user defined reason for dry-run creating the new template for simulation purposes. +// func (f IndicesSimulateTemplate) WithCause(v string) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.Cause = v @@ -191,6 +198,7 @@ func (f IndicesSimulateTemplate) WithCause(v string) func(*IndicesSimulateTempla } // WithCreate - whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one. +// func (f IndicesSimulateTemplate) WithCreate(v bool) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.Create = &v @@ -198,6 +206,7 @@ func (f IndicesSimulateTemplate) WithCreate(v bool) func(*IndicesSimulateTemplat } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesSimulateTemplate) WithMasterTimeout(v time.Duration) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.MasterTimeout = v @@ -205,6 +214,7 @@ func (f IndicesSimulateTemplate) WithMasterTimeout(v time.Duration) func(*Indice } // WithPretty makes the response body pretty-printed. +// func (f IndicesSimulateTemplate) WithPretty() func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.Pretty = true @@ -212,6 +222,7 @@ func (f IndicesSimulateTemplate) WithPretty() func(*IndicesSimulateTemplateReque } // WithHuman makes statistical values human-readable. +// func (f IndicesSimulateTemplate) WithHuman() func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.Human = true @@ -219,6 +230,7 @@ func (f IndicesSimulateTemplate) WithHuman() func(*IndicesSimulateTemplateReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesSimulateTemplate) WithErrorTrace() func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.ErrorTrace = true @@ -226,6 +238,7 @@ func (f IndicesSimulateTemplate) WithErrorTrace() func(*IndicesSimulateTemplateR } // WithFilterPath filters the properties of the response body. +// func (f IndicesSimulateTemplate) WithFilterPath(v ...string) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { r.FilterPath = v @@ -233,6 +246,7 @@ func (f IndicesSimulateTemplate) WithFilterPath(v ...string) func(*IndicesSimula } // WithHeader adds the headers to the HTTP request. +// func (f IndicesSimulateTemplate) WithHeader(h map[string]string) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { if r.Header == nil { @@ -245,6 +259,7 @@ func (f IndicesSimulateTemplate) WithHeader(h map[string]string) func(*IndicesSi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesSimulateTemplate) WithOpaqueID(s string) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.split.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.split.go index d055bb38472..86b8404d4e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.split.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.split.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIndicesSplitFunc(t Transport) IndicesSplit { // IndicesSplit allows you to split an existing index into a new index with more primary shards. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html. +// type IndicesSplit func(index string, target string, o ...func(*IndicesSplitRequest)) (*Response, error) // IndicesSplitRequest configures the Indices Split API request. +// type IndicesSplitRequest struct { Index string @@ -69,6 +71,7 @@ type IndicesSplitRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -133,6 +136,10 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -145,10 +152,6 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -168,6 +171,7 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f IndicesSplit) WithContext(v context.Context) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.ctx = v @@ -175,6 +179,7 @@ func (f IndicesSplit) WithContext(v context.Context) func(*IndicesSplitRequest) } // WithBody - The configuration for the target index (`settings` and `aliases`). +// func (f IndicesSplit) WithBody(v io.Reader) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.Body = v @@ -182,6 +187,7 @@ func (f IndicesSplit) WithBody(v io.Reader) func(*IndicesSplitRequest) { } // WithCopySettings - whether or not to copy settings from the source index (defaults to false). +// func (f IndicesSplit) WithCopySettings(v bool) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.CopySettings = &v @@ -189,6 +195,7 @@ func (f IndicesSplit) WithCopySettings(v bool) func(*IndicesSplitRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesSplit) WithMasterTimeout(v time.Duration) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.MasterTimeout = v @@ -196,6 +203,7 @@ func (f IndicesSplit) WithMasterTimeout(v time.Duration) func(*IndicesSplitReque } // WithTimeout - explicit operation timeout. +// func (f IndicesSplit) WithTimeout(v time.Duration) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.Timeout = v @@ -203,6 +211,7 @@ func (f IndicesSplit) WithTimeout(v time.Duration) func(*IndicesSplitRequest) { } // WithWaitForActiveShards - set the number of active shards to wait for on the shrunken index before the operation returns.. +// func (f IndicesSplit) WithWaitForActiveShards(v string) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.WaitForActiveShards = v @@ -210,6 +219,7 @@ func (f IndicesSplit) WithWaitForActiveShards(v string) func(*IndicesSplitReques } // WithPretty makes the response body pretty-printed. +// func (f IndicesSplit) WithPretty() func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.Pretty = true @@ -217,6 +227,7 @@ func (f IndicesSplit) WithPretty() func(*IndicesSplitRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesSplit) WithHuman() func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.Human = true @@ -224,6 +235,7 @@ func (f IndicesSplit) WithHuman() func(*IndicesSplitRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesSplit) WithErrorTrace() func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.ErrorTrace = true @@ -231,6 +243,7 @@ func (f IndicesSplit) WithErrorTrace() func(*IndicesSplitRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesSplit) WithFilterPath(v ...string) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { r.FilterPath = v @@ -238,6 +251,7 @@ func (f IndicesSplit) WithFilterPath(v ...string) func(*IndicesSplitRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesSplit) WithHeader(h map[string]string) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { if r.Header == nil { @@ -250,6 +264,7 @@ func (f IndicesSplit) WithHeader(h map[string]string) func(*IndicesSplitRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesSplit) WithOpaqueID(s string) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.stats.go index 7542eaef287..70411a447f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesStatsFunc(t Transport) IndicesStats { // IndicesStats provides statistics on operations happening in an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html. +// type IndicesStats func(o ...func(*IndicesStatsRequest)) (*Response, error) // IndicesStatsRequest configures the Indices Stats API request. +// type IndicesStatsRequest struct { Index []string @@ -71,6 +73,7 @@ type IndicesStatsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -194,6 +197,7 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f IndicesStats) WithContext(v context.Context) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.ctx = v @@ -201,6 +205,7 @@ func (f IndicesStats) WithContext(v context.Context) func(*IndicesStatsRequest) } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesStats) WithIndex(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Index = v @@ -208,6 +213,7 @@ func (f IndicesStats) WithIndex(v ...string) func(*IndicesStatsRequest) { } // WithMetric - limit the information returned the specific metrics.. +// func (f IndicesStats) WithMetric(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Metric = v @@ -215,6 +221,7 @@ func (f IndicesStats) WithMetric(v ...string) func(*IndicesStatsRequest) { } // WithCompletionFields - a list of fields for `fielddata` and `suggest` index metric (supports wildcards). +// func (f IndicesStats) WithCompletionFields(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.CompletionFields = v @@ -222,6 +229,7 @@ func (f IndicesStats) WithCompletionFields(v ...string) func(*IndicesStatsReques } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesStats) WithExpandWildcards(v string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.ExpandWildcards = v @@ -229,6 +237,7 @@ func (f IndicesStats) WithExpandWildcards(v string) func(*IndicesStatsRequest) { } // WithFielddataFields - a list of fields for `fielddata` index metric (supports wildcards). +// func (f IndicesStats) WithFielddataFields(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.FielddataFields = v @@ -236,6 +245,7 @@ func (f IndicesStats) WithFielddataFields(v ...string) func(*IndicesStatsRequest } // WithFields - a list of fields for `fielddata` and `completion` index metric (supports wildcards). +// func (f IndicesStats) WithFields(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Fields = v @@ -243,6 +253,7 @@ func (f IndicesStats) WithFields(v ...string) func(*IndicesStatsRequest) { } // WithForbidClosedIndices - if set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices. +// func (f IndicesStats) WithForbidClosedIndices(v bool) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.ForbidClosedIndices = &v @@ -250,6 +261,7 @@ func (f IndicesStats) WithForbidClosedIndices(v bool) func(*IndicesStatsRequest) } // WithGroups - a list of search groups for `search` index metric. +// func (f IndicesStats) WithGroups(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Groups = v @@ -257,6 +269,7 @@ func (f IndicesStats) WithGroups(v ...string) func(*IndicesStatsRequest) { } // WithIncludeSegmentFileSizes - whether to report the aggregated disk usage of each one of the lucene index files (only applies if segment stats are requested). +// func (f IndicesStats) WithIncludeSegmentFileSizes(v bool) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.IncludeSegmentFileSizes = &v @@ -264,6 +277,7 @@ func (f IndicesStats) WithIncludeSegmentFileSizes(v bool) func(*IndicesStatsRequ } // WithIncludeUnloadedSegments - if set to true segment stats will include stats for segments that are not currently loaded into memory. +// func (f IndicesStats) WithIncludeUnloadedSegments(v bool) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.IncludeUnloadedSegments = &v @@ -271,6 +285,7 @@ func (f IndicesStats) WithIncludeUnloadedSegments(v bool) func(*IndicesStatsRequ } // WithLevel - return stats aggregated at cluster, index or shard level. +// func (f IndicesStats) WithLevel(v string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Level = v @@ -278,6 +293,7 @@ func (f IndicesStats) WithLevel(v string) func(*IndicesStatsRequest) { } // WithTypes - a list of document types for the `indexing` index metric. +// func (f IndicesStats) WithTypes(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Types = v @@ -285,6 +301,7 @@ func (f IndicesStats) WithTypes(v ...string) func(*IndicesStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IndicesStats) WithPretty() func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Pretty = true @@ -292,6 +309,7 @@ func (f IndicesStats) WithPretty() func(*IndicesStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesStats) WithHuman() func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.Human = true @@ -299,6 +317,7 @@ func (f IndicesStats) WithHuman() func(*IndicesStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesStats) WithErrorTrace() func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.ErrorTrace = true @@ -306,6 +325,7 @@ func (f IndicesStats) WithErrorTrace() func(*IndicesStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesStats) WithFilterPath(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.FilterPath = v @@ -313,6 +333,7 @@ func (f IndicesStats) WithFilterPath(v ...string) func(*IndicesStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesStats) WithHeader(h map[string]string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { if r.Header == nil { @@ -325,6 +346,7 @@ func (f IndicesStats) WithHeader(h map[string]string) func(*IndicesStatsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesStats) WithOpaqueID(s string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.update_aliases.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.update_aliases.go index ef1778a9b82..bcf43964638 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.update_aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.update_aliases.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesUpdateAliasesFunc(t Transport) IndicesUpdateAliases { // IndicesUpdateAliases updates index aliases. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// type IndicesUpdateAliases func(body io.Reader, o ...func(*IndicesUpdateAliasesRequest)) (*Response, error) // IndicesUpdateAliasesRequest configures the Indices Update Aliases API request. +// type IndicesUpdateAliasesRequest struct { Body io.Reader @@ -62,6 +64,7 @@ type IndicesUpdateAliasesRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -113,6 +116,10 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport 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 @@ -125,10 +132,6 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -148,6 +151,7 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f IndicesUpdateAliases) WithContext(v context.Context) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f IndicesUpdateAliases) WithContext(v context.Context) func(*IndicesUpdate } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesUpdateAliases) WithMasterTimeout(v time.Duration) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.MasterTimeout = v @@ -162,6 +167,7 @@ func (f IndicesUpdateAliases) WithMasterTimeout(v time.Duration) func(*IndicesUp } // WithTimeout - request timeout. +// func (f IndicesUpdateAliases) WithTimeout(v time.Duration) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.Timeout = v @@ -169,6 +175,7 @@ func (f IndicesUpdateAliases) WithTimeout(v time.Duration) func(*IndicesUpdateAl } // WithPretty makes the response body pretty-printed. +// func (f IndicesUpdateAliases) WithPretty() func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f IndicesUpdateAliases) WithPretty() func(*IndicesUpdateAliasesRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesUpdateAliases) WithHuman() func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f IndicesUpdateAliases) WithHuman() func(*IndicesUpdateAliasesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesUpdateAliases) WithErrorTrace() func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f IndicesUpdateAliases) WithErrorTrace() func(*IndicesUpdateAliasesRequest } // WithFilterPath filters the properties of the response body. +// func (f IndicesUpdateAliases) WithFilterPath(v ...string) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f IndicesUpdateAliases) WithFilterPath(v ...string) func(*IndicesUpdateAli } // WithHeader adds the headers to the HTTP request. +// func (f IndicesUpdateAliases) WithHeader(h map[string]string) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f IndicesUpdateAliases) WithHeader(h map[string]string) func(*IndicesUpdat } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesUpdateAliases) WithOpaqueID(s string) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.upgrade.go index bb8187792d3..1d1d0deffa2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.upgrade.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesUpgradeFunc(t Transport) IndicesUpgrade { // IndicesUpgrade deprecated Upgrades to the current version of Lucene. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html. +// type IndicesUpgrade func(o ...func(*IndicesUpgradeRequest)) (*Response, error) // IndicesUpgradeRequest configures the Indices Upgrade API request. +// type IndicesUpgradeRequest struct { Index []string @@ -64,6 +66,7 @@ type IndicesUpgradeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesUpgradeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -163,6 +166,7 @@ func (r IndicesUpgradeRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f IndicesUpgrade) WithContext(v context.Context) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.ctx = v @@ -170,6 +174,7 @@ func (f IndicesUpgrade) WithContext(v context.Context) func(*IndicesUpgradeReque } // WithIndex - a list of index names; use _all to perform the operation on all indices. +// func (f IndicesUpgrade) WithIndex(v ...string) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.Index = v @@ -177,6 +182,7 @@ func (f IndicesUpgrade) WithIndex(v ...string) func(*IndicesUpgradeRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesUpgrade) WithAllowNoIndices(v bool) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.AllowNoIndices = &v @@ -184,6 +190,7 @@ func (f IndicesUpgrade) WithAllowNoIndices(v bool) func(*IndicesUpgradeRequest) } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesUpgrade) WithExpandWildcards(v string) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.ExpandWildcards = v @@ -191,6 +198,7 @@ func (f IndicesUpgrade) WithExpandWildcards(v string) func(*IndicesUpgradeReques } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesUpgrade) WithIgnoreUnavailable(v bool) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.IgnoreUnavailable = &v @@ -198,6 +206,7 @@ func (f IndicesUpgrade) WithIgnoreUnavailable(v bool) func(*IndicesUpgradeReques } // WithOnlyAncientSegments - if true, only ancient (an older lucene major release) segments will be upgraded. +// func (f IndicesUpgrade) WithOnlyAncientSegments(v bool) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.OnlyAncientSegments = &v @@ -205,6 +214,7 @@ func (f IndicesUpgrade) WithOnlyAncientSegments(v bool) func(*IndicesUpgradeRequ } // WithWaitForCompletion - specify whether the request should block until the all segments are upgraded (default: false). +// func (f IndicesUpgrade) WithWaitForCompletion(v bool) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.WaitForCompletion = &v @@ -212,6 +222,7 @@ func (f IndicesUpgrade) WithWaitForCompletion(v bool) func(*IndicesUpgradeReques } // WithPretty makes the response body pretty-printed. +// func (f IndicesUpgrade) WithPretty() func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.Pretty = true @@ -219,6 +230,7 @@ func (f IndicesUpgrade) WithPretty() func(*IndicesUpgradeRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesUpgrade) WithHuman() func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.Human = true @@ -226,6 +238,7 @@ func (f IndicesUpgrade) WithHuman() func(*IndicesUpgradeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesUpgrade) WithErrorTrace() func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.ErrorTrace = true @@ -233,6 +246,7 @@ func (f IndicesUpgrade) WithErrorTrace() func(*IndicesUpgradeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesUpgrade) WithFilterPath(v ...string) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { r.FilterPath = v @@ -240,6 +254,7 @@ func (f IndicesUpgrade) WithFilterPath(v ...string) func(*IndicesUpgradeRequest) } // WithHeader adds the headers to the HTTP request. +// func (f IndicesUpgrade) WithHeader(h map[string]string) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { if r.Header == nil { @@ -252,6 +267,7 @@ func (f IndicesUpgrade) WithHeader(h map[string]string) func(*IndicesUpgradeRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesUpgrade) WithOpaqueID(s string) func(*IndicesUpgradeRequest) { return func(r *IndicesUpgradeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.validate_query.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.validate_query.go index 653c8cfbc1e..e3b72e5991d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.validate_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.indices.validate_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesValidateQueryFunc(t Transport) IndicesValidateQuery { // IndicesValidateQuery allows a user to validate a potentially expensive query without executing it. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html. +// type IndicesValidateQuery func(o ...func(*IndicesValidateQueryRequest)) (*Response, error) // IndicesValidateQueryRequest configures the Indices Validate Query API request. +// type IndicesValidateQueryRequest struct { Index []string DocumentType []string @@ -75,6 +77,7 @@ type IndicesValidateQueryRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -177,6 +180,10 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport 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 @@ -189,10 +196,6 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -212,6 +215,7 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f IndicesValidateQuery) WithContext(v context.Context) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.ctx = v @@ -219,6 +223,7 @@ func (f IndicesValidateQuery) WithContext(v context.Context) func(*IndicesValida } // WithBody - The query definition specified with the Query DSL. +// func (f IndicesValidateQuery) WithBody(v io.Reader) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Body = v @@ -226,6 +231,7 @@ func (f IndicesValidateQuery) WithBody(v io.Reader) func(*IndicesValidateQueryRe } // WithIndex - a list of index names to restrict the operation; use _all to perform the operation on all indices. +// func (f IndicesValidateQuery) WithIndex(v ...string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Index = v @@ -233,6 +239,7 @@ func (f IndicesValidateQuery) WithIndex(v ...string) func(*IndicesValidateQueryR } // WithDocumentType - a list of document types to restrict the operation; leave empty to perform the operation on all types. +// func (f IndicesValidateQuery) WithDocumentType(v ...string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.DocumentType = v @@ -240,6 +247,7 @@ func (f IndicesValidateQuery) WithDocumentType(v ...string) func(*IndicesValidat } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesValidateQuery) WithAllowNoIndices(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.AllowNoIndices = &v @@ -247,6 +255,7 @@ func (f IndicesValidateQuery) WithAllowNoIndices(v bool) func(*IndicesValidateQu } // WithAllShards - execute validation on all shards instead of one random shard per index. +// func (f IndicesValidateQuery) WithAllShards(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.AllShards = &v @@ -254,6 +263,7 @@ func (f IndicesValidateQuery) WithAllShards(v bool) func(*IndicesValidateQueryRe } // WithAnalyzer - the analyzer to use for the query string. +// func (f IndicesValidateQuery) WithAnalyzer(v string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Analyzer = v @@ -261,6 +271,7 @@ func (f IndicesValidateQuery) WithAnalyzer(v string) func(*IndicesValidateQueryR } // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). +// func (f IndicesValidateQuery) WithAnalyzeWildcard(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.AnalyzeWildcard = &v @@ -268,6 +279,7 @@ func (f IndicesValidateQuery) WithAnalyzeWildcard(v bool) func(*IndicesValidateQ } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f IndicesValidateQuery) WithDefaultOperator(v string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.DefaultOperator = v @@ -275,6 +287,7 @@ func (f IndicesValidateQuery) WithDefaultOperator(v string) func(*IndicesValidat } // WithDf - the field to use as default where no field prefix is given in the query string. +// func (f IndicesValidateQuery) WithDf(v string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Df = v @@ -282,6 +295,7 @@ func (f IndicesValidateQuery) WithDf(v string) func(*IndicesValidateQueryRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesValidateQuery) WithExpandWildcards(v string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.ExpandWildcards = v @@ -289,6 +303,7 @@ func (f IndicesValidateQuery) WithExpandWildcards(v string) func(*IndicesValidat } // WithExplain - return detailed information about the error. +// func (f IndicesValidateQuery) WithExplain(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Explain = &v @@ -296,6 +311,7 @@ func (f IndicesValidateQuery) WithExplain(v bool) func(*IndicesValidateQueryRequ } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesValidateQuery) WithIgnoreUnavailable(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.IgnoreUnavailable = &v @@ -303,6 +319,7 @@ func (f IndicesValidateQuery) WithIgnoreUnavailable(v bool) func(*IndicesValidat } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f IndicesValidateQuery) WithLenient(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Lenient = &v @@ -310,6 +327,7 @@ func (f IndicesValidateQuery) WithLenient(v bool) func(*IndicesValidateQueryRequ } // WithQuery - query in the lucene query string syntax. +// func (f IndicesValidateQuery) WithQuery(v string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Query = v @@ -317,6 +335,7 @@ func (f IndicesValidateQuery) WithQuery(v string) func(*IndicesValidateQueryRequ } // WithRewrite - provide a more detailed explanation showing the actual lucene query that will be executed.. +// func (f IndicesValidateQuery) WithRewrite(v bool) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Rewrite = &v @@ -324,6 +343,7 @@ func (f IndicesValidateQuery) WithRewrite(v bool) func(*IndicesValidateQueryRequ } // WithPretty makes the response body pretty-printed. +// func (f IndicesValidateQuery) WithPretty() func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Pretty = true @@ -331,6 +351,7 @@ func (f IndicesValidateQuery) WithPretty() func(*IndicesValidateQueryRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesValidateQuery) WithHuman() func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.Human = true @@ -338,6 +359,7 @@ func (f IndicesValidateQuery) WithHuman() func(*IndicesValidateQueryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesValidateQuery) WithErrorTrace() func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.ErrorTrace = true @@ -345,6 +367,7 @@ func (f IndicesValidateQuery) WithErrorTrace() func(*IndicesValidateQueryRequest } // WithFilterPath filters the properties of the response body. +// func (f IndicesValidateQuery) WithFilterPath(v ...string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.FilterPath = v @@ -352,6 +375,7 @@ func (f IndicesValidateQuery) WithFilterPath(v ...string) func(*IndicesValidateQ } // WithHeader adds the headers to the HTTP request. +// func (f IndicesValidateQuery) WithHeader(h map[string]string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { if r.Header == nil { @@ -364,6 +388,7 @@ func (f IndicesValidateQuery) WithHeader(h map[string]string) func(*IndicesValid } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesValidateQuery) WithOpaqueID(s string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.info.go index 0b8e866a36b..8af3a25b2c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newInfoFunc(t Transport) Info { // Info returns basic information about the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// type Info func(o ...func(*InfoRequest)) (*Response, error) // InfoRequest configures the Info API request. +// type InfoRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type InfoRequest struct { } // Do executes the request and returns response or error. +// func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, er } // WithContext sets the request context. +// func (f Info) WithContext(v context.Context) func(*InfoRequest) { return func(r *InfoRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f Info) WithContext(v context.Context) func(*InfoRequest) { } // WithHuman makes statistical values human-readable. +// func (f Info) WithHuman() func(*InfoRequest) { return func(r *InfoRequest) { r.Human = true @@ -143,6 +148,7 @@ func (f Info) WithHuman() func(*InfoRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Info) WithErrorTrace() func(*InfoRequest) { return func(r *InfoRequest) { r.ErrorTrace = true @@ -150,6 +156,7 @@ func (f Info) WithErrorTrace() func(*InfoRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Info) WithFilterPath(v ...string) func(*InfoRequest) { return func(r *InfoRequest) { r.FilterPath = v @@ -157,6 +164,7 @@ func (f Info) WithFilterPath(v ...string) func(*InfoRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Info) WithHeader(h map[string]string) func(*InfoRequest) { return func(r *InfoRequest) { if r.Header == nil { @@ -169,6 +177,7 @@ func (f Info) WithHeader(h map[string]string) func(*InfoRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Info) WithOpaqueID(s string) func(*InfoRequest) { return func(r *InfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.delete_pipeline.go index 31158f21f39..1c3a6c9a901 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.delete_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIngestDeletePipelineFunc(t Transport) IngestDeletePipeline { // IngestDeletePipeline deletes a pipeline. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html. +// type IngestDeletePipeline func(id string, o ...func(*IngestDeletePipelineRequest)) (*Response, error) // IngestDeletePipelineRequest configures the Ingest Delete Pipeline API request. +// type IngestDeletePipelineRequest struct { PipelineID string @@ -61,6 +63,7 @@ type IngestDeletePipelineRequest struct { } // Do executes the request and returns response or error. +// func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f IngestDeletePipeline) WithContext(v context.Context) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f IngestDeletePipeline) WithContext(v context.Context) func(*IngestDeleteP } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IngestDeletePipeline) WithMasterTimeout(v time.Duration) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.MasterTimeout = v @@ -162,6 +167,7 @@ func (f IngestDeletePipeline) WithMasterTimeout(v time.Duration) func(*IngestDel } // WithTimeout - explicit operation timeout. +// func (f IngestDeletePipeline) WithTimeout(v time.Duration) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.Timeout = v @@ -169,6 +175,7 @@ func (f IngestDeletePipeline) WithTimeout(v time.Duration) func(*IngestDeletePip } // WithPretty makes the response body pretty-printed. +// func (f IngestDeletePipeline) WithPretty() func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f IngestDeletePipeline) WithPretty() func(*IngestDeletePipelineRequest) { } // WithHuman makes statistical values human-readable. +// func (f IngestDeletePipeline) WithHuman() func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f IngestDeletePipeline) WithHuman() func(*IngestDeletePipelineRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IngestDeletePipeline) WithErrorTrace() func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f IngestDeletePipeline) WithErrorTrace() func(*IngestDeletePipelineRequest } // WithFilterPath filters the properties of the response body. +// func (f IngestDeletePipeline) WithFilterPath(v ...string) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f IngestDeletePipeline) WithFilterPath(v ...string) func(*IngestDeletePipe } // WithHeader adds the headers to the HTTP request. +// func (f IngestDeletePipeline) WithHeader(h map[string]string) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f IngestDeletePipeline) WithHeader(h map[string]string) func(*IngestDelete } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IngestDeletePipeline) WithOpaqueID(s string) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.geo_ip_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.geo_ip_stats.go index b6beddf9a81..5dfa0f3bc35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.geo_ip_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.geo_ip_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIngestGeoIPStatsFunc(t Transport) IngestGeoIPStats { // IngestGeoIPStats returns statistical information about geoip databases // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html. +// type IngestGeoIPStats func(o ...func(*IngestGeoIPStatsRequest)) (*Response, error) // IngestGeoIPStatsRequest configures the Ingest GeoIP Stats API request. +// type IngestGeoIPStatsRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type IngestGeoIPStatsRequest struct { } // Do executes the request and returns response or error. +// func (r IngestGeoIPStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r IngestGeoIPStatsRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f IngestGeoIPStats) WithContext(v context.Context) func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f IngestGeoIPStats) WithContext(v context.Context) func(*IngestGeoIPStatsR } // WithPretty makes the response body pretty-printed. +// func (f IngestGeoIPStats) WithPretty() func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f IngestGeoIPStats) WithPretty() func(*IngestGeoIPStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f IngestGeoIPStats) WithHuman() func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f IngestGeoIPStats) WithHuman() func(*IngestGeoIPStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IngestGeoIPStats) WithErrorTrace() func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f IngestGeoIPStats) WithErrorTrace() func(*IngestGeoIPStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IngestGeoIPStats) WithFilterPath(v ...string) func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f IngestGeoIPStats) WithFilterPath(v ...string) func(*IngestGeoIPStatsRequ } // WithHeader adds the headers to the HTTP request. +// func (f IngestGeoIPStats) WithHeader(h map[string]string) func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f IngestGeoIPStats) WithHeader(h map[string]string) func(*IngestGeoIPStats } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IngestGeoIPStats) WithOpaqueID(s string) func(*IngestGeoIPStatsRequest) { return func(r *IngestGeoIPStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.get_pipeline.go index 09ae2df3f0b..4bed56c37ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.get_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIngestGetPipelineFunc(t Transport) IngestGetPipeline { // IngestGetPipeline returns a pipeline. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html. +// type IngestGetPipeline func(o ...func(*IngestGetPipelineRequest)) (*Response, error) // IngestGetPipelineRequest configures the Ingest Get Pipeline API request. +// type IngestGetPipelineRequest struct { PipelineID string @@ -62,6 +64,7 @@ type IngestGetPipelineRequest struct { } // Do executes the request and returns response or error. +// func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -151,6 +154,7 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IngestGetPipeline) WithContext(v context.Context) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.ctx = v @@ -158,6 +162,7 @@ func (f IngestGetPipeline) WithContext(v context.Context) func(*IngestGetPipelin } // WithPipelineID - comma separated list of pipeline ids. wildcards supported. +// func (f IngestGetPipeline) WithPipelineID(v string) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.PipelineID = v @@ -165,6 +170,7 @@ func (f IngestGetPipeline) WithPipelineID(v string) func(*IngestGetPipelineReque } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IngestGetPipeline) WithMasterTimeout(v time.Duration) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.MasterTimeout = v @@ -172,6 +178,7 @@ func (f IngestGetPipeline) WithMasterTimeout(v time.Duration) func(*IngestGetPip } // WithSummary - return pipelines without their definitions (default: false). +// func (f IngestGetPipeline) WithSummary(v bool) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.Summary = &v @@ -179,6 +186,7 @@ func (f IngestGetPipeline) WithSummary(v bool) func(*IngestGetPipelineRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IngestGetPipeline) WithPretty() func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.Pretty = true @@ -186,6 +194,7 @@ func (f IngestGetPipeline) WithPretty() func(*IngestGetPipelineRequest) { } // WithHuman makes statistical values human-readable. +// func (f IngestGetPipeline) WithHuman() func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.Human = true @@ -193,6 +202,7 @@ func (f IngestGetPipeline) WithHuman() func(*IngestGetPipelineRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IngestGetPipeline) WithErrorTrace() func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.ErrorTrace = true @@ -200,6 +210,7 @@ func (f IngestGetPipeline) WithErrorTrace() func(*IngestGetPipelineRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IngestGetPipeline) WithFilterPath(v ...string) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { r.FilterPath = v @@ -207,6 +218,7 @@ func (f IngestGetPipeline) WithFilterPath(v ...string) func(*IngestGetPipelineRe } // WithHeader adds the headers to the HTTP request. +// func (f IngestGetPipeline) WithHeader(h map[string]string) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { if r.Header == nil { @@ -219,6 +231,7 @@ func (f IngestGetPipeline) WithHeader(h map[string]string) func(*IngestGetPipeli } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IngestGetPipeline) WithOpaqueID(s string) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.processor_grok.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.processor_grok.go index 00c16bb4b1d..9ebe3f3b975 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.processor_grok.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.processor_grok.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIngestProcessorGrokFunc(t Transport) IngestProcessorGrok { // IngestProcessorGrok returns a list of the built-in patterns. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get. +// type IngestProcessorGrok func(o ...func(*IngestProcessorGrokRequest)) (*Response, error) // IngestProcessorGrokRequest configures the Ingest Processor Grok API request. +// type IngestProcessorGrokRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type IngestProcessorGrokRequest struct { } // Do executes the request and returns response or error. +// func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f IngestProcessorGrok) WithContext(v context.Context) func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f IngestProcessorGrok) WithContext(v context.Context) func(*IngestProcesso } // WithPretty makes the response body pretty-printed. +// func (f IngestProcessorGrok) WithPretty() func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f IngestProcessorGrok) WithPretty() func(*IngestProcessorGrokRequest) { } // WithHuman makes statistical values human-readable. +// func (f IngestProcessorGrok) WithHuman() func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f IngestProcessorGrok) WithHuman() func(*IngestProcessorGrokRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IngestProcessorGrok) WithErrorTrace() func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f IngestProcessorGrok) WithErrorTrace() func(*IngestProcessorGrokRequest) } // WithFilterPath filters the properties of the response body. +// func (f IngestProcessorGrok) WithFilterPath(v ...string) func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f IngestProcessorGrok) WithFilterPath(v ...string) func(*IngestProcessorGr } // WithHeader adds the headers to the HTTP request. +// func (f IngestProcessorGrok) WithHeader(h map[string]string) func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f IngestProcessorGrok) WithHeader(h map[string]string) func(*IngestProcess } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IngestProcessorGrok) WithOpaqueID(s string) func(*IngestProcessorGrokRequest) { return func(r *IngestProcessorGrokRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.put_pipeline.go index f6ac2f84bfc..51ef5c279e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.put_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newIngestPutPipelineFunc(t Transport) IngestPutPipeline { // IngestPutPipeline creates or updates a pipeline. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html. +// type IngestPutPipeline func(id string, body io.Reader, o ...func(*IngestPutPipelineRequest)) (*Response, error) // IngestPutPipelineRequest configures the Ingest Put Pipeline API request. +// type IngestPutPipelineRequest struct { PipelineID string @@ -66,6 +68,7 @@ type IngestPutPipelineRequest struct { } // Do executes the request and returns response or error. +// func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -126,6 +129,10 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( 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 @@ -138,10 +145,6 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -161,6 +164,7 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f IngestPutPipeline) WithContext(v context.Context) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.ctx = v @@ -168,6 +172,7 @@ func (f IngestPutPipeline) WithContext(v context.Context) func(*IngestPutPipelin } // WithIfVersion - required version for optimistic concurrency control for pipeline updates. +// func (f IngestPutPipeline) WithIfVersion(v int) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.IfVersion = &v @@ -175,6 +180,7 @@ func (f IngestPutPipeline) WithIfVersion(v int) func(*IngestPutPipelineRequest) } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f IngestPutPipeline) WithMasterTimeout(v time.Duration) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.MasterTimeout = v @@ -182,6 +188,7 @@ func (f IngestPutPipeline) WithMasterTimeout(v time.Duration) func(*IngestPutPip } // WithTimeout - explicit operation timeout. +// func (f IngestPutPipeline) WithTimeout(v time.Duration) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.Timeout = v @@ -189,6 +196,7 @@ func (f IngestPutPipeline) WithTimeout(v time.Duration) func(*IngestPutPipelineR } // WithPretty makes the response body pretty-printed. +// func (f IngestPutPipeline) WithPretty() func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.Pretty = true @@ -196,6 +204,7 @@ func (f IngestPutPipeline) WithPretty() func(*IngestPutPipelineRequest) { } // WithHuman makes statistical values human-readable. +// func (f IngestPutPipeline) WithHuman() func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.Human = true @@ -203,6 +212,7 @@ func (f IngestPutPipeline) WithHuman() func(*IngestPutPipelineRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IngestPutPipeline) WithErrorTrace() func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.ErrorTrace = true @@ -210,6 +220,7 @@ func (f IngestPutPipeline) WithErrorTrace() func(*IngestPutPipelineRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IngestPutPipeline) WithFilterPath(v ...string) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { r.FilterPath = v @@ -217,6 +228,7 @@ func (f IngestPutPipeline) WithFilterPath(v ...string) func(*IngestPutPipelineRe } // WithHeader adds the headers to the HTTP request. +// func (f IngestPutPipeline) WithHeader(h map[string]string) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { if r.Header == nil { @@ -229,6 +241,7 @@ func (f IngestPutPipeline) WithHeader(h map[string]string) func(*IngestPutPipeli } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IngestPutPipeline) WithOpaqueID(s string) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.simulate.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.simulate.go index 01f269440d9..abea214b9f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.simulate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ingest.simulate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIngestSimulateFunc(t Transport) IngestSimulate { // IngestSimulate allows to simulate a pipeline with example documents. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html. +// type IngestSimulate func(body io.Reader, o ...func(*IngestSimulateRequest)) (*Response, error) // IngestSimulateRequest configures the Ingest Simulate API request. +// type IngestSimulateRequest struct { PipelineID string @@ -63,6 +65,7 @@ type IngestSimulateRequest struct { } // Do executes the request and returns response or error. +// func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -119,6 +122,10 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -131,10 +138,6 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -154,6 +157,7 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f IngestSimulate) WithContext(v context.Context) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f IngestSimulate) WithContext(v context.Context) func(*IngestSimulateReque } // WithPipelineID - pipeline ID. +// func (f IngestSimulate) WithPipelineID(v string) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.PipelineID = v @@ -168,6 +173,7 @@ func (f IngestSimulate) WithPipelineID(v string) func(*IngestSimulateRequest) { } // WithVerbose - verbose mode. display data output for each processor in executed pipeline. +// func (f IngestSimulate) WithVerbose(v bool) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.Verbose = &v @@ -175,6 +181,7 @@ func (f IngestSimulate) WithVerbose(v bool) func(*IngestSimulateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f IngestSimulate) WithPretty() func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.Pretty = true @@ -182,6 +189,7 @@ func (f IngestSimulate) WithPretty() func(*IngestSimulateRequest) { } // WithHuman makes statistical values human-readable. +// func (f IngestSimulate) WithHuman() func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.Human = true @@ -189,6 +197,7 @@ func (f IngestSimulate) WithHuman() func(*IngestSimulateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IngestSimulate) WithErrorTrace() func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.ErrorTrace = true @@ -196,6 +205,7 @@ func (f IngestSimulate) WithErrorTrace() func(*IngestSimulateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IngestSimulate) WithFilterPath(v ...string) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { r.FilterPath = v @@ -203,6 +213,7 @@ func (f IngestSimulate) WithFilterPath(v ...string) func(*IngestSimulateRequest) } // WithHeader adds the headers to the HTTP request. +// func (f IngestSimulate) WithHeader(h map[string]string) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { if r.Header == nil { @@ -215,6 +226,7 @@ func (f IngestSimulate) WithHeader(h map[string]string) func(*IngestSimulateRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IngestSimulate) WithOpaqueID(s string) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mget.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mget.go index 900b1c9a5e1..e4d9b3e8019 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mget.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mget.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMgetFunc(t Transport) Mget { // Mget allows to get multiple documents in one request. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html. +// type Mget func(body io.Reader, o ...func(*MgetRequest)) (*Response, error) // MgetRequest configures the Mget API request. +// type MgetRequest struct { Index string DocumentType string @@ -71,6 +73,7 @@ type MgetRequest struct { } // Do executes the request and returns response or error. +// func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,10 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er 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 @@ -167,10 +174,6 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -190,6 +193,7 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er } // WithContext sets the request context. +// func (f Mget) WithContext(v context.Context) func(*MgetRequest) { return func(r *MgetRequest) { r.ctx = v @@ -197,6 +201,7 @@ func (f Mget) WithContext(v context.Context) func(*MgetRequest) { } // WithIndex - the name of the index. +// func (f Mget) WithIndex(v string) func(*MgetRequest) { return func(r *MgetRequest) { r.Index = v @@ -204,6 +209,7 @@ func (f Mget) WithIndex(v string) func(*MgetRequest) { } // WithDocumentType - the type of the document. +// func (f Mget) WithDocumentType(v string) func(*MgetRequest) { return func(r *MgetRequest) { r.DocumentType = v @@ -211,6 +217,7 @@ func (f Mget) WithDocumentType(v string) func(*MgetRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f Mget) WithPreference(v string) func(*MgetRequest) { return func(r *MgetRequest) { r.Preference = v @@ -218,6 +225,7 @@ func (f Mget) WithPreference(v string) func(*MgetRequest) { } // WithRealtime - specify whether to perform the operation in realtime or search mode. +// func (f Mget) WithRealtime(v bool) func(*MgetRequest) { return func(r *MgetRequest) { r.Realtime = &v @@ -225,6 +233,7 @@ func (f Mget) WithRealtime(v bool) func(*MgetRequest) { } // WithRefresh - refresh the shard containing the document before performing the operation. +// func (f Mget) WithRefresh(v bool) func(*MgetRequest) { return func(r *MgetRequest) { r.Refresh = &v @@ -232,6 +241,7 @@ func (f Mget) WithRefresh(v bool) func(*MgetRequest) { } // WithRouting - specific routing value. +// func (f Mget) WithRouting(v string) func(*MgetRequest) { return func(r *MgetRequest) { r.Routing = v @@ -239,6 +249,7 @@ func (f Mget) WithRouting(v string) func(*MgetRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f Mget) WithSource(v ...string) func(*MgetRequest) { return func(r *MgetRequest) { r.Source = v @@ -246,6 +257,7 @@ func (f Mget) WithSource(v ...string) func(*MgetRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f Mget) WithSourceExcludes(v ...string) func(*MgetRequest) { return func(r *MgetRequest) { r.SourceExcludes = v @@ -253,6 +265,7 @@ func (f Mget) WithSourceExcludes(v ...string) func(*MgetRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f Mget) WithSourceIncludes(v ...string) func(*MgetRequest) { return func(r *MgetRequest) { r.SourceIncludes = v @@ -260,6 +273,7 @@ func (f Mget) WithSourceIncludes(v ...string) func(*MgetRequest) { } // WithStoredFields - a list of stored fields to return in the response. +// func (f Mget) WithStoredFields(v ...string) func(*MgetRequest) { return func(r *MgetRequest) { r.StoredFields = v @@ -267,6 +281,7 @@ func (f Mget) WithStoredFields(v ...string) func(*MgetRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Mget) WithPretty() func(*MgetRequest) { return func(r *MgetRequest) { r.Pretty = true @@ -274,6 +289,7 @@ func (f Mget) WithPretty() func(*MgetRequest) { } // WithHuman makes statistical values human-readable. +// func (f Mget) WithHuman() func(*MgetRequest) { return func(r *MgetRequest) { r.Human = true @@ -281,6 +297,7 @@ func (f Mget) WithHuman() func(*MgetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Mget) WithErrorTrace() func(*MgetRequest) { return func(r *MgetRequest) { r.ErrorTrace = true @@ -288,6 +305,7 @@ func (f Mget) WithErrorTrace() func(*MgetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Mget) WithFilterPath(v ...string) func(*MgetRequest) { return func(r *MgetRequest) { r.FilterPath = v @@ -295,6 +313,7 @@ func (f Mget) WithFilterPath(v ...string) func(*MgetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Mget) WithHeader(h map[string]string) func(*MgetRequest) { return func(r *MgetRequest) { if r.Header == nil { @@ -307,6 +326,7 @@ func (f Mget) WithHeader(h map[string]string) func(*MgetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Mget) WithOpaqueID(s string) func(*MgetRequest) { return func(r *MgetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch.go index eff9dc58d69..a52fcecfcb7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMsearchFunc(t Transport) Msearch { // Msearch allows to execute several search operations in one request. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html. +// type Msearch func(body io.Reader, o ...func(*MsearchRequest)) (*Response, error) // MsearchRequest configures the Msearch API request. +// type MsearchRequest struct { Index []string DocumentType []string @@ -70,6 +72,7 @@ type MsearchRequest struct { } // Do executes the request and returns response or error. +// func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -150,6 +153,10 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -162,10 +169,6 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -185,6 +188,7 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Msearch) WithContext(v context.Context) func(*MsearchRequest) { return func(r *MsearchRequest) { r.ctx = v @@ -192,6 +196,7 @@ func (f Msearch) WithContext(v context.Context) func(*MsearchRequest) { } // WithIndex - a list of index names to use as default. +// func (f Msearch) WithIndex(v ...string) func(*MsearchRequest) { return func(r *MsearchRequest) { r.Index = v @@ -199,6 +204,7 @@ func (f Msearch) WithIndex(v ...string) func(*MsearchRequest) { } // WithDocumentType - a list of document types to use as default. +// func (f Msearch) WithDocumentType(v ...string) func(*MsearchRequest) { return func(r *MsearchRequest) { r.DocumentType = v @@ -206,6 +212,7 @@ func (f Msearch) WithDocumentType(v ...string) func(*MsearchRequest) { } // WithCcsMinimizeRoundtrips - indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. +// func (f Msearch) WithCcsMinimizeRoundtrips(v bool) func(*MsearchRequest) { return func(r *MsearchRequest) { r.CcsMinimizeRoundtrips = &v @@ -213,6 +220,7 @@ func (f Msearch) WithCcsMinimizeRoundtrips(v bool) func(*MsearchRequest) { } // WithMaxConcurrentSearches - controls the maximum number of concurrent searches the multi search api will execute. +// func (f Msearch) WithMaxConcurrentSearches(v int) func(*MsearchRequest) { return func(r *MsearchRequest) { r.MaxConcurrentSearches = &v @@ -220,6 +228,7 @@ func (f Msearch) WithMaxConcurrentSearches(v int) func(*MsearchRequest) { } // WithMaxConcurrentShardRequests - the number of concurrent shard requests each sub search executes concurrently per node. this value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. +// func (f Msearch) WithMaxConcurrentShardRequests(v int) func(*MsearchRequest) { return func(r *MsearchRequest) { r.MaxConcurrentShardRequests = &v @@ -227,6 +236,7 @@ func (f Msearch) WithMaxConcurrentShardRequests(v int) func(*MsearchRequest) { } // WithPreFilterShardSize - a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.. +// func (f Msearch) WithPreFilterShardSize(v int) func(*MsearchRequest) { return func(r *MsearchRequest) { r.PreFilterShardSize = &v @@ -234,6 +244,7 @@ func (f Msearch) WithPreFilterShardSize(v int) func(*MsearchRequest) { } // WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// func (f Msearch) WithRestTotalHitsAsInt(v bool) func(*MsearchRequest) { return func(r *MsearchRequest) { r.RestTotalHitsAsInt = &v @@ -241,6 +252,7 @@ func (f Msearch) WithRestTotalHitsAsInt(v bool) func(*MsearchRequest) { } // WithSearchType - search operation type. +// func (f Msearch) WithSearchType(v string) func(*MsearchRequest) { return func(r *MsearchRequest) { r.SearchType = v @@ -248,6 +260,7 @@ func (f Msearch) WithSearchType(v string) func(*MsearchRequest) { } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f Msearch) WithTypedKeys(v bool) func(*MsearchRequest) { return func(r *MsearchRequest) { r.TypedKeys = &v @@ -255,6 +268,7 @@ func (f Msearch) WithTypedKeys(v bool) func(*MsearchRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Msearch) WithPretty() func(*MsearchRequest) { return func(r *MsearchRequest) { r.Pretty = true @@ -262,6 +276,7 @@ func (f Msearch) WithPretty() func(*MsearchRequest) { } // WithHuman makes statistical values human-readable. +// func (f Msearch) WithHuman() func(*MsearchRequest) { return func(r *MsearchRequest) { r.Human = true @@ -269,6 +284,7 @@ func (f Msearch) WithHuman() func(*MsearchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Msearch) WithErrorTrace() func(*MsearchRequest) { return func(r *MsearchRequest) { r.ErrorTrace = true @@ -276,6 +292,7 @@ func (f Msearch) WithErrorTrace() func(*MsearchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Msearch) WithFilterPath(v ...string) func(*MsearchRequest) { return func(r *MsearchRequest) { r.FilterPath = v @@ -283,6 +300,7 @@ func (f Msearch) WithFilterPath(v ...string) func(*MsearchRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Msearch) WithHeader(h map[string]string) func(*MsearchRequest) { return func(r *MsearchRequest) { if r.Header == nil { @@ -295,6 +313,7 @@ func (f Msearch) WithHeader(h map[string]string) func(*MsearchRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Msearch) WithOpaqueID(s string) func(*MsearchRequest) { return func(r *MsearchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch_template.go index 53b0ecad00c..17fc289634c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.msearch_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMsearchTemplateFunc(t Transport) MsearchTemplate { // MsearchTemplate allows to execute several search template operations in one request. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html. +// type MsearchTemplate func(body io.Reader, o ...func(*MsearchTemplateRequest)) (*Response, error) // MsearchTemplateRequest configures the Msearch Template API request. +// type MsearchTemplateRequest struct { Index []string DocumentType []string @@ -68,6 +70,7 @@ type MsearchTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,10 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -154,10 +161,6 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -177,6 +180,7 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f MsearchTemplate) WithContext(v context.Context) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.ctx = v @@ -184,6 +188,7 @@ func (f MsearchTemplate) WithContext(v context.Context) func(*MsearchTemplateReq } // WithIndex - a list of index names to use as default. +// func (f MsearchTemplate) WithIndex(v ...string) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.Index = v @@ -191,6 +196,7 @@ func (f MsearchTemplate) WithIndex(v ...string) func(*MsearchTemplateRequest) { } // WithDocumentType - a list of document types to use as default. +// func (f MsearchTemplate) WithDocumentType(v ...string) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.DocumentType = v @@ -198,6 +204,7 @@ func (f MsearchTemplate) WithDocumentType(v ...string) func(*MsearchTemplateRequ } // WithCcsMinimizeRoundtrips - indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. +// func (f MsearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.CcsMinimizeRoundtrips = &v @@ -205,6 +212,7 @@ func (f MsearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*MsearchTemplate } // WithMaxConcurrentSearches - controls the maximum number of concurrent searches the multi search api will execute. +// func (f MsearchTemplate) WithMaxConcurrentSearches(v int) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.MaxConcurrentSearches = &v @@ -212,6 +220,7 @@ func (f MsearchTemplate) WithMaxConcurrentSearches(v int) func(*MsearchTemplateR } // WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// func (f MsearchTemplate) WithRestTotalHitsAsInt(v bool) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.RestTotalHitsAsInt = &v @@ -219,6 +228,7 @@ func (f MsearchTemplate) WithRestTotalHitsAsInt(v bool) func(*MsearchTemplateReq } // WithSearchType - search operation type. +// func (f MsearchTemplate) WithSearchType(v string) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.SearchType = v @@ -226,6 +236,7 @@ func (f MsearchTemplate) WithSearchType(v string) func(*MsearchTemplateRequest) } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f MsearchTemplate) WithTypedKeys(v bool) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.TypedKeys = &v @@ -233,6 +244,7 @@ func (f MsearchTemplate) WithTypedKeys(v bool) func(*MsearchTemplateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MsearchTemplate) WithPretty() func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.Pretty = true @@ -240,6 +252,7 @@ func (f MsearchTemplate) WithPretty() func(*MsearchTemplateRequest) { } // WithHuman makes statistical values human-readable. +// func (f MsearchTemplate) WithHuman() func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.Human = true @@ -247,6 +260,7 @@ func (f MsearchTemplate) WithHuman() func(*MsearchTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MsearchTemplate) WithErrorTrace() func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.ErrorTrace = true @@ -254,6 +268,7 @@ func (f MsearchTemplate) WithErrorTrace() func(*MsearchTemplateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MsearchTemplate) WithFilterPath(v ...string) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { r.FilterPath = v @@ -261,6 +276,7 @@ func (f MsearchTemplate) WithFilterPath(v ...string) func(*MsearchTemplateReques } // WithHeader adds the headers to the HTTP request. +// func (f MsearchTemplate) WithHeader(h map[string]string) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { if r.Header == nil { @@ -273,6 +289,7 @@ func (f MsearchTemplate) WithHeader(h map[string]string) func(*MsearchTemplateRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MsearchTemplate) WithOpaqueID(s string) func(*MsearchTemplateRequest) { return func(r *MsearchTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mtermvectors.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mtermvectors.go index 0f9980fff0f..8daaf1e2a74 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mtermvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.mtermvectors.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMtermvectorsFunc(t Transport) Mtermvectors { // Mtermvectors returns multiple termvectors in one request. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html. +// type Mtermvectors func(o ...func(*MtermvectorsRequest)) (*Response, error) // MtermvectorsRequest configures the Mtermvectors API request. +// type MtermvectorsRequest struct { Index string DocumentType string @@ -75,6 +77,7 @@ type MtermvectorsRequest struct { } // Do executes the request and returns response or error. +// func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -175,6 +178,10 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -187,10 +194,6 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -210,6 +213,7 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f Mtermvectors) WithContext(v context.Context) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.ctx = v @@ -217,6 +221,7 @@ func (f Mtermvectors) WithContext(v context.Context) func(*MtermvectorsRequest) } // WithBody - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.. +// func (f Mtermvectors) WithBody(v io.Reader) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Body = v @@ -224,6 +229,7 @@ func (f Mtermvectors) WithBody(v io.Reader) func(*MtermvectorsRequest) { } // WithIndex - the index in which the document resides.. +// func (f Mtermvectors) WithIndex(v string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Index = v @@ -231,6 +237,7 @@ func (f Mtermvectors) WithIndex(v string) func(*MtermvectorsRequest) { } // WithDocumentType - the type of the document.. +// func (f Mtermvectors) WithDocumentType(v string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.DocumentType = v @@ -238,6 +245,7 @@ func (f Mtermvectors) WithDocumentType(v string) func(*MtermvectorsRequest) { } // WithFields - a list of fields to return. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithFields(v ...string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Fields = v @@ -245,6 +253,7 @@ func (f Mtermvectors) WithFields(v ...string) func(*MtermvectorsRequest) { } // WithFieldStatistics - specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithFieldStatistics(v bool) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.FieldStatistics = &v @@ -252,6 +261,7 @@ func (f Mtermvectors) WithFieldStatistics(v bool) func(*MtermvectorsRequest) { } // WithIds - a list of documents ids. you must define ids as parameter or set "ids" or "docs" in the request body. +// func (f Mtermvectors) WithIds(v ...string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Ids = v @@ -259,6 +269,7 @@ func (f Mtermvectors) WithIds(v ...string) func(*MtermvectorsRequest) { } // WithOffsets - specifies if term offsets should be returned. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithOffsets(v bool) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Offsets = &v @@ -266,6 +277,7 @@ func (f Mtermvectors) WithOffsets(v bool) func(*MtermvectorsRequest) { } // WithPayloads - specifies if term payloads should be returned. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithPayloads(v bool) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Payloads = &v @@ -273,6 +285,7 @@ func (f Mtermvectors) WithPayloads(v bool) func(*MtermvectorsRequest) { } // WithPositions - specifies if term positions should be returned. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithPositions(v bool) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Positions = &v @@ -280,6 +293,7 @@ func (f Mtermvectors) WithPositions(v bool) func(*MtermvectorsRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random) .applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithPreference(v string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Preference = v @@ -287,6 +301,7 @@ func (f Mtermvectors) WithPreference(v string) func(*MtermvectorsRequest) { } // WithRealtime - specifies if requests are real-time as opposed to near-real-time (default: true).. +// func (f Mtermvectors) WithRealtime(v bool) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Realtime = &v @@ -294,6 +309,7 @@ func (f Mtermvectors) WithRealtime(v bool) func(*MtermvectorsRequest) { } // WithRouting - specific routing value. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithRouting(v string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Routing = v @@ -301,6 +317,7 @@ func (f Mtermvectors) WithRouting(v string) func(*MtermvectorsRequest) { } // WithTermStatistics - specifies if total term frequency and document frequency should be returned. applies to all returned documents unless otherwise specified in body "params" or "docs".. +// func (f Mtermvectors) WithTermStatistics(v bool) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.TermStatistics = &v @@ -308,6 +325,7 @@ func (f Mtermvectors) WithTermStatistics(v bool) func(*MtermvectorsRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Mtermvectors) WithVersion(v int) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Version = &v @@ -315,6 +333,7 @@ func (f Mtermvectors) WithVersion(v int) func(*MtermvectorsRequest) { } // WithVersionType - specific version type. +// func (f Mtermvectors) WithVersionType(v string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.VersionType = v @@ -322,6 +341,7 @@ func (f Mtermvectors) WithVersionType(v string) func(*MtermvectorsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Mtermvectors) WithPretty() func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Pretty = true @@ -329,6 +349,7 @@ func (f Mtermvectors) WithPretty() func(*MtermvectorsRequest) { } // WithHuman makes statistical values human-readable. +// func (f Mtermvectors) WithHuman() func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Human = true @@ -336,6 +357,7 @@ func (f Mtermvectors) WithHuman() func(*MtermvectorsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Mtermvectors) WithErrorTrace() func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.ErrorTrace = true @@ -343,6 +365,7 @@ func (f Mtermvectors) WithErrorTrace() func(*MtermvectorsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Mtermvectors) WithFilterPath(v ...string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.FilterPath = v @@ -350,6 +373,7 @@ func (f Mtermvectors) WithFilterPath(v ...string) func(*MtermvectorsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Mtermvectors) WithHeader(h map[string]string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { if r.Header == nil { @@ -362,6 +386,7 @@ func (f Mtermvectors) WithHeader(h map[string]string) func(*MtermvectorsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Mtermvectors) WithOpaqueID(s string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.clear_repositories_metering_archive.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.clear_repositories_metering_archive.go index 67bdc6e0fb8..5577038530d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.clear_repositories_metering_archive.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.clear_repositories_metering_archive.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newNodesClearRepositoriesMeteringArchiveFunc(t Transport) NodesClearReposit // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html. +// type NodesClearRepositoriesMeteringArchive func(node_id []string, max_archive_version *int, o ...func(*NodesClearRepositoriesMeteringArchiveRequest)) (*Response, error) // NodesClearRepositoriesMeteringArchiveRequest configures the Nodes Clear Repositories Metering Archive API request. +// type NodesClearRepositoriesMeteringArchiveRequest struct { MaxArchiveVersion *int NodeID []string @@ -62,6 +64,7 @@ type NodesClearRepositoriesMeteringArchiveRequest struct { } // Do executes the request and returns response or error. +// func (r NodesClearRepositoriesMeteringArchiveRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -150,6 +153,7 @@ func (r NodesClearRepositoriesMeteringArchiveRequest) Do(ctx context.Context, tr } // WithContext sets the request context. +// func (f NodesClearRepositoriesMeteringArchive) WithContext(v context.Context) func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { r.ctx = v @@ -157,6 +161,7 @@ func (f NodesClearRepositoriesMeteringArchive) WithContext(v context.Context) fu } // WithPretty makes the response body pretty-printed. +// func (f NodesClearRepositoriesMeteringArchive) WithPretty() func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { r.Pretty = true @@ -164,6 +169,7 @@ func (f NodesClearRepositoriesMeteringArchive) WithPretty() func(*NodesClearRepo } // WithHuman makes statistical values human-readable. +// func (f NodesClearRepositoriesMeteringArchive) WithHuman() func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { r.Human = true @@ -171,6 +177,7 @@ func (f NodesClearRepositoriesMeteringArchive) WithHuman() func(*NodesClearRepos } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesClearRepositoriesMeteringArchive) WithErrorTrace() func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { r.ErrorTrace = true @@ -178,6 +185,7 @@ func (f NodesClearRepositoriesMeteringArchive) WithErrorTrace() func(*NodesClear } // WithFilterPath filters the properties of the response body. +// func (f NodesClearRepositoriesMeteringArchive) WithFilterPath(v ...string) func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { r.FilterPath = v @@ -185,6 +193,7 @@ func (f NodesClearRepositoriesMeteringArchive) WithFilterPath(v ...string) func( } // WithHeader adds the headers to the HTTP request. +// func (f NodesClearRepositoriesMeteringArchive) WithHeader(h map[string]string) func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { if r.Header == nil { @@ -197,6 +206,7 @@ func (f NodesClearRepositoriesMeteringArchive) WithHeader(h map[string]string) f } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesClearRepositoriesMeteringArchive) WithOpaqueID(s string) func(*NodesClearRepositoriesMeteringArchiveRequest) { return func(r *NodesClearRepositoriesMeteringArchiveRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.get_repositories_metering_info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.get_repositories_metering_info.go index dcc47c13166..a57fa127208 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.get_repositories_metering_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.get_repositories_metering_info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newNodesGetRepositoriesMeteringInfoFunc(t Transport) NodesGetRepositoriesMe // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html. +// type NodesGetRepositoriesMeteringInfo func(node_id []string, o ...func(*NodesGetRepositoriesMeteringInfoRequest)) (*Response, error) // NodesGetRepositoriesMeteringInfoRequest configures the Nodes Get Repositories Metering Info API request. +// type NodesGetRepositoriesMeteringInfoRequest struct { NodeID []string @@ -60,6 +62,7 @@ type NodesGetRepositoriesMeteringInfoRequest struct { } // Do executes the request and returns response or error. +// func (r NodesGetRepositoriesMeteringInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r NodesGetRepositoriesMeteringInfoRequest) Do(ctx context.Context, transpo } // WithContext sets the request context. +// func (f NodesGetRepositoriesMeteringInfo) WithContext(v context.Context) func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f NodesGetRepositoriesMeteringInfo) WithContext(v context.Context) func(*N } // WithPretty makes the response body pretty-printed. +// func (f NodesGetRepositoriesMeteringInfo) WithPretty() func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f NodesGetRepositoriesMeteringInfo) WithPretty() func(*NodesGetRepositorie } // WithHuman makes statistical values human-readable. +// func (f NodesGetRepositoriesMeteringInfo) WithHuman() func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f NodesGetRepositoriesMeteringInfo) WithHuman() func(*NodesGetRepositories } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesGetRepositoriesMeteringInfo) WithErrorTrace() func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f NodesGetRepositoriesMeteringInfo) WithErrorTrace() func(*NodesGetReposit } // WithFilterPath filters the properties of the response body. +// func (f NodesGetRepositoriesMeteringInfo) WithFilterPath(v ...string) func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f NodesGetRepositoriesMeteringInfo) WithFilterPath(v ...string) func(*Node } // WithHeader adds the headers to the HTTP request. +// func (f NodesGetRepositoriesMeteringInfo) WithHeader(h map[string]string) func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f NodesGetRepositoriesMeteringInfo) WithHeader(h map[string]string) func(* } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesGetRepositoriesMeteringInfo) WithOpaqueID(s string) func(*NodesGetRepositoriesMeteringInfoRequest) { return func(r *NodesGetRepositoriesMeteringInfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.hot_threads.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.hot_threads.go index 3006fc54a39..cb369633ed7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.hot_threads.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.hot_threads.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newNodesHotThreadsFunc(t Transport) NodesHotThreads { // NodesHotThreads returns information about hot threads on each node in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html. +// type NodesHotThreads func(o ...func(*NodesHotThreadsRequest)) (*Response, error) // NodesHotThreadsRequest configures the Nodes Hot Threads API request. +// type NodesHotThreadsRequest struct { NodeID []string @@ -67,6 +69,7 @@ type NodesHotThreadsRequest struct { } // Do executes the request and returns response or error. +// func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -178,6 +181,7 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f NodesHotThreads) WithContext(v context.Context) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.ctx = v @@ -185,6 +189,7 @@ func (f NodesHotThreads) WithContext(v context.Context) func(*NodesHotThreadsReq } // WithNodeID - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f NodesHotThreads) WithNodeID(v ...string) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.NodeID = v @@ -192,6 +197,7 @@ func (f NodesHotThreads) WithNodeID(v ...string) func(*NodesHotThreadsRequest) { } // WithIgnoreIdleThreads - don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true). +// func (f NodesHotThreads) WithIgnoreIdleThreads(v bool) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.IgnoreIdleThreads = &v @@ -199,6 +205,7 @@ func (f NodesHotThreads) WithIgnoreIdleThreads(v bool) func(*NodesHotThreadsRequ } // WithInterval - the interval for the second sampling of threads. +// func (f NodesHotThreads) WithInterval(v time.Duration) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Interval = v @@ -206,6 +213,7 @@ func (f NodesHotThreads) WithInterval(v time.Duration) func(*NodesHotThreadsRequ } // WithSnapshots - number of samples of thread stacktrace (default: 10). +// func (f NodesHotThreads) WithSnapshots(v int) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Snapshots = &v @@ -213,6 +221,7 @@ func (f NodesHotThreads) WithSnapshots(v int) func(*NodesHotThreadsRequest) { } // WithSort - the sort order for 'cpu' type (default: total). +// func (f NodesHotThreads) WithSort(v string) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Sort = v @@ -220,6 +229,7 @@ func (f NodesHotThreads) WithSort(v string) func(*NodesHotThreadsRequest) { } // WithThreads - specify the number of threads to provide information for (default: 3). +// func (f NodesHotThreads) WithThreads(v int) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Threads = &v @@ -227,6 +237,7 @@ func (f NodesHotThreads) WithThreads(v int) func(*NodesHotThreadsRequest) { } // WithTimeout - explicit operation timeout. +// func (f NodesHotThreads) WithTimeout(v time.Duration) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Timeout = v @@ -234,6 +245,7 @@ func (f NodesHotThreads) WithTimeout(v time.Duration) func(*NodesHotThreadsReque } // WithDocumentType - the type to sample (default: cpu). +// func (f NodesHotThreads) WithDocumentType(v string) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.DocumentType = v @@ -241,6 +253,7 @@ func (f NodesHotThreads) WithDocumentType(v string) func(*NodesHotThreadsRequest } // WithPretty makes the response body pretty-printed. +// func (f NodesHotThreads) WithPretty() func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Pretty = true @@ -248,6 +261,7 @@ func (f NodesHotThreads) WithPretty() func(*NodesHotThreadsRequest) { } // WithHuman makes statistical values human-readable. +// func (f NodesHotThreads) WithHuman() func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.Human = true @@ -255,6 +269,7 @@ func (f NodesHotThreads) WithHuman() func(*NodesHotThreadsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesHotThreads) WithErrorTrace() func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.ErrorTrace = true @@ -262,6 +277,7 @@ func (f NodesHotThreads) WithErrorTrace() func(*NodesHotThreadsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f NodesHotThreads) WithFilterPath(v ...string) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { r.FilterPath = v @@ -269,6 +285,7 @@ func (f NodesHotThreads) WithFilterPath(v ...string) func(*NodesHotThreadsReques } // WithHeader adds the headers to the HTTP request. +// func (f NodesHotThreads) WithHeader(h map[string]string) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { if r.Header == nil { @@ -281,6 +298,7 @@ func (f NodesHotThreads) WithHeader(h map[string]string) func(*NodesHotThreadsRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesHotThreads) WithOpaqueID(s string) func(*NodesHotThreadsRequest) { return func(r *NodesHotThreadsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.info.go index ebcc96aa5b9..6e9a152c054 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newNodesInfoFunc(t Transport) NodesInfo { // NodesInfo returns information about nodes in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html. +// type NodesInfo func(o ...func(*NodesInfoRequest)) (*Response, error) // NodesInfoRequest configures the Nodes Info API request. +// type NodesInfoRequest struct { Metric []string NodeID []string @@ -63,6 +65,7 @@ type NodesInfoRequest struct { } // Do executes the request and returns response or error. +// func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -154,6 +157,7 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f NodesInfo) WithContext(v context.Context) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f NodesInfo) WithContext(v context.Context) func(*NodesInfoRequest) { } // WithMetric - a list of metrics you wish returned. leave empty to return all metrics.. +// func (f NodesInfo) WithMetric(v ...string) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.Metric = v @@ -168,6 +173,7 @@ func (f NodesInfo) WithMetric(v ...string) func(*NodesInfoRequest) { } // WithNodeID - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f NodesInfo) WithNodeID(v ...string) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.NodeID = v @@ -175,6 +181,7 @@ func (f NodesInfo) WithNodeID(v ...string) func(*NodesInfoRequest) { } // WithFlatSettings - return settings in flat format (default: false). +// func (f NodesInfo) WithFlatSettings(v bool) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.FlatSettings = &v @@ -182,6 +189,7 @@ func (f NodesInfo) WithFlatSettings(v bool) func(*NodesInfoRequest) { } // WithTimeout - explicit operation timeout. +// func (f NodesInfo) WithTimeout(v time.Duration) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.Timeout = v @@ -189,6 +197,7 @@ func (f NodesInfo) WithTimeout(v time.Duration) func(*NodesInfoRequest) { } // WithPretty makes the response body pretty-printed. +// func (f NodesInfo) WithPretty() func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.Pretty = true @@ -196,6 +205,7 @@ func (f NodesInfo) WithPretty() func(*NodesInfoRequest) { } // WithHuman makes statistical values human-readable. +// func (f NodesInfo) WithHuman() func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.Human = true @@ -203,6 +213,7 @@ func (f NodesInfo) WithHuman() func(*NodesInfoRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesInfo) WithErrorTrace() func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.ErrorTrace = true @@ -210,6 +221,7 @@ func (f NodesInfo) WithErrorTrace() func(*NodesInfoRequest) { } // WithFilterPath filters the properties of the response body. +// func (f NodesInfo) WithFilterPath(v ...string) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { r.FilterPath = v @@ -217,6 +229,7 @@ func (f NodesInfo) WithFilterPath(v ...string) func(*NodesInfoRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f NodesInfo) WithHeader(h map[string]string) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { if r.Header == nil { @@ -229,6 +242,7 @@ func (f NodesInfo) WithHeader(h map[string]string) func(*NodesInfoRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesInfo) WithOpaqueID(s string) func(*NodesInfoRequest) { return func(r *NodesInfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.reload_secure_settings.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.reload_secure_settings.go index fe93b4c3e6a..dd41b6ed171 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.reload_secure_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.reload_secure_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newNodesReloadSecureSettingsFunc(t Transport) NodesReloadSecureSettings { // NodesReloadSecureSettings reloads secure settings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings. +// type NodesReloadSecureSettings func(o ...func(*NodesReloadSecureSettingsRequest)) (*Response, error) // NodesReloadSecureSettingsRequest configures the Nodes Reload Secure Settings API request. +// type NodesReloadSecureSettingsRequest struct { Body io.Reader @@ -63,6 +65,7 @@ type NodesReloadSecureSettingsRequest struct { } // Do executes the request and returns response or error. +// func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -117,6 +120,10 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran 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 @@ -129,10 +136,6 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -152,6 +155,7 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f NodesReloadSecureSettings) WithContext(v context.Context) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f NodesReloadSecureSettings) WithContext(v context.Context) func(*NodesRel } // WithBody - An object containing the password for the elasticsearch keystore. +// func (f NodesReloadSecureSettings) WithBody(v io.Reader) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.Body = v @@ -166,6 +171,7 @@ func (f NodesReloadSecureSettings) WithBody(v io.Reader) func(*NodesReloadSecure } // WithNodeID - a list of node ids to span the reload/reinit call. should stay empty because reloading usually involves all cluster nodes.. +// func (f NodesReloadSecureSettings) WithNodeID(v ...string) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.NodeID = v @@ -173,6 +179,7 @@ func (f NodesReloadSecureSettings) WithNodeID(v ...string) func(*NodesReloadSecu } // WithTimeout - explicit operation timeout. +// func (f NodesReloadSecureSettings) WithTimeout(v time.Duration) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.Timeout = v @@ -180,6 +187,7 @@ func (f NodesReloadSecureSettings) WithTimeout(v time.Duration) func(*NodesReloa } // WithPretty makes the response body pretty-printed. +// func (f NodesReloadSecureSettings) WithPretty() func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f NodesReloadSecureSettings) WithPretty() func(*NodesReloadSecureSettingsR } // WithHuman makes statistical values human-readable. +// func (f NodesReloadSecureSettings) WithHuman() func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f NodesReloadSecureSettings) WithHuman() func(*NodesReloadSecureSettingsRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesReloadSecureSettings) WithErrorTrace() func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f NodesReloadSecureSettings) WithErrorTrace() func(*NodesReloadSecureSetti } // WithFilterPath filters the properties of the response body. +// func (f NodesReloadSecureSettings) WithFilterPath(v ...string) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f NodesReloadSecureSettings) WithFilterPath(v ...string) func(*NodesReload } // WithHeader adds the headers to the HTTP request. +// func (f NodesReloadSecureSettings) WithHeader(h map[string]string) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f NodesReloadSecureSettings) WithHeader(h map[string]string) func(*NodesRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesReloadSecureSettings) WithOpaqueID(s string) func(*NodesReloadSecureSettingsRequest) { return func(r *NodesReloadSecureSettingsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.stats.go index 93b1bdcd8b4..5a03e031f0a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newNodesStatsFunc(t Transport) NodesStats { // NodesStats returns statistical information about nodes in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html. +// type NodesStats func(o ...func(*NodesStatsRequest)) (*Response, error) // NodesStatsRequest configures the Nodes Stats API request. +// type NodesStatsRequest struct { IndexMetric []string Metric []string @@ -71,6 +73,7 @@ type NodesStatsRequest struct { } // Do executes the request and returns response or error. +// func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -196,6 +199,7 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f NodesStats) WithContext(v context.Context) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.ctx = v @@ -203,6 +207,7 @@ func (f NodesStats) WithContext(v context.Context) func(*NodesStatsRequest) { } // WithIndexMetric - limit the information returned for `indices` metric to the specific index metrics. isn't used if `indices` (or `all`) metric isn't specified.. +// func (f NodesStats) WithIndexMetric(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.IndexMetric = v @@ -210,6 +215,7 @@ func (f NodesStats) WithIndexMetric(v ...string) func(*NodesStatsRequest) { } // WithMetric - limit the information returned to the specified metrics. +// func (f NodesStats) WithMetric(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Metric = v @@ -217,6 +223,7 @@ func (f NodesStats) WithMetric(v ...string) func(*NodesStatsRequest) { } // WithNodeID - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f NodesStats) WithNodeID(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.NodeID = v @@ -224,6 +231,7 @@ func (f NodesStats) WithNodeID(v ...string) func(*NodesStatsRequest) { } // WithCompletionFields - a list of fields for `fielddata` and `suggest` index metric (supports wildcards). +// func (f NodesStats) WithCompletionFields(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.CompletionFields = v @@ -231,6 +239,7 @@ func (f NodesStats) WithCompletionFields(v ...string) func(*NodesStatsRequest) { } // WithFielddataFields - a list of fields for `fielddata` index metric (supports wildcards). +// func (f NodesStats) WithFielddataFields(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.FielddataFields = v @@ -238,6 +247,7 @@ func (f NodesStats) WithFielddataFields(v ...string) func(*NodesStatsRequest) { } // WithFields - a list of fields for `fielddata` and `completion` index metric (supports wildcards). +// func (f NodesStats) WithFields(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Fields = v @@ -245,6 +255,7 @@ func (f NodesStats) WithFields(v ...string) func(*NodesStatsRequest) { } // WithGroups - a list of search groups for `search` index metric. +// func (f NodesStats) WithGroups(v bool) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Groups = &v @@ -252,6 +263,7 @@ func (f NodesStats) WithGroups(v bool) func(*NodesStatsRequest) { } // WithIncludeSegmentFileSizes - whether to report the aggregated disk usage of each one of the lucene index files (only applies if segment stats are requested). +// func (f NodesStats) WithIncludeSegmentFileSizes(v bool) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.IncludeSegmentFileSizes = &v @@ -259,6 +271,7 @@ func (f NodesStats) WithIncludeSegmentFileSizes(v bool) func(*NodesStatsRequest) } // WithIncludeUnloadedSegments - if set to true segment stats will include stats for segments that are not currently loaded into memory. +// func (f NodesStats) WithIncludeUnloadedSegments(v bool) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.IncludeUnloadedSegments = &v @@ -266,6 +279,7 @@ func (f NodesStats) WithIncludeUnloadedSegments(v bool) func(*NodesStatsRequest) } // WithLevel - return indices stats aggregated at index, node or shard level. +// func (f NodesStats) WithLevel(v string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Level = v @@ -273,6 +287,7 @@ func (f NodesStats) WithLevel(v string) func(*NodesStatsRequest) { } // WithTimeout - explicit operation timeout. +// func (f NodesStats) WithTimeout(v time.Duration) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Timeout = v @@ -280,6 +295,7 @@ func (f NodesStats) WithTimeout(v time.Duration) func(*NodesStatsRequest) { } // WithTypes - a list of document types for the `indexing` index metric. +// func (f NodesStats) WithTypes(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Types = v @@ -287,6 +303,7 @@ func (f NodesStats) WithTypes(v ...string) func(*NodesStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f NodesStats) WithPretty() func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Pretty = true @@ -294,6 +311,7 @@ func (f NodesStats) WithPretty() func(*NodesStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f NodesStats) WithHuman() func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.Human = true @@ -301,6 +319,7 @@ func (f NodesStats) WithHuman() func(*NodesStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesStats) WithErrorTrace() func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.ErrorTrace = true @@ -308,6 +327,7 @@ func (f NodesStats) WithErrorTrace() func(*NodesStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f NodesStats) WithFilterPath(v ...string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { r.FilterPath = v @@ -315,6 +335,7 @@ func (f NodesStats) WithFilterPath(v ...string) func(*NodesStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f NodesStats) WithHeader(h map[string]string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { if r.Header == nil { @@ -327,6 +348,7 @@ func (f NodesStats) WithHeader(h map[string]string) func(*NodesStatsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesStats) WithOpaqueID(s string) func(*NodesStatsRequest) { return func(r *NodesStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.usage.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.usage.go index c6ceb6e8ec2..af1c9695134 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.nodes.usage.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newNodesUsageFunc(t Transport) NodesUsage { // NodesUsage returns low-level information about REST actions usage on nodes. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html. +// type NodesUsage func(o ...func(*NodesUsageRequest)) (*Response, error) // NodesUsageRequest configures the Nodes Usage API request. +// type NodesUsageRequest struct { Metric []string NodeID []string @@ -61,6 +63,7 @@ type NodesUsageRequest struct { } // Do executes the request and returns response or error. +// func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -150,6 +153,7 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f NodesUsage) WithContext(v context.Context) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.ctx = v @@ -157,6 +161,7 @@ func (f NodesUsage) WithContext(v context.Context) func(*NodesUsageRequest) { } // WithMetric - limit the information returned to the specified metrics. +// func (f NodesUsage) WithMetric(v ...string) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.Metric = v @@ -164,6 +169,7 @@ func (f NodesUsage) WithMetric(v ...string) func(*NodesUsageRequest) { } // WithNodeID - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f NodesUsage) WithNodeID(v ...string) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.NodeID = v @@ -171,6 +177,7 @@ func (f NodesUsage) WithNodeID(v ...string) func(*NodesUsageRequest) { } // WithTimeout - explicit operation timeout. +// func (f NodesUsage) WithTimeout(v time.Duration) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.Timeout = v @@ -178,6 +185,7 @@ func (f NodesUsage) WithTimeout(v time.Duration) func(*NodesUsageRequest) { } // WithPretty makes the response body pretty-printed. +// func (f NodesUsage) WithPretty() func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.Pretty = true @@ -185,6 +193,7 @@ func (f NodesUsage) WithPretty() func(*NodesUsageRequest) { } // WithHuman makes statistical values human-readable. +// func (f NodesUsage) WithHuman() func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.Human = true @@ -192,6 +201,7 @@ func (f NodesUsage) WithHuman() func(*NodesUsageRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f NodesUsage) WithErrorTrace() func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.ErrorTrace = true @@ -199,6 +209,7 @@ func (f NodesUsage) WithErrorTrace() func(*NodesUsageRequest) { } // WithFilterPath filters the properties of the response body. +// func (f NodesUsage) WithFilterPath(v ...string) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { r.FilterPath = v @@ -206,6 +217,7 @@ func (f NodesUsage) WithFilterPath(v ...string) func(*NodesUsageRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f NodesUsage) WithHeader(h map[string]string) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { if r.Header == nil { @@ -218,6 +230,7 @@ func (f NodesUsage) WithHeader(h map[string]string) func(*NodesUsageRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f NodesUsage) WithOpaqueID(s string) func(*NodesUsageRequest) { return func(r *NodesUsageRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ping.go index ba424f3d21d..21e807433d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.ping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newPingFunc(t Transport) Ping { // Ping returns whether the cluster is running. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// type Ping func(o ...func(*PingRequest)) (*Response, error) // PingRequest configures the Ping API request. +// type PingRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type PingRequest struct { } // Do executes the request and returns response or error. +// func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, er } // WithContext sets the request context. +// func (f Ping) WithContext(v context.Context) func(*PingRequest) { return func(r *PingRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f Ping) WithContext(v context.Context) func(*PingRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Ping) WithPretty() func(*PingRequest) { return func(r *PingRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f Ping) WithPretty() func(*PingRequest) { } // WithHuman makes statistical values human-readable. +// func (f Ping) WithHuman() func(*PingRequest) { return func(r *PingRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f Ping) WithHuman() func(*PingRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Ping) WithErrorTrace() func(*PingRequest) { return func(r *PingRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f Ping) WithErrorTrace() func(*PingRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Ping) WithFilterPath(v ...string) func(*PingRequest) { return func(r *PingRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f Ping) WithFilterPath(v ...string) func(*PingRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Ping) WithHeader(h map[string]string) func(*PingRequest) { return func(r *PingRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f Ping) WithHeader(h map[string]string) func(*PingRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Ping) WithOpaqueID(s string) func(*PingRequest) { return func(r *PingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.put_script.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.put_script.go index bb840fec5fe..040b8493a1b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.put_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.put_script.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newPutScriptFunc(t Transport) PutScript { // PutScript creates or updates a script. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// type PutScript func(id string, body io.Reader, o ...func(*PutScriptRequest)) (*Response, error) // PutScriptRequest configures the Put Script API request. +// type PutScriptRequest struct { ScriptID string @@ -66,6 +68,7 @@ type PutScriptRequest struct { } // Do executes the request and returns response or error. +// func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -128,6 +131,10 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -140,10 +147,6 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -163,6 +166,7 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f PutScript) WithContext(v context.Context) func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.ctx = v @@ -170,6 +174,7 @@ func (f PutScript) WithContext(v context.Context) func(*PutScriptRequest) { } // WithScriptContext - script context. +// func (f PutScript) WithScriptContext(v string) func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.ScriptContext = v @@ -177,6 +182,7 @@ func (f PutScript) WithScriptContext(v string) func(*PutScriptRequest) { } // WithMasterTimeout - specify timeout for connection to master. +// func (f PutScript) WithMasterTimeout(v time.Duration) func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.MasterTimeout = v @@ -184,6 +190,7 @@ func (f PutScript) WithMasterTimeout(v time.Duration) func(*PutScriptRequest) { } // WithTimeout - explicit operation timeout. +// func (f PutScript) WithTimeout(v time.Duration) func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.Timeout = v @@ -191,6 +198,7 @@ func (f PutScript) WithTimeout(v time.Duration) func(*PutScriptRequest) { } // WithPretty makes the response body pretty-printed. +// func (f PutScript) WithPretty() func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.Pretty = true @@ -198,6 +206,7 @@ func (f PutScript) WithPretty() func(*PutScriptRequest) { } // WithHuman makes statistical values human-readable. +// func (f PutScript) WithHuman() func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.Human = true @@ -205,6 +214,7 @@ func (f PutScript) WithHuman() func(*PutScriptRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f PutScript) WithErrorTrace() func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.ErrorTrace = true @@ -212,6 +222,7 @@ func (f PutScript) WithErrorTrace() func(*PutScriptRequest) { } // WithFilterPath filters the properties of the response body. +// func (f PutScript) WithFilterPath(v ...string) func(*PutScriptRequest) { return func(r *PutScriptRequest) { r.FilterPath = v @@ -219,6 +230,7 @@ func (f PutScript) WithFilterPath(v ...string) func(*PutScriptRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f PutScript) WithHeader(h map[string]string) func(*PutScriptRequest) { return func(r *PutScriptRequest) { if r.Header == nil { @@ -231,6 +243,7 @@ func (f PutScript) WithHeader(h map[string]string) func(*PutScriptRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f PutScript) WithOpaqueID(s string) func(*PutScriptRequest) { return func(r *PutScriptRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.rank_eval.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.rank_eval.go index e380d2bc81e..d2ee83d0649 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.rank_eval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.rank_eval.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newRankEvalFunc(t Transport) RankEval { // RankEval allows to evaluate the quality of ranked search results over a set of typical search queries // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html. +// type RankEval func(body io.Reader, o ...func(*RankEvalRequest)) (*Response, error) // RankEvalRequest configures the Rank Eval API request. +// type RankEvalRequest struct { Index []string @@ -66,6 +68,7 @@ type RankEvalRequest struct { } // Do executes the request and returns response or error. +// func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response 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 @@ -142,10 +149,6 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f RankEval) WithContext(v context.Context) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f RankEval) WithContext(v context.Context) func(*RankEvalRequest) { } // WithIndex - a list of index names to search; use _all to perform the operation on all indices. +// func (f RankEval) WithIndex(v ...string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.Index = v @@ -179,6 +184,7 @@ func (f RankEval) WithIndex(v ...string) func(*RankEvalRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f RankEval) WithAllowNoIndices(v bool) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.AllowNoIndices = &v @@ -186,6 +192,7 @@ func (f RankEval) WithAllowNoIndices(v bool) func(*RankEvalRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f RankEval) WithExpandWildcards(v string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.ExpandWildcards = v @@ -193,6 +200,7 @@ func (f RankEval) WithExpandWildcards(v string) func(*RankEvalRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f RankEval) WithIgnoreUnavailable(v bool) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.IgnoreUnavailable = &v @@ -200,6 +208,7 @@ func (f RankEval) WithIgnoreUnavailable(v bool) func(*RankEvalRequest) { } // WithSearchType - search operation type. +// func (f RankEval) WithSearchType(v string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.SearchType = v @@ -207,6 +216,7 @@ func (f RankEval) WithSearchType(v string) func(*RankEvalRequest) { } // WithPretty makes the response body pretty-printed. +// func (f RankEval) WithPretty() func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.Pretty = true @@ -214,6 +224,7 @@ func (f RankEval) WithPretty() func(*RankEvalRequest) { } // WithHuman makes statistical values human-readable. +// func (f RankEval) WithHuman() func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.Human = true @@ -221,6 +232,7 @@ func (f RankEval) WithHuman() func(*RankEvalRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RankEval) WithErrorTrace() func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.ErrorTrace = true @@ -228,6 +240,7 @@ func (f RankEval) WithErrorTrace() func(*RankEvalRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RankEval) WithFilterPath(v ...string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.FilterPath = v @@ -235,6 +248,7 @@ func (f RankEval) WithFilterPath(v ...string) func(*RankEvalRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f RankEval) WithHeader(h map[string]string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { if r.Header == nil { @@ -247,6 +261,7 @@ func (f RankEval) WithHeader(h map[string]string) func(*RankEvalRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RankEval) WithOpaqueID(s string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex.go index f2e1f8e1d38..125b7a3faeb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -46,9 +46,11 @@ func newReindexFunc(t Transport) Reindex { // documents from a remote cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html. +// type Reindex func(body io.Reader, o ...func(*ReindexRequest)) (*Response, error) // ReindexRequest configures the Reindex API request. +// type ReindexRequest struct { Body io.Reader @@ -72,6 +74,7 @@ type ReindexRequest struct { } // Do executes the request and returns response or error. +// func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -147,6 +150,10 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -159,10 +166,6 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -182,6 +185,7 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Reindex) WithContext(v context.Context) func(*ReindexRequest) { return func(r *ReindexRequest) { r.ctx = v @@ -189,6 +193,7 @@ func (f Reindex) WithContext(v context.Context) func(*ReindexRequest) { } // WithMaxDocs - maximum number of documents to process (default: all documents). +// func (f Reindex) WithMaxDocs(v int) func(*ReindexRequest) { return func(r *ReindexRequest) { r.MaxDocs = &v @@ -196,6 +201,7 @@ func (f Reindex) WithMaxDocs(v int) func(*ReindexRequest) { } // WithRefresh - should the affected indexes be refreshed?. +// func (f Reindex) WithRefresh(v bool) func(*ReindexRequest) { return func(r *ReindexRequest) { r.Refresh = &v @@ -203,6 +209,7 @@ func (f Reindex) WithRefresh(v bool) func(*ReindexRequest) { } // WithRequestsPerSecond - the throttle to set on this request in sub-requests per second. -1 means no throttle.. +// func (f Reindex) WithRequestsPerSecond(v int) func(*ReindexRequest) { return func(r *ReindexRequest) { r.RequestsPerSecond = &v @@ -210,6 +217,7 @@ func (f Reindex) WithRequestsPerSecond(v int) func(*ReindexRequest) { } // WithScroll - control how long to keep the search context alive. +// func (f Reindex) WithScroll(v time.Duration) func(*ReindexRequest) { return func(r *ReindexRequest) { r.Scroll = v @@ -217,6 +225,7 @@ func (f Reindex) WithScroll(v time.Duration) func(*ReindexRequest) { } // WithSlices - the number of slices this task should be divided into. defaults to 1, meaning the task isn't sliced into subtasks. can be set to `auto`.. +// func (f Reindex) WithSlices(v interface{}) func(*ReindexRequest) { return func(r *ReindexRequest) { r.Slices = v @@ -224,6 +233,7 @@ func (f Reindex) WithSlices(v interface{}) func(*ReindexRequest) { } // WithTimeout - time each individual bulk request should wait for shards that are unavailable.. +// func (f Reindex) WithTimeout(v time.Duration) func(*ReindexRequest) { return func(r *ReindexRequest) { r.Timeout = v @@ -231,6 +241,7 @@ func (f Reindex) WithTimeout(v time.Duration) func(*ReindexRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the reindex operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f Reindex) WithWaitForActiveShards(v string) func(*ReindexRequest) { return func(r *ReindexRequest) { r.WaitForActiveShards = v @@ -238,6 +249,7 @@ func (f Reindex) WithWaitForActiveShards(v string) func(*ReindexRequest) { } // WithWaitForCompletion - should the request should block until the reindex is complete.. +// func (f Reindex) WithWaitForCompletion(v bool) func(*ReindexRequest) { return func(r *ReindexRequest) { r.WaitForCompletion = &v @@ -245,6 +257,7 @@ func (f Reindex) WithWaitForCompletion(v bool) func(*ReindexRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Reindex) WithPretty() func(*ReindexRequest) { return func(r *ReindexRequest) { r.Pretty = true @@ -252,6 +265,7 @@ func (f Reindex) WithPretty() func(*ReindexRequest) { } // WithHuman makes statistical values human-readable. +// func (f Reindex) WithHuman() func(*ReindexRequest) { return func(r *ReindexRequest) { r.Human = true @@ -259,6 +273,7 @@ func (f Reindex) WithHuman() func(*ReindexRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Reindex) WithErrorTrace() func(*ReindexRequest) { return func(r *ReindexRequest) { r.ErrorTrace = true @@ -266,6 +281,7 @@ func (f Reindex) WithErrorTrace() func(*ReindexRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Reindex) WithFilterPath(v ...string) func(*ReindexRequest) { return func(r *ReindexRequest) { r.FilterPath = v @@ -273,6 +289,7 @@ func (f Reindex) WithFilterPath(v ...string) func(*ReindexRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Reindex) WithHeader(h map[string]string) func(*ReindexRequest) { return func(r *ReindexRequest) { if r.Header == nil { @@ -285,6 +302,7 @@ func (f Reindex) WithHeader(h map[string]string) func(*ReindexRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Reindex) WithOpaqueID(s string) func(*ReindexRequest) { return func(r *ReindexRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex_rethrottle.go index ce9fcf581e2..ffad4c52175 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.reindex_rethrottle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newReindexRethrottleFunc(t Transport) ReindexRethrottle { // ReindexRethrottle changes the number of requests per second for a particular Reindex operation. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html. +// type ReindexRethrottle func(task_id string, requests_per_second *int, o ...func(*ReindexRethrottleRequest)) (*Response, error) // ReindexRethrottleRequest configures the Reindex Rethrottle API request. +// type ReindexRethrottleRequest struct { TaskID string @@ -60,6 +62,7 @@ type ReindexRethrottleRequest struct { } // Do executes the request and returns response or error. +// func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f ReindexRethrottle) WithContext(v context.Context) func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f ReindexRethrottle) WithContext(v context.Context) func(*ReindexRethrottl } // WithRequestsPerSecond - the throttle to set on this request in floating sub-requests per second. -1 means set no throttle.. +// func (f ReindexRethrottle) WithRequestsPerSecond(v int) func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { r.RequestsPerSecond = &v @@ -157,6 +162,7 @@ func (f ReindexRethrottle) WithRequestsPerSecond(v int) func(*ReindexRethrottleR } // WithPretty makes the response body pretty-printed. +// func (f ReindexRethrottle) WithPretty() func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f ReindexRethrottle) WithPretty() func(*ReindexRethrottleRequest) { } // WithHuman makes statistical values human-readable. +// func (f ReindexRethrottle) WithHuman() func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f ReindexRethrottle) WithHuman() func(*ReindexRethrottleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ReindexRethrottle) WithErrorTrace() func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f ReindexRethrottle) WithErrorTrace() func(*ReindexRethrottleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ReindexRethrottle) WithFilterPath(v ...string) func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f ReindexRethrottle) WithFilterPath(v ...string) func(*ReindexRethrottleRe } // WithHeader adds the headers to the HTTP request. +// func (f ReindexRethrottle) WithHeader(h map[string]string) func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f ReindexRethrottle) WithHeader(h map[string]string) func(*ReindexRethrott } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ReindexRethrottle) WithOpaqueID(s string) func(*ReindexRethrottleRequest) { return func(r *ReindexRethrottleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.render_search_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.render_search_template.go index 36aa15aa26e..95e0ddc65eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.render_search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.render_search_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newRenderSearchTemplateFunc(t Transport) RenderSearchTemplate { // RenderSearchTemplate allows to use the Mustache language to pre-render a search definition. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/render-search-template-api.html. +// type RenderSearchTemplate func(o ...func(*RenderSearchTemplateRequest)) (*Response, error) // RenderSearchTemplateRequest configures the Render Search Template API request. +// type RenderSearchTemplateRequest struct { TemplateID string @@ -60,6 +62,7 @@ type RenderSearchTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport 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 @@ -122,10 +129,6 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f RenderSearchTemplate) WithContext(v context.Context) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f RenderSearchTemplate) WithContext(v context.Context) func(*RenderSearchT } // WithBody - The search definition template and its params. +// func (f RenderSearchTemplate) WithBody(v io.Reader) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.Body = v @@ -159,6 +164,7 @@ func (f RenderSearchTemplate) WithBody(v io.Reader) func(*RenderSearchTemplateRe } // WithTemplateID - the ID of the stored search template. +// func (f RenderSearchTemplate) WithTemplateID(v string) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.TemplateID = v @@ -166,6 +172,7 @@ func (f RenderSearchTemplate) WithTemplateID(v string) func(*RenderSearchTemplat } // WithPretty makes the response body pretty-printed. +// func (f RenderSearchTemplate) WithPretty() func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.Pretty = true @@ -173,6 +180,7 @@ func (f RenderSearchTemplate) WithPretty() func(*RenderSearchTemplateRequest) { } // WithHuman makes statistical values human-readable. +// func (f RenderSearchTemplate) WithHuman() func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.Human = true @@ -180,6 +188,7 @@ func (f RenderSearchTemplate) WithHuman() func(*RenderSearchTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RenderSearchTemplate) WithErrorTrace() func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.ErrorTrace = true @@ -187,6 +196,7 @@ func (f RenderSearchTemplate) WithErrorTrace() func(*RenderSearchTemplateRequest } // WithFilterPath filters the properties of the response body. +// func (f RenderSearchTemplate) WithFilterPath(v ...string) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { r.FilterPath = v @@ -194,6 +204,7 @@ func (f RenderSearchTemplate) WithFilterPath(v ...string) func(*RenderSearchTemp } // WithHeader adds the headers to the HTTP request. +// func (f RenderSearchTemplate) WithHeader(h map[string]string) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { if r.Header == nil { @@ -206,6 +217,7 @@ func (f RenderSearchTemplate) WithHeader(h map[string]string) func(*RenderSearch } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RenderSearchTemplate) WithOpaqueID(s string) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scripts_painless_execute.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scripts_painless_execute.go index 93447f21242..e483951abed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scripts_painless_execute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scripts_painless_execute.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newScriptsPainlessExecuteFunc(t Transport) ScriptsPainlessExecute { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html. +// type ScriptsPainlessExecute func(o ...func(*ScriptsPainlessExecuteRequest)) (*Response, error) // ScriptsPainlessExecuteRequest configures the Scripts Painless Execute API request. +// type ScriptsPainlessExecuteRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type ScriptsPainlessExecuteRequest struct { } // Do executes the request and returns response or error. +// func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -103,6 +106,10 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo 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 @@ -115,10 +122,6 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -138,6 +141,7 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f ScriptsPainlessExecute) WithContext(v context.Context) func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f ScriptsPainlessExecute) WithContext(v context.Context) func(*ScriptsPain } // WithBody - The script to execute. +// func (f ScriptsPainlessExecute) WithBody(v io.Reader) func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { r.Body = v @@ -152,6 +157,7 @@ func (f ScriptsPainlessExecute) WithBody(v io.Reader) func(*ScriptsPainlessExecu } // WithPretty makes the response body pretty-printed. +// func (f ScriptsPainlessExecute) WithPretty() func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f ScriptsPainlessExecute) WithPretty() func(*ScriptsPainlessExecuteRequest } // WithHuman makes statistical values human-readable. +// func (f ScriptsPainlessExecute) WithHuman() func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f ScriptsPainlessExecute) WithHuman() func(*ScriptsPainlessExecuteRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ScriptsPainlessExecute) WithErrorTrace() func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f ScriptsPainlessExecute) WithErrorTrace() func(*ScriptsPainlessExecuteReq } // WithFilterPath filters the properties of the response body. +// func (f ScriptsPainlessExecute) WithFilterPath(v ...string) func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f ScriptsPainlessExecute) WithFilterPath(v ...string) func(*ScriptsPainles } // WithHeader adds the headers to the HTTP request. +// func (f ScriptsPainlessExecute) WithHeader(h map[string]string) func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f ScriptsPainlessExecute) WithHeader(h map[string]string) func(*ScriptsPai } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ScriptsPainlessExecute) WithOpaqueID(s string) func(*ScriptsPainlessExecuteRequest) { return func(r *ScriptsPainlessExecuteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scroll.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scroll.go index cbc9a3c0f6c..cdc1d1ceb67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.scroll.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newScrollFunc(t Transport) Scroll { // Scroll allows to retrieve a large numbers of results from a single search request. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. +// type Scroll func(o ...func(*ScrollRequest)) (*Response, error) // ScrollRequest configures the Scroll API request. +// type ScrollRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type ScrollRequest struct { } // Do executes the request and returns response or error. +// func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -120,6 +123,10 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -132,10 +139,6 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -155,6 +158,7 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Scroll) WithContext(v context.Context) func(*ScrollRequest) { return func(r *ScrollRequest) { r.ctx = v @@ -162,6 +166,7 @@ func (f Scroll) WithContext(v context.Context) func(*ScrollRequest) { } // WithBody - The scroll ID if not passed by URL or query parameter.. +// func (f Scroll) WithBody(v io.Reader) func(*ScrollRequest) { return func(r *ScrollRequest) { r.Body = v @@ -169,6 +174,7 @@ func (f Scroll) WithBody(v io.Reader) func(*ScrollRequest) { } // WithScrollID - the scroll ID. +// func (f Scroll) WithScrollID(v string) func(*ScrollRequest) { return func(r *ScrollRequest) { r.ScrollID = v @@ -176,6 +182,7 @@ func (f Scroll) WithScrollID(v string) func(*ScrollRequest) { } // WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// func (f Scroll) WithRestTotalHitsAsInt(v bool) func(*ScrollRequest) { return func(r *ScrollRequest) { r.RestTotalHitsAsInt = &v @@ -183,6 +190,7 @@ func (f Scroll) WithRestTotalHitsAsInt(v bool) func(*ScrollRequest) { } // WithScroll - specify how long a consistent view of the index should be maintained for scrolled search. +// func (f Scroll) WithScroll(v time.Duration) func(*ScrollRequest) { return func(r *ScrollRequest) { r.Scroll = v @@ -190,6 +198,7 @@ func (f Scroll) WithScroll(v time.Duration) func(*ScrollRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Scroll) WithPretty() func(*ScrollRequest) { return func(r *ScrollRequest) { r.Pretty = true @@ -197,6 +206,7 @@ func (f Scroll) WithPretty() func(*ScrollRequest) { } // WithHuman makes statistical values human-readable. +// func (f Scroll) WithHuman() func(*ScrollRequest) { return func(r *ScrollRequest) { r.Human = true @@ -204,6 +214,7 @@ func (f Scroll) WithHuman() func(*ScrollRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Scroll) WithErrorTrace() func(*ScrollRequest) { return func(r *ScrollRequest) { r.ErrorTrace = true @@ -211,6 +222,7 @@ func (f Scroll) WithErrorTrace() func(*ScrollRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Scroll) WithFilterPath(v ...string) func(*ScrollRequest) { return func(r *ScrollRequest) { r.FilterPath = v @@ -218,6 +230,7 @@ func (f Scroll) WithFilterPath(v ...string) func(*ScrollRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Scroll) WithHeader(h map[string]string) func(*ScrollRequest) { return func(r *ScrollRequest) { if r.Header == nil { @@ -230,6 +243,7 @@ func (f Scroll) WithHeader(h map[string]string) func(*ScrollRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Scroll) WithOpaqueID(s string) func(*ScrollRequest) { return func(r *ScrollRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search.go index 7ed1977ee1a..30bc66ec8ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newSearchFunc(t Transport) Search { // Search returns results matching a query. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html. +// type Search func(o ...func(*SearchRequest)) (*Response, error) // SearchRequest configures the Search API request. +// type SearchRequest struct { Index []string DocumentType []string @@ -108,6 +110,7 @@ type SearchRequest struct { } // Do executes the request and returns response or error. +// func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -332,6 +335,10 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -344,10 +351,6 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -367,6 +370,7 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Search) WithContext(v context.Context) func(*SearchRequest) { return func(r *SearchRequest) { r.ctx = v @@ -374,6 +378,7 @@ func (f Search) WithContext(v context.Context) func(*SearchRequest) { } // WithBody - The search definition using the Query DSL. +// func (f Search) WithBody(v io.Reader) func(*SearchRequest) { return func(r *SearchRequest) { r.Body = v @@ -381,6 +386,7 @@ func (f Search) WithBody(v io.Reader) func(*SearchRequest) { } // WithIndex - a list of index names to search; use _all to perform the operation on all indices. +// func (f Search) WithIndex(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.Index = v @@ -388,6 +394,7 @@ func (f Search) WithIndex(v ...string) func(*SearchRequest) { } // WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// func (f Search) WithDocumentType(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.DocumentType = v @@ -395,6 +402,7 @@ func (f Search) WithDocumentType(v ...string) func(*SearchRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f Search) WithAllowNoIndices(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.AllowNoIndices = &v @@ -402,6 +410,7 @@ func (f Search) WithAllowNoIndices(v bool) func(*SearchRequest) { } // WithAllowPartialSearchResults - indicate if an error should be returned if there is a partial search failure or timeout. +// func (f Search) WithAllowPartialSearchResults(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.AllowPartialSearchResults = &v @@ -409,6 +418,7 @@ func (f Search) WithAllowPartialSearchResults(v bool) func(*SearchRequest) { } // WithAnalyzer - the analyzer to use for the query string. +// func (f Search) WithAnalyzer(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.Analyzer = v @@ -416,6 +426,7 @@ func (f Search) WithAnalyzer(v string) func(*SearchRequest) { } // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). +// func (f Search) WithAnalyzeWildcard(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.AnalyzeWildcard = &v @@ -423,6 +434,7 @@ func (f Search) WithAnalyzeWildcard(v bool) func(*SearchRequest) { } // WithBatchedReduceSize - the number of shard results that should be reduced at once on the coordinating node. this value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.. +// func (f Search) WithBatchedReduceSize(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.BatchedReduceSize = &v @@ -430,6 +442,7 @@ func (f Search) WithBatchedReduceSize(v int) func(*SearchRequest) { } // WithCcsMinimizeRoundtrips - indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. +// func (f Search) WithCcsMinimizeRoundtrips(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.CcsMinimizeRoundtrips = &v @@ -437,6 +450,7 @@ func (f Search) WithCcsMinimizeRoundtrips(v bool) func(*SearchRequest) { } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f Search) WithDefaultOperator(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.DefaultOperator = v @@ -444,6 +458,7 @@ func (f Search) WithDefaultOperator(v string) func(*SearchRequest) { } // WithDf - the field to use as default where no field prefix is given in the query string. +// func (f Search) WithDf(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.Df = v @@ -451,6 +466,7 @@ func (f Search) WithDf(v string) func(*SearchRequest) { } // WithDocvalueFields - a list of fields to return as the docvalue representation of a field for each hit. +// func (f Search) WithDocvalueFields(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.DocvalueFields = v @@ -458,6 +474,7 @@ func (f Search) WithDocvalueFields(v ...string) func(*SearchRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f Search) WithExpandWildcards(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.ExpandWildcards = v @@ -465,6 +482,7 @@ func (f Search) WithExpandWildcards(v string) func(*SearchRequest) { } // WithExplain - specify whether to return detailed information about score computation as part of a hit. +// func (f Search) WithExplain(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.Explain = &v @@ -472,6 +490,7 @@ func (f Search) WithExplain(v bool) func(*SearchRequest) { } // WithFrom - starting offset (default: 0). +// func (f Search) WithFrom(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.From = &v @@ -479,6 +498,7 @@ func (f Search) WithFrom(v int) func(*SearchRequest) { } // WithIgnoreThrottled - whether specified concrete, expanded or aliased indices should be ignored when throttled. +// func (f Search) WithIgnoreThrottled(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.IgnoreThrottled = &v @@ -486,6 +506,7 @@ func (f Search) WithIgnoreThrottled(v bool) func(*SearchRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f Search) WithIgnoreUnavailable(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.IgnoreUnavailable = &v @@ -493,6 +514,7 @@ func (f Search) WithIgnoreUnavailable(v bool) func(*SearchRequest) { } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f Search) WithLenient(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.Lenient = &v @@ -500,6 +522,7 @@ func (f Search) WithLenient(v bool) func(*SearchRequest) { } // WithMaxConcurrentShardRequests - the number of concurrent shard requests per node this search executes concurrently. this value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. +// func (f Search) WithMaxConcurrentShardRequests(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.MaxConcurrentShardRequests = &v @@ -507,6 +530,7 @@ func (f Search) WithMaxConcurrentShardRequests(v int) func(*SearchRequest) { } // WithMinCompatibleShardNode - the minimum compatible version that all shards involved in search should have for this request to be successful. +// func (f Search) WithMinCompatibleShardNode(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.MinCompatibleShardNode = v @@ -514,6 +538,7 @@ func (f Search) WithMinCompatibleShardNode(v string) func(*SearchRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f Search) WithPreference(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.Preference = v @@ -521,6 +546,7 @@ func (f Search) WithPreference(v string) func(*SearchRequest) { } // WithPreFilterShardSize - a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.. +// func (f Search) WithPreFilterShardSize(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.PreFilterShardSize = &v @@ -528,6 +554,7 @@ func (f Search) WithPreFilterShardSize(v int) func(*SearchRequest) { } // WithQuery - query in the lucene query string syntax. +// func (f Search) WithQuery(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.Query = v @@ -535,6 +562,7 @@ func (f Search) WithQuery(v string) func(*SearchRequest) { } // WithRequestCache - specify if request cache should be used for this request or not, defaults to index level setting. +// func (f Search) WithRequestCache(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.RequestCache = &v @@ -542,6 +570,7 @@ func (f Search) WithRequestCache(v bool) func(*SearchRequest) { } // WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// func (f Search) WithRestTotalHitsAsInt(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.RestTotalHitsAsInt = &v @@ -549,6 +578,7 @@ func (f Search) WithRestTotalHitsAsInt(v bool) func(*SearchRequest) { } // WithRouting - a list of specific routing values. +// func (f Search) WithRouting(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.Routing = v @@ -556,6 +586,7 @@ func (f Search) WithRouting(v ...string) func(*SearchRequest) { } // WithScroll - specify how long a consistent view of the index should be maintained for scrolled search. +// func (f Search) WithScroll(v time.Duration) func(*SearchRequest) { return func(r *SearchRequest) { r.Scroll = v @@ -563,6 +594,7 @@ func (f Search) WithScroll(v time.Duration) func(*SearchRequest) { } // WithSearchType - search operation type. +// func (f Search) WithSearchType(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.SearchType = v @@ -570,6 +602,7 @@ func (f Search) WithSearchType(v string) func(*SearchRequest) { } // WithSeqNoPrimaryTerm - specify whether to return sequence number and primary term of the last modification of each hit. +// func (f Search) WithSeqNoPrimaryTerm(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.SeqNoPrimaryTerm = &v @@ -577,6 +610,7 @@ func (f Search) WithSeqNoPrimaryTerm(v bool) func(*SearchRequest) { } // WithSize - number of hits to return (default: 10). +// func (f Search) WithSize(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.Size = &v @@ -584,6 +618,7 @@ func (f Search) WithSize(v int) func(*SearchRequest) { } // WithSort - a list of : pairs. +// func (f Search) WithSort(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.Sort = v @@ -591,6 +626,7 @@ func (f Search) WithSort(v ...string) func(*SearchRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f Search) WithSource(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.Source = v @@ -598,6 +634,7 @@ func (f Search) WithSource(v ...string) func(*SearchRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f Search) WithSourceExcludes(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.SourceExcludes = v @@ -605,6 +642,7 @@ func (f Search) WithSourceExcludes(v ...string) func(*SearchRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f Search) WithSourceIncludes(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.SourceIncludes = v @@ -612,6 +650,7 @@ func (f Search) WithSourceIncludes(v ...string) func(*SearchRequest) { } // WithStats - specific 'tag' of the request for logging and statistical purposes. +// func (f Search) WithStats(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.Stats = v @@ -619,6 +658,7 @@ func (f Search) WithStats(v ...string) func(*SearchRequest) { } // WithStoredFields - a list of stored fields to return as part of a hit. +// func (f Search) WithStoredFields(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.StoredFields = v @@ -626,6 +666,7 @@ func (f Search) WithStoredFields(v ...string) func(*SearchRequest) { } // WithSuggestField - specify which field to use for suggestions. +// func (f Search) WithSuggestField(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.SuggestField = v @@ -633,6 +674,7 @@ func (f Search) WithSuggestField(v string) func(*SearchRequest) { } // WithSuggestMode - specify suggest mode. +// func (f Search) WithSuggestMode(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.SuggestMode = v @@ -640,6 +682,7 @@ func (f Search) WithSuggestMode(v string) func(*SearchRequest) { } // WithSuggestSize - how many suggestions to return in response. +// func (f Search) WithSuggestSize(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.SuggestSize = &v @@ -647,6 +690,7 @@ func (f Search) WithSuggestSize(v int) func(*SearchRequest) { } // WithSuggestText - the source text for which the suggestions should be returned. +// func (f Search) WithSuggestText(v string) func(*SearchRequest) { return func(r *SearchRequest) { r.SuggestText = v @@ -654,6 +698,7 @@ func (f Search) WithSuggestText(v string) func(*SearchRequest) { } // WithTerminateAfter - the maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.. +// func (f Search) WithTerminateAfter(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.TerminateAfter = &v @@ -661,6 +706,7 @@ func (f Search) WithTerminateAfter(v int) func(*SearchRequest) { } // WithTimeout - explicit operation timeout. +// func (f Search) WithTimeout(v time.Duration) func(*SearchRequest) { return func(r *SearchRequest) { r.Timeout = v @@ -668,6 +714,7 @@ func (f Search) WithTimeout(v time.Duration) func(*SearchRequest) { } // WithTrackScores - whether to calculate and return scores even if they are not used for sorting. +// func (f Search) WithTrackScores(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.TrackScores = &v @@ -675,6 +722,7 @@ func (f Search) WithTrackScores(v bool) func(*SearchRequest) { } // WithTrackTotalHits - indicate if the number of documents that match the query should be tracked. +// func (f Search) WithTrackTotalHits(v interface{}) func(*SearchRequest) { return func(r *SearchRequest) { r.TrackTotalHits = v @@ -682,6 +730,7 @@ func (f Search) WithTrackTotalHits(v interface{}) func(*SearchRequest) { } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f Search) WithTypedKeys(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.TypedKeys = &v @@ -689,6 +738,7 @@ func (f Search) WithTypedKeys(v bool) func(*SearchRequest) { } // WithVersion - specify whether to return document version as part of a hit. +// func (f Search) WithVersion(v bool) func(*SearchRequest) { return func(r *SearchRequest) { r.Version = &v @@ -696,6 +746,7 @@ func (f Search) WithVersion(v bool) func(*SearchRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Search) WithPretty() func(*SearchRequest) { return func(r *SearchRequest) { r.Pretty = true @@ -703,6 +754,7 @@ func (f Search) WithPretty() func(*SearchRequest) { } // WithHuman makes statistical values human-readable. +// func (f Search) WithHuman() func(*SearchRequest) { return func(r *SearchRequest) { r.Human = true @@ -710,6 +762,7 @@ func (f Search) WithHuman() func(*SearchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Search) WithErrorTrace() func(*SearchRequest) { return func(r *SearchRequest) { r.ErrorTrace = true @@ -717,6 +770,7 @@ func (f Search) WithErrorTrace() func(*SearchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Search) WithFilterPath(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.FilterPath = v @@ -724,6 +778,7 @@ func (f Search) WithFilterPath(v ...string) func(*SearchRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Search) WithHeader(h map[string]string) func(*SearchRequest) { return func(r *SearchRequest) { if r.Header == nil { @@ -736,6 +791,7 @@ func (f Search) WithHeader(h map[string]string) func(*SearchRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Search) WithOpaqueID(s string) func(*SearchRequest) { return func(r *SearchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_mvt.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_mvt.go index 3e489175b05..a5b6b52df35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_mvt.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_mvt.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -31,7 +31,7 @@ import ( func newSearchMvtFunc(t Transport) SearchMvt { return func(index []string, field string, zoom *int, x *int, y *int, o ...func(*SearchMvtRequest)) (*Response, error) { - var r = SearchMvtRequest{Index: index, Field: field, Zoom: zoom, X: x, Y: y} + var r = SearchMvtRequest{Index: index, X: x, Y: y, Field: field, Zoom: zoom} for _, f := range o { f(&r) } @@ -46,9 +46,11 @@ func newSearchMvtFunc(t Transport) SearchMvt { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html. +// type SearchMvt func(index []string, field string, zoom *int, x *int, y *int, o ...func(*SearchMvtRequest)) (*Response, error) // SearchMvtRequest configures the Search Mvt API request. +// type SearchMvtRequest struct { Index []string @@ -77,6 +79,7 @@ type SearchMvtRequest struct { } // Do executes the request and returns response or error. +// func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -168,6 +171,10 @@ func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -180,10 +187,6 @@ func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -203,6 +206,7 @@ func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f SearchMvt) WithContext(v context.Context) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.ctx = v @@ -210,6 +214,7 @@ func (f SearchMvt) WithContext(v context.Context) func(*SearchMvtRequest) { } // WithBody - Search request body.. +// func (f SearchMvt) WithBody(v io.Reader) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.Body = v @@ -217,6 +222,7 @@ func (f SearchMvt) WithBody(v io.Reader) func(*SearchMvtRequest) { } // WithExactBounds - if false, the meta layer's feature is the bounding box of the tile. if true, the meta layer's feature is a bounding box resulting from a `geo_bounds` aggregation.. +// func (f SearchMvt) WithExactBounds(v bool) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.ExactBounds = &v @@ -224,6 +230,7 @@ func (f SearchMvt) WithExactBounds(v bool) func(*SearchMvtRequest) { } // WithExtent - size, in pixels, of a side of the vector tile.. +// func (f SearchMvt) WithExtent(v int) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.Extent = &v @@ -231,6 +238,7 @@ func (f SearchMvt) WithExtent(v int) func(*SearchMvtRequest) { } // WithGridPrecision - additional zoom levels available through the aggs layer. accepts 0-8.. +// func (f SearchMvt) WithGridPrecision(v int) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.GridPrecision = &v @@ -238,6 +246,7 @@ func (f SearchMvt) WithGridPrecision(v int) func(*SearchMvtRequest) { } // WithGridType - determines the geometry type for features in the aggs layer.. +// func (f SearchMvt) WithGridType(v string) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.GridType = v @@ -245,6 +254,7 @@ func (f SearchMvt) WithGridType(v string) func(*SearchMvtRequest) { } // WithSize - maximum number of features to return in the hits layer. accepts 0-10000.. +// func (f SearchMvt) WithSize(v int) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.Size = &v @@ -252,6 +262,7 @@ func (f SearchMvt) WithSize(v int) func(*SearchMvtRequest) { } // WithTrackTotalHits - indicate if the number of documents that match the query should be tracked. a number can also be specified, to accurately track the total hit count up to the number.. +// func (f SearchMvt) WithTrackTotalHits(v interface{}) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.TrackTotalHits = v @@ -259,6 +270,7 @@ func (f SearchMvt) WithTrackTotalHits(v interface{}) func(*SearchMvtRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SearchMvt) WithPretty() func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.Pretty = true @@ -266,6 +278,7 @@ func (f SearchMvt) WithPretty() func(*SearchMvtRequest) { } // WithHuman makes statistical values human-readable. +// func (f SearchMvt) WithHuman() func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.Human = true @@ -273,6 +286,7 @@ func (f SearchMvt) WithHuman() func(*SearchMvtRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchMvt) WithErrorTrace() func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.ErrorTrace = true @@ -280,6 +294,7 @@ func (f SearchMvt) WithErrorTrace() func(*SearchMvtRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SearchMvt) WithFilterPath(v ...string) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { r.FilterPath = v @@ -287,6 +302,7 @@ func (f SearchMvt) WithFilterPath(v ...string) func(*SearchMvtRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SearchMvt) WithHeader(h map[string]string) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { if r.Header == nil { @@ -299,6 +315,7 @@ func (f SearchMvt) WithHeader(h map[string]string) func(*SearchMvtRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchMvt) WithOpaqueID(s string) func(*SearchMvtRequest) { return func(r *SearchMvtRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_shards.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_shards.go index 811edfe4772..04bba8df4a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_shards.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSearchShardsFunc(t Transport) SearchShards { // SearchShards returns information about the indices and shards that a search request would be executed against. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html. +// type SearchShards func(o ...func(*SearchShardsRequest)) (*Response, error) // SearchShardsRequest configures the Search Shards API request. +// type SearchShardsRequest struct { Index []string @@ -65,6 +67,7 @@ type SearchShardsRequest struct { } // Do executes the request and returns response or error. +// func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -168,6 +171,7 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f SearchShards) WithContext(v context.Context) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.ctx = v @@ -175,6 +179,7 @@ func (f SearchShards) WithContext(v context.Context) func(*SearchShardsRequest) } // WithIndex - a list of index names to search; use _all to perform the operation on all indices. +// func (f SearchShards) WithIndex(v ...string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Index = v @@ -182,6 +187,7 @@ func (f SearchShards) WithIndex(v ...string) func(*SearchShardsRequest) { } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f SearchShards) WithAllowNoIndices(v bool) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.AllowNoIndices = &v @@ -189,6 +195,7 @@ func (f SearchShards) WithAllowNoIndices(v bool) func(*SearchShardsRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f SearchShards) WithExpandWildcards(v string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.ExpandWildcards = v @@ -196,6 +203,7 @@ func (f SearchShards) WithExpandWildcards(v string) func(*SearchShardsRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f SearchShards) WithIgnoreUnavailable(v bool) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.IgnoreUnavailable = &v @@ -203,6 +211,7 @@ func (f SearchShards) WithIgnoreUnavailable(v bool) func(*SearchShardsRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f SearchShards) WithLocal(v bool) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Local = &v @@ -210,6 +219,7 @@ func (f SearchShards) WithLocal(v bool) func(*SearchShardsRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f SearchShards) WithPreference(v string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Preference = v @@ -217,6 +227,7 @@ func (f SearchShards) WithPreference(v string) func(*SearchShardsRequest) { } // WithRouting - specific routing value. +// func (f SearchShards) WithRouting(v string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Routing = v @@ -224,6 +235,7 @@ func (f SearchShards) WithRouting(v string) func(*SearchShardsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SearchShards) WithPretty() func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Pretty = true @@ -231,6 +243,7 @@ func (f SearchShards) WithPretty() func(*SearchShardsRequest) { } // WithHuman makes statistical values human-readable. +// func (f SearchShards) WithHuman() func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Human = true @@ -238,6 +251,7 @@ func (f SearchShards) WithHuman() func(*SearchShardsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchShards) WithErrorTrace() func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.ErrorTrace = true @@ -245,6 +259,7 @@ func (f SearchShards) WithErrorTrace() func(*SearchShardsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SearchShards) WithFilterPath(v ...string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.FilterPath = v @@ -252,6 +267,7 @@ func (f SearchShards) WithFilterPath(v ...string) func(*SearchShardsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SearchShards) WithHeader(h map[string]string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { if r.Header == nil { @@ -264,6 +280,7 @@ func (f SearchShards) WithHeader(h map[string]string) func(*SearchShardsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchShards) WithOpaqueID(s string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_template.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_template.go index d8d652da777..6ed2ade2b43 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.search_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newSearchTemplateFunc(t Transport) SearchTemplate { // SearchTemplate allows to use the Mustache language to pre-render a search definition. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html. +// type SearchTemplate func(body io.Reader, o ...func(*SearchTemplateRequest)) (*Response, error) // SearchTemplateRequest configures the Search Template API request. +// type SearchTemplateRequest struct { Index []string DocumentType []string @@ -77,6 +79,7 @@ type SearchTemplateRequest struct { } // Do executes the request and returns response or error. +// func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -183,6 +186,10 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -195,10 +202,6 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -218,6 +221,7 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f SearchTemplate) WithContext(v context.Context) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.ctx = v @@ -225,6 +229,7 @@ func (f SearchTemplate) WithContext(v context.Context) func(*SearchTemplateReque } // WithIndex - a list of index names to search; use _all to perform the operation on all indices. +// func (f SearchTemplate) WithIndex(v ...string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Index = v @@ -232,6 +237,7 @@ func (f SearchTemplate) WithIndex(v ...string) func(*SearchTemplateRequest) { } // WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// func (f SearchTemplate) WithDocumentType(v ...string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.DocumentType = v @@ -239,6 +245,7 @@ func (f SearchTemplate) WithDocumentType(v ...string) func(*SearchTemplateReques } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f SearchTemplate) WithAllowNoIndices(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.AllowNoIndices = &v @@ -246,6 +253,7 @@ func (f SearchTemplate) WithAllowNoIndices(v bool) func(*SearchTemplateRequest) } // WithCcsMinimizeRoundtrips - indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. +// func (f SearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.CcsMinimizeRoundtrips = &v @@ -253,6 +261,7 @@ func (f SearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*SearchTemplateRe } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f SearchTemplate) WithExpandWildcards(v string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.ExpandWildcards = v @@ -260,6 +269,7 @@ func (f SearchTemplate) WithExpandWildcards(v string) func(*SearchTemplateReques } // WithExplain - specify whether to return detailed information about score computation as part of a hit. +// func (f SearchTemplate) WithExplain(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Explain = &v @@ -267,6 +277,7 @@ func (f SearchTemplate) WithExplain(v bool) func(*SearchTemplateRequest) { } // WithIgnoreThrottled - whether specified concrete, expanded or aliased indices should be ignored when throttled. +// func (f SearchTemplate) WithIgnoreThrottled(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.IgnoreThrottled = &v @@ -274,6 +285,7 @@ func (f SearchTemplate) WithIgnoreThrottled(v bool) func(*SearchTemplateRequest) } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f SearchTemplate) WithIgnoreUnavailable(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.IgnoreUnavailable = &v @@ -281,6 +293,7 @@ func (f SearchTemplate) WithIgnoreUnavailable(v bool) func(*SearchTemplateReques } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f SearchTemplate) WithPreference(v string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Preference = v @@ -288,6 +301,7 @@ func (f SearchTemplate) WithPreference(v string) func(*SearchTemplateRequest) { } // WithProfile - specify whether to profile the query execution. +// func (f SearchTemplate) WithProfile(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Profile = &v @@ -295,6 +309,7 @@ func (f SearchTemplate) WithProfile(v bool) func(*SearchTemplateRequest) { } // WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// func (f SearchTemplate) WithRestTotalHitsAsInt(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.RestTotalHitsAsInt = &v @@ -302,6 +317,7 @@ func (f SearchTemplate) WithRestTotalHitsAsInt(v bool) func(*SearchTemplateReque } // WithRouting - a list of specific routing values. +// func (f SearchTemplate) WithRouting(v ...string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Routing = v @@ -309,6 +325,7 @@ func (f SearchTemplate) WithRouting(v ...string) func(*SearchTemplateRequest) { } // WithScroll - specify how long a consistent view of the index should be maintained for scrolled search. +// func (f SearchTemplate) WithScroll(v time.Duration) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Scroll = v @@ -316,6 +333,7 @@ func (f SearchTemplate) WithScroll(v time.Duration) func(*SearchTemplateRequest) } // WithSearchType - search operation type. +// func (f SearchTemplate) WithSearchType(v string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.SearchType = v @@ -323,6 +341,7 @@ func (f SearchTemplate) WithSearchType(v string) func(*SearchTemplateRequest) { } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f SearchTemplate) WithTypedKeys(v bool) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.TypedKeys = &v @@ -330,6 +349,7 @@ func (f SearchTemplate) WithTypedKeys(v bool) func(*SearchTemplateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SearchTemplate) WithPretty() func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Pretty = true @@ -337,6 +357,7 @@ func (f SearchTemplate) WithPretty() func(*SearchTemplateRequest) { } // WithHuman makes statistical values human-readable. +// func (f SearchTemplate) WithHuman() func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.Human = true @@ -344,6 +365,7 @@ func (f SearchTemplate) WithHuman() func(*SearchTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchTemplate) WithErrorTrace() func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.ErrorTrace = true @@ -351,6 +373,7 @@ func (f SearchTemplate) WithErrorTrace() func(*SearchTemplateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SearchTemplate) WithFilterPath(v ...string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.FilterPath = v @@ -358,6 +381,7 @@ func (f SearchTemplate) WithFilterPath(v ...string) func(*SearchTemplateRequest) } // WithHeader adds the headers to the HTTP request. +// func (f SearchTemplate) WithHeader(h map[string]string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { if r.Header == nil { @@ -370,6 +394,7 @@ func (f SearchTemplate) WithHeader(h map[string]string) func(*SearchTemplateRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchTemplate) WithOpaqueID(s string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.delete_node.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.delete_node.go index 762a750f540..8c1f5472cd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.delete_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.delete_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newShutdownDeleteNodeFunc(t Transport) ShutdownDeleteNode { // ShutdownDeleteNode removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current. +// type ShutdownDeleteNode func(node_id string, o ...func(*ShutdownDeleteNodeRequest)) (*Response, error) // ShutdownDeleteNodeRequest configures the Shutdown Delete Node API request. +// type ShutdownDeleteNodeRequest struct { NodeID string @@ -57,6 +59,7 @@ type ShutdownDeleteNodeRequest struct { } // Do executes the request and returns response or error. +// func (r ShutdownDeleteNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r ShutdownDeleteNodeRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f ShutdownDeleteNode) WithContext(v context.Context) func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f ShutdownDeleteNode) WithContext(v context.Context) func(*ShutdownDeleteN } // WithPretty makes the response body pretty-printed. +// func (f ShutdownDeleteNode) WithPretty() func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f ShutdownDeleteNode) WithPretty() func(*ShutdownDeleteNodeRequest) { } // WithHuman makes statistical values human-readable. +// func (f ShutdownDeleteNode) WithHuman() func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f ShutdownDeleteNode) WithHuman() func(*ShutdownDeleteNodeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ShutdownDeleteNode) WithErrorTrace() func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f ShutdownDeleteNode) WithErrorTrace() func(*ShutdownDeleteNodeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ShutdownDeleteNode) WithFilterPath(v ...string) func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f ShutdownDeleteNode) WithFilterPath(v ...string) func(*ShutdownDeleteNode } // WithHeader adds the headers to the HTTP request. +// func (f ShutdownDeleteNode) WithHeader(h map[string]string) func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f ShutdownDeleteNode) WithHeader(h map[string]string) func(*ShutdownDelete } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ShutdownDeleteNode) WithOpaqueID(s string) func(*ShutdownDeleteNodeRequest) { return func(r *ShutdownDeleteNodeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.get_node.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.get_node.go index e442ff369b4..bfd2d1c76b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.get_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.get_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newShutdownGetNodeFunc(t Transport) ShutdownGetNode { // ShutdownGetNode retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current. +// type ShutdownGetNode func(o ...func(*ShutdownGetNodeRequest)) (*Response, error) // ShutdownGetNodeRequest configures the Shutdown Get Node API request. +// type ShutdownGetNodeRequest struct { NodeID string @@ -57,6 +59,7 @@ type ShutdownGetNodeRequest struct { } // Do executes the request and returns response or error. +// func (r ShutdownGetNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r ShutdownGetNodeRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f ShutdownGetNode) WithContext(v context.Context) func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f ShutdownGetNode) WithContext(v context.Context) func(*ShutdownGetNodeReq } // WithNodeID - which node for which to retrieve the shutdown status. +// func (f ShutdownGetNode) WithNodeID(v string) func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { r.NodeID = v @@ -152,6 +157,7 @@ func (f ShutdownGetNode) WithNodeID(v string) func(*ShutdownGetNodeRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ShutdownGetNode) WithPretty() func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f ShutdownGetNode) WithPretty() func(*ShutdownGetNodeRequest) { } // WithHuman makes statistical values human-readable. +// func (f ShutdownGetNode) WithHuman() func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f ShutdownGetNode) WithHuman() func(*ShutdownGetNodeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ShutdownGetNode) WithErrorTrace() func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f ShutdownGetNode) WithErrorTrace() func(*ShutdownGetNodeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ShutdownGetNode) WithFilterPath(v ...string) func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f ShutdownGetNode) WithFilterPath(v ...string) func(*ShutdownGetNodeReques } // WithHeader adds the headers to the HTTP request. +// func (f ShutdownGetNode) WithHeader(h map[string]string) func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f ShutdownGetNode) WithHeader(h map[string]string) func(*ShutdownGetNodeRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ShutdownGetNode) WithOpaqueID(s string) func(*ShutdownGetNodeRequest) { return func(r *ShutdownGetNodeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.put_node.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.put_node.go index e8fe4acb4c7..e7bdf8d5d3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.put_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.shutdown.put_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newShutdownPutNodeFunc(t Transport) ShutdownPutNode { // ShutdownPutNode adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current. +// type ShutdownPutNode func(body io.Reader, node_id string, o ...func(*ShutdownPutNodeRequest)) (*Response, error) // ShutdownPutNodeRequest configures the Shutdown Put Node API request. +// type ShutdownPutNodeRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type ShutdownPutNodeRequest struct { } // Do executes the request and returns response or error. +// func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -120,10 +127,6 @@ func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f ShutdownPutNode) WithContext(v context.Context) func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f ShutdownPutNode) WithContext(v context.Context) func(*ShutdownPutNodeReq } // WithPretty makes the response body pretty-printed. +// func (f ShutdownPutNode) WithPretty() func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f ShutdownPutNode) WithPretty() func(*ShutdownPutNodeRequest) { } // WithHuman makes statistical values human-readable. +// func (f ShutdownPutNode) WithHuman() func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f ShutdownPutNode) WithHuman() func(*ShutdownPutNodeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ShutdownPutNode) WithErrorTrace() func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f ShutdownPutNode) WithErrorTrace() func(*ShutdownPutNodeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ShutdownPutNode) WithFilterPath(v ...string) func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f ShutdownPutNode) WithFilterPath(v ...string) func(*ShutdownPutNodeReques } // WithHeader adds the headers to the HTTP request. +// func (f ShutdownPutNode) WithHeader(h map[string]string) func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f ShutdownPutNode) WithHeader(h map[string]string) func(*ShutdownPutNodeRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ShutdownPutNode) WithOpaqueID(s string) func(*ShutdownPutNodeRequest) { return func(r *ShutdownPutNodeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.cleanup_repository.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.cleanup_repository.go index 35797544d2b..cc84cb9f1c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.cleanup_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.cleanup_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSnapshotCleanupRepositoryFunc(t Transport) SnapshotCleanupRepository { // SnapshotCleanupRepository removes stale data from repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html. +// type SnapshotCleanupRepository func(repository string, o ...func(*SnapshotCleanupRepositoryRequest)) (*Response, error) // SnapshotCleanupRepositoryRequest configures the Snapshot Cleanup Repository API request. +// type SnapshotCleanupRepositoryRequest struct { Repository string @@ -61,6 +63,7 @@ type SnapshotCleanupRepositoryRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f SnapshotCleanupRepository) WithContext(v context.Context) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f SnapshotCleanupRepository) WithContext(v context.Context) func(*Snapshot } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotCleanupRepository) WithMasterTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.MasterTimeout = v @@ -162,6 +167,7 @@ func (f SnapshotCleanupRepository) WithMasterTimeout(v time.Duration) func(*Snap } // WithTimeout - explicit operation timeout. +// func (f SnapshotCleanupRepository) WithTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.Timeout = v @@ -169,6 +175,7 @@ func (f SnapshotCleanupRepository) WithTimeout(v time.Duration) func(*SnapshotCl } // WithPretty makes the response body pretty-printed. +// func (f SnapshotCleanupRepository) WithPretty() func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f SnapshotCleanupRepository) WithPretty() func(*SnapshotCleanupRepositoryR } // WithHuman makes statistical values human-readable. +// func (f SnapshotCleanupRepository) WithHuman() func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f SnapshotCleanupRepository) WithHuman() func(*SnapshotCleanupRepositoryRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotCleanupRepository) WithErrorTrace() func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f SnapshotCleanupRepository) WithErrorTrace() func(*SnapshotCleanupReposit } // WithFilterPath filters the properties of the response body. +// func (f SnapshotCleanupRepository) WithFilterPath(v ...string) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f SnapshotCleanupRepository) WithFilterPath(v ...string) func(*SnapshotCle } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotCleanupRepository) WithHeader(h map[string]string) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f SnapshotCleanupRepository) WithHeader(h map[string]string) func(*Snapsho } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotCleanupRepository) WithOpaqueID(s string) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.clone.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.clone.go index d0397dc605e..1b155d7a8f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.clone.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.clone.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSnapshotCloneFunc(t Transport) SnapshotClone { // SnapshotClone clones indices from one snapshot into another snapshot in the same repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotClone func(repository string, snapshot string, body io.Reader, target_snapshot string, o ...func(*SnapshotCloneRequest)) (*Response, error) // SnapshotCloneRequest configures the Snapshot Clone API request. +// type SnapshotCloneRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type SnapshotCloneRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -121,6 +124,10 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -133,10 +140,6 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -156,6 +159,7 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f SnapshotClone) WithContext(v context.Context) func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f SnapshotClone) WithContext(v context.Context) func(*SnapshotCloneRequest } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotClone) WithMasterTimeout(v time.Duration) func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { r.MasterTimeout = v @@ -170,6 +175,7 @@ func (f SnapshotClone) WithMasterTimeout(v time.Duration) func(*SnapshotCloneReq } // WithPretty makes the response body pretty-printed. +// func (f SnapshotClone) WithPretty() func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { r.Pretty = true @@ -177,6 +183,7 @@ func (f SnapshotClone) WithPretty() func(*SnapshotCloneRequest) { } // WithHuman makes statistical values human-readable. +// func (f SnapshotClone) WithHuman() func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { r.Human = true @@ -184,6 +191,7 @@ func (f SnapshotClone) WithHuman() func(*SnapshotCloneRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotClone) WithErrorTrace() func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { r.ErrorTrace = true @@ -191,6 +199,7 @@ func (f SnapshotClone) WithErrorTrace() func(*SnapshotCloneRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SnapshotClone) WithFilterPath(v ...string) func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { r.FilterPath = v @@ -198,6 +207,7 @@ func (f SnapshotClone) WithFilterPath(v ...string) func(*SnapshotCloneRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotClone) WithHeader(h map[string]string) func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { if r.Header == nil { @@ -210,6 +220,7 @@ func (f SnapshotClone) WithHeader(h map[string]string) func(*SnapshotCloneReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotClone) WithOpaqueID(s string) func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create.go index c1ccd0952c0..cec756d5d05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newSnapshotCreateFunc(t Transport) SnapshotCreate { // SnapshotCreate creates a snapshot in a repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotCreate func(repository string, snapshot string, o ...func(*SnapshotCreateRequest)) (*Response, error) // SnapshotCreateRequest configures the Snapshot Create API request. +// type SnapshotCreateRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type SnapshotCreateRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -122,6 +125,10 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -134,10 +141,6 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -157,6 +160,7 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f SnapshotCreate) WithContext(v context.Context) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.ctx = v @@ -164,6 +168,7 @@ func (f SnapshotCreate) WithContext(v context.Context) func(*SnapshotCreateReque } // WithBody - The snapshot definition. +// func (f SnapshotCreate) WithBody(v io.Reader) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.Body = v @@ -171,6 +176,7 @@ func (f SnapshotCreate) WithBody(v io.Reader) func(*SnapshotCreateRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotCreate) WithMasterTimeout(v time.Duration) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.MasterTimeout = v @@ -178,6 +184,7 @@ func (f SnapshotCreate) WithMasterTimeout(v time.Duration) func(*SnapshotCreateR } // WithWaitForCompletion - should this request wait until the operation has completed before returning. +// func (f SnapshotCreate) WithWaitForCompletion(v bool) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.WaitForCompletion = &v @@ -185,6 +192,7 @@ func (f SnapshotCreate) WithWaitForCompletion(v bool) func(*SnapshotCreateReques } // WithPretty makes the response body pretty-printed. +// func (f SnapshotCreate) WithPretty() func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.Pretty = true @@ -192,6 +200,7 @@ func (f SnapshotCreate) WithPretty() func(*SnapshotCreateRequest) { } // WithHuman makes statistical values human-readable. +// func (f SnapshotCreate) WithHuman() func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.Human = true @@ -199,6 +208,7 @@ func (f SnapshotCreate) WithHuman() func(*SnapshotCreateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotCreate) WithErrorTrace() func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.ErrorTrace = true @@ -206,6 +216,7 @@ func (f SnapshotCreate) WithErrorTrace() func(*SnapshotCreateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SnapshotCreate) WithFilterPath(v ...string) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { r.FilterPath = v @@ -213,6 +224,7 @@ func (f SnapshotCreate) WithFilterPath(v ...string) func(*SnapshotCreateRequest) } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotCreate) WithHeader(h map[string]string) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { if r.Header == nil { @@ -225,6 +237,7 @@ func (f SnapshotCreate) WithHeader(h map[string]string) func(*SnapshotCreateRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotCreate) WithOpaqueID(s string) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create_repository.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create_repository.go index 240817ff0a8..88ecc4d2be1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.create_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newSnapshotCreateRepositoryFunc(t Transport) SnapshotCreateRepository { // SnapshotCreateRepository creates a repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotCreateRepository func(repository string, body io.Reader, o ...func(*SnapshotCreateRepositoryRequest)) (*Response, error) // SnapshotCreateRepositoryRequest configures the Snapshot Create Repository API request. +// type SnapshotCreateRepositoryRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type SnapshotCreateRepositoryRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -124,6 +127,10 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans 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 @@ -136,10 +143,6 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -159,6 +162,7 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SnapshotCreateRepository) WithContext(v context.Context) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.ctx = v @@ -166,6 +170,7 @@ func (f SnapshotCreateRepository) WithContext(v context.Context) func(*SnapshotC } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotCreateRepository) WithMasterTimeout(v time.Duration) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.MasterTimeout = v @@ -173,6 +178,7 @@ func (f SnapshotCreateRepository) WithMasterTimeout(v time.Duration) func(*Snaps } // WithTimeout - explicit operation timeout. +// func (f SnapshotCreateRepository) WithTimeout(v time.Duration) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.Timeout = v @@ -180,6 +186,7 @@ func (f SnapshotCreateRepository) WithTimeout(v time.Duration) func(*SnapshotCre } // WithVerify - whether to verify the repository after creation. +// func (f SnapshotCreateRepository) WithVerify(v bool) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.Verify = &v @@ -187,6 +194,7 @@ func (f SnapshotCreateRepository) WithVerify(v bool) func(*SnapshotCreateReposit } // WithPretty makes the response body pretty-printed. +// func (f SnapshotCreateRepository) WithPretty() func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.Pretty = true @@ -194,6 +202,7 @@ func (f SnapshotCreateRepository) WithPretty() func(*SnapshotCreateRepositoryReq } // WithHuman makes statistical values human-readable. +// func (f SnapshotCreateRepository) WithHuman() func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.Human = true @@ -201,6 +210,7 @@ func (f SnapshotCreateRepository) WithHuman() func(*SnapshotCreateRepositoryRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotCreateRepository) WithErrorTrace() func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.ErrorTrace = true @@ -208,6 +218,7 @@ func (f SnapshotCreateRepository) WithErrorTrace() func(*SnapshotCreateRepositor } // WithFilterPath filters the properties of the response body. +// func (f SnapshotCreateRepository) WithFilterPath(v ...string) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { r.FilterPath = v @@ -215,6 +226,7 @@ func (f SnapshotCreateRepository) WithFilterPath(v ...string) func(*SnapshotCrea } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotCreateRepository) WithHeader(h map[string]string) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { if r.Header == nil { @@ -227,6 +239,7 @@ func (f SnapshotCreateRepository) WithHeader(h map[string]string) func(*Snapshot } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotCreateRepository) WithOpaqueID(s string) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete.go index bbf2bd9cf7f..e85885ef3b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSnapshotDeleteFunc(t Transport) SnapshotDelete { // SnapshotDelete deletes a snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotDelete func(repository string, snapshot string, o ...func(*SnapshotDeleteRequest)) (*Response, error) // SnapshotDeleteRequest configures the Snapshot Delete API request. +// type SnapshotDeleteRequest struct { Repository string Snapshot string @@ -61,6 +63,7 @@ type SnapshotDeleteRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -144,6 +147,7 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f SnapshotDelete) WithContext(v context.Context) func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { r.ctx = v @@ -151,6 +155,7 @@ func (f SnapshotDelete) WithContext(v context.Context) func(*SnapshotDeleteReque } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotDelete) WithMasterTimeout(v time.Duration) func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { r.MasterTimeout = v @@ -158,6 +163,7 @@ func (f SnapshotDelete) WithMasterTimeout(v time.Duration) func(*SnapshotDeleteR } // WithPretty makes the response body pretty-printed. +// func (f SnapshotDelete) WithPretty() func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { r.Pretty = true @@ -165,6 +171,7 @@ func (f SnapshotDelete) WithPretty() func(*SnapshotDeleteRequest) { } // WithHuman makes statistical values human-readable. +// func (f SnapshotDelete) WithHuman() func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { r.Human = true @@ -172,6 +179,7 @@ func (f SnapshotDelete) WithHuman() func(*SnapshotDeleteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotDelete) WithErrorTrace() func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { r.ErrorTrace = true @@ -179,6 +187,7 @@ func (f SnapshotDelete) WithErrorTrace() func(*SnapshotDeleteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SnapshotDelete) WithFilterPath(v ...string) func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { r.FilterPath = v @@ -186,6 +195,7 @@ func (f SnapshotDelete) WithFilterPath(v ...string) func(*SnapshotDeleteRequest) } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotDelete) WithHeader(h map[string]string) func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { if r.Header == nil { @@ -198,6 +208,7 @@ func (f SnapshotDelete) WithHeader(h map[string]string) func(*SnapshotDeleteRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotDelete) WithOpaqueID(s string) func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete_repository.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete_repository.go index ac1eacdec3a..94db91d9b73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.delete_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSnapshotDeleteRepositoryFunc(t Transport) SnapshotDeleteRepository { // SnapshotDeleteRepository deletes a repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotDeleteRepository func(repository []string, o ...func(*SnapshotDeleteRepositoryRequest)) (*Response, error) // SnapshotDeleteRepositoryRequest configures the Snapshot Delete Repository API request. +// type SnapshotDeleteRepositoryRequest struct { Repository []string @@ -62,6 +64,7 @@ type SnapshotDeleteRepositoryRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -151,6 +154,7 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SnapshotDeleteRepository) WithContext(v context.Context) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.ctx = v @@ -158,6 +162,7 @@ func (f SnapshotDeleteRepository) WithContext(v context.Context) func(*SnapshotD } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotDeleteRepository) WithMasterTimeout(v time.Duration) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.MasterTimeout = v @@ -165,6 +170,7 @@ func (f SnapshotDeleteRepository) WithMasterTimeout(v time.Duration) func(*Snaps } // WithTimeout - explicit operation timeout. +// func (f SnapshotDeleteRepository) WithTimeout(v time.Duration) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.Timeout = v @@ -172,6 +178,7 @@ func (f SnapshotDeleteRepository) WithTimeout(v time.Duration) func(*SnapshotDel } // WithPretty makes the response body pretty-printed. +// func (f SnapshotDeleteRepository) WithPretty() func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.Pretty = true @@ -179,6 +186,7 @@ func (f SnapshotDeleteRepository) WithPretty() func(*SnapshotDeleteRepositoryReq } // WithHuman makes statistical values human-readable. +// func (f SnapshotDeleteRepository) WithHuman() func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.Human = true @@ -186,6 +194,7 @@ func (f SnapshotDeleteRepository) WithHuman() func(*SnapshotDeleteRepositoryRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotDeleteRepository) WithErrorTrace() func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.ErrorTrace = true @@ -193,6 +202,7 @@ func (f SnapshotDeleteRepository) WithErrorTrace() func(*SnapshotDeleteRepositor } // WithFilterPath filters the properties of the response body. +// func (f SnapshotDeleteRepository) WithFilterPath(v ...string) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { r.FilterPath = v @@ -200,6 +210,7 @@ func (f SnapshotDeleteRepository) WithFilterPath(v ...string) func(*SnapshotDele } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotDeleteRepository) WithHeader(h map[string]string) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { if r.Header == nil { @@ -212,6 +223,7 @@ func (f SnapshotDeleteRepository) WithHeader(h map[string]string) func(*Snapshot } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotDeleteRepository) WithOpaqueID(s string) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get.go index 9e65ac41c6a..90ea35f0f9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get.go @@ -15,14 +15,13 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi import ( "context" "errors" - "fmt" "net/http" "strconv" "strings" @@ -44,24 +43,19 @@ func newSnapshotGetFunc(t Transport) SnapshotGet { // SnapshotGet returns information about a snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotGet func(repository string, snapshot []string, o ...func(*SnapshotGetRequest)) (*Response, error) // SnapshotGetRequest configures the Snapshot Get API request. +// type SnapshotGetRequest struct { Repository string Snapshot []string - After string - FromSortValue string IgnoreUnavailable *bool IncludeRepository *bool IndexDetails *bool MasterTimeout time.Duration - Offset interface{} - Order string - Size interface{} - SlmPolicyFilter string - Sort string Verbose *bool Pretty bool @@ -75,6 +69,7 @@ type SnapshotGetRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -98,14 +93,6 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo params = make(map[string]string) - if r.After != "" { - params["after"] = r.After - } - - if r.FromSortValue != "" { - params["from_sort_value"] = r.FromSortValue - } - if r.IgnoreUnavailable != nil { params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) } @@ -122,26 +109,6 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo params["master_timeout"] = formatDuration(r.MasterTimeout) } - if r.Offset != nil { - params["offset"] = fmt.Sprintf("%v", r.Offset) - } - - if r.Order != "" { - params["order"] = r.Order - } - - if r.Size != nil { - params["size"] = fmt.Sprintf("%v", r.Size) - } - - if r.SlmPolicyFilter != "" { - params["slm_policy_filter"] = r.SlmPolicyFilter - } - - if r.Sort != "" { - params["sort"] = r.Sort - } - if r.Verbose != nil { params["verbose"] = strconv.FormatBool(*r.Verbose) } @@ -206,27 +173,15 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f SnapshotGet) WithContext(v context.Context) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.ctx = v } } -// WithAfter - offset identifier to start pagination from as returned by the 'next' field in the response body.. -func (f SnapshotGet) WithAfter(v string) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.After = v - } -} - -// WithFromSortValue - value of the current sort column at which to start retrieval.. -func (f SnapshotGet) WithFromSortValue(v string) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.FromSortValue = v - } -} - // WithIgnoreUnavailable - whether to ignore unavailable snapshots, defaults to false which means a snapshotmissingexception is thrown. +// func (f SnapshotGet) WithIgnoreUnavailable(v bool) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.IgnoreUnavailable = &v @@ -234,6 +189,7 @@ func (f SnapshotGet) WithIgnoreUnavailable(v bool) func(*SnapshotGetRequest) { } // WithIncludeRepository - whether to include the repository name in the snapshot info. defaults to true.. +// func (f SnapshotGet) WithIncludeRepository(v bool) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.IncludeRepository = &v @@ -241,6 +197,7 @@ func (f SnapshotGet) WithIncludeRepository(v bool) func(*SnapshotGetRequest) { } // WithIndexDetails - whether to include details of each index in the snapshot, if those details are available. defaults to false.. +// func (f SnapshotGet) WithIndexDetails(v bool) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.IndexDetails = &v @@ -248,48 +205,15 @@ func (f SnapshotGet) WithIndexDetails(v bool) func(*SnapshotGetRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotGet) WithMasterTimeout(v time.Duration) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.MasterTimeout = v } } -// WithOffset - numeric offset to start pagination based on the snapshots matching the request. defaults to 0. -func (f SnapshotGet) WithOffset(v interface{}) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.Offset = v - } -} - -// WithOrder - sort order. -func (f SnapshotGet) WithOrder(v string) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.Order = v - } -} - -// WithSize - maximum number of snapshots to return. defaults to 0 which means return all that match without limit.. -func (f SnapshotGet) WithSize(v interface{}) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.Size = v - } -} - -// WithSlmPolicyFilter - filter snapshots by a list of slm policy names that snapshots belong to. accepts wildcards. use the special pattern '_none' to match snapshots without an slm policy. -func (f SnapshotGet) WithSlmPolicyFilter(v string) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.SlmPolicyFilter = v - } -} - -// WithSort - allows setting a sort order for the result. defaults to start_time. -func (f SnapshotGet) WithSort(v string) func(*SnapshotGetRequest) { - return func(r *SnapshotGetRequest) { - r.Sort = v - } -} - // WithVerbose - whether to show verbose snapshot info or only show the basic info found in the repository index blob. +// func (f SnapshotGet) WithVerbose(v bool) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.Verbose = &v @@ -297,6 +221,7 @@ func (f SnapshotGet) WithVerbose(v bool) func(*SnapshotGetRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SnapshotGet) WithPretty() func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.Pretty = true @@ -304,6 +229,7 @@ func (f SnapshotGet) WithPretty() func(*SnapshotGetRequest) { } // WithHuman makes statistical values human-readable. +// func (f SnapshotGet) WithHuman() func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.Human = true @@ -311,6 +237,7 @@ func (f SnapshotGet) WithHuman() func(*SnapshotGetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotGet) WithErrorTrace() func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.ErrorTrace = true @@ -318,6 +245,7 @@ func (f SnapshotGet) WithErrorTrace() func(*SnapshotGetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SnapshotGet) WithFilterPath(v ...string) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { r.FilterPath = v @@ -325,6 +253,7 @@ func (f SnapshotGet) WithFilterPath(v ...string) func(*SnapshotGetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotGet) WithHeader(h map[string]string) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { if r.Header == nil { @@ -337,6 +266,7 @@ func (f SnapshotGet) WithHeader(h map[string]string) func(*SnapshotGetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotGet) WithOpaqueID(s string) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get_repository.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get_repository.go index 77be13ecfdf..00daa00a98c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSnapshotGetRepositoryFunc(t Transport) SnapshotGetRepository { // SnapshotGetRepository returns information about a repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotGetRepository func(o ...func(*SnapshotGetRepositoryRequest)) (*Response, error) // SnapshotGetRepositoryRequest configures the Snapshot Get Repository API request. +// type SnapshotGetRepositoryRequest struct { Repository []string @@ -62,6 +64,7 @@ type SnapshotGetRepositoryRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -149,6 +152,7 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f SnapshotGetRepository) WithContext(v context.Context) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f SnapshotGetRepository) WithContext(v context.Context) func(*SnapshotGetR } // WithRepository - a list of repository names. +// func (f SnapshotGetRepository) WithRepository(v ...string) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.Repository = v @@ -163,6 +168,7 @@ func (f SnapshotGetRepository) WithRepository(v ...string) func(*SnapshotGetRepo } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f SnapshotGetRepository) WithLocal(v bool) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.Local = &v @@ -170,6 +176,7 @@ func (f SnapshotGetRepository) WithLocal(v bool) func(*SnapshotGetRepositoryRequ } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotGetRepository) WithMasterTimeout(v time.Duration) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.MasterTimeout = v @@ -177,6 +184,7 @@ func (f SnapshotGetRepository) WithMasterTimeout(v time.Duration) func(*Snapshot } // WithPretty makes the response body pretty-printed. +// func (f SnapshotGetRepository) WithPretty() func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.Pretty = true @@ -184,6 +192,7 @@ func (f SnapshotGetRepository) WithPretty() func(*SnapshotGetRepositoryRequest) } // WithHuman makes statistical values human-readable. +// func (f SnapshotGetRepository) WithHuman() func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.Human = true @@ -191,6 +200,7 @@ func (f SnapshotGetRepository) WithHuman() func(*SnapshotGetRepositoryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotGetRepository) WithErrorTrace() func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.ErrorTrace = true @@ -198,6 +208,7 @@ func (f SnapshotGetRepository) WithErrorTrace() func(*SnapshotGetRepositoryReque } // WithFilterPath filters the properties of the response body. +// func (f SnapshotGetRepository) WithFilterPath(v ...string) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { r.FilterPath = v @@ -205,6 +216,7 @@ func (f SnapshotGetRepository) WithFilterPath(v ...string) func(*SnapshotGetRepo } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotGetRepository) WithHeader(h map[string]string) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { if r.Header == nil { @@ -217,6 +229,7 @@ func (f SnapshotGetRepository) WithHeader(h map[string]string) func(*SnapshotGet } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotGetRepository) WithOpaqueID(s string) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.repository_analyze.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.repository_analyze.go index deb4f885c5f..2d610d35976 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.repository_analyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.repository_analyze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSnapshotRepositoryAnalyzeFunc(t Transport) SnapshotRepositoryAnalyze { // SnapshotRepositoryAnalyze analyzes a repository for correctness and performance // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotRepositoryAnalyze func(repository string, o ...func(*SnapshotRepositoryAnalyzeRequest)) (*Response, error) // SnapshotRepositoryAnalyzeRequest configures the Snapshot Repository Analyze API request. +// type SnapshotRepositoryAnalyzeRequest struct { Repository string @@ -71,6 +73,7 @@ type SnapshotRepositoryAnalyzeRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotRepositoryAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -194,6 +197,7 @@ func (r SnapshotRepositoryAnalyzeRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f SnapshotRepositoryAnalyze) WithContext(v context.Context) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.ctx = v @@ -201,6 +205,7 @@ func (f SnapshotRepositoryAnalyze) WithContext(v context.Context) func(*Snapshot } // WithBlobCount - number of blobs to create during the test. defaults to 100.. +// func (f SnapshotRepositoryAnalyze) WithBlobCount(v int) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.BlobCount = &v @@ -208,6 +213,7 @@ func (f SnapshotRepositoryAnalyze) WithBlobCount(v int) func(*SnapshotRepository } // WithConcurrency - number of operations to run concurrently during the test. defaults to 10.. +// func (f SnapshotRepositoryAnalyze) WithConcurrency(v int) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.Concurrency = &v @@ -215,6 +221,7 @@ func (f SnapshotRepositoryAnalyze) WithConcurrency(v int) func(*SnapshotReposito } // WithDetailed - whether to return detailed results or a summary. defaults to 'false' so that only the summary is returned.. +// func (f SnapshotRepositoryAnalyze) WithDetailed(v bool) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.Detailed = &v @@ -222,6 +229,7 @@ func (f SnapshotRepositoryAnalyze) WithDetailed(v bool) func(*SnapshotRepository } // WithEarlyReadNodeCount - number of nodes on which to perform an early read on a blob, i.e. before writing has completed. early reads are rare actions so the 'rare_action_probability' parameter is also relevant. defaults to 2.. +// func (f SnapshotRepositoryAnalyze) WithEarlyReadNodeCount(v int) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.EarlyReadNodeCount = &v @@ -229,6 +237,7 @@ func (f SnapshotRepositoryAnalyze) WithEarlyReadNodeCount(v int) func(*SnapshotR } // WithMaxBlobSize - maximum size of a blob to create during the test, e.g '1gb' or '100mb'. defaults to '10mb'.. +// func (f SnapshotRepositoryAnalyze) WithMaxBlobSize(v string) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.MaxBlobSize = v @@ -236,6 +245,7 @@ func (f SnapshotRepositoryAnalyze) WithMaxBlobSize(v string) func(*SnapshotRepos } // WithMaxTotalDataSize - maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. defaults to '1gb'.. +// func (f SnapshotRepositoryAnalyze) WithMaxTotalDataSize(v string) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.MaxTotalDataSize = v @@ -243,6 +253,7 @@ func (f SnapshotRepositoryAnalyze) WithMaxTotalDataSize(v string) func(*Snapshot } // WithRareActionProbability - probability of taking a rare action such as an early read or an overwrite. defaults to 0.02.. +// func (f SnapshotRepositoryAnalyze) WithRareActionProbability(v int) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.RareActionProbability = &v @@ -250,6 +261,7 @@ func (f SnapshotRepositoryAnalyze) WithRareActionProbability(v int) func(*Snapsh } // WithRarelyAbortWrites - whether to rarely abort writes before they complete. defaults to 'true'.. +// func (f SnapshotRepositoryAnalyze) WithRarelyAbortWrites(v bool) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.RarelyAbortWrites = &v @@ -257,6 +269,7 @@ func (f SnapshotRepositoryAnalyze) WithRarelyAbortWrites(v bool) func(*SnapshotR } // WithReadNodeCount - number of nodes on which to read a blob after writing. defaults to 10.. +// func (f SnapshotRepositoryAnalyze) WithReadNodeCount(v int) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.ReadNodeCount = &v @@ -264,6 +277,7 @@ func (f SnapshotRepositoryAnalyze) WithReadNodeCount(v int) func(*SnapshotReposi } // WithSeed - seed for the random number generator used to create the test workload. defaults to a random value.. +// func (f SnapshotRepositoryAnalyze) WithSeed(v int) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.Seed = &v @@ -271,6 +285,7 @@ func (f SnapshotRepositoryAnalyze) WithSeed(v int) func(*SnapshotRepositoryAnaly } // WithTimeout - explicit operation timeout. defaults to '30s'.. +// func (f SnapshotRepositoryAnalyze) WithTimeout(v time.Duration) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.Timeout = v @@ -278,6 +293,7 @@ func (f SnapshotRepositoryAnalyze) WithTimeout(v time.Duration) func(*SnapshotRe } // WithPretty makes the response body pretty-printed. +// func (f SnapshotRepositoryAnalyze) WithPretty() func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.Pretty = true @@ -285,6 +301,7 @@ func (f SnapshotRepositoryAnalyze) WithPretty() func(*SnapshotRepositoryAnalyzeR } // WithHuman makes statistical values human-readable. +// func (f SnapshotRepositoryAnalyze) WithHuman() func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.Human = true @@ -292,6 +309,7 @@ func (f SnapshotRepositoryAnalyze) WithHuman() func(*SnapshotRepositoryAnalyzeRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotRepositoryAnalyze) WithErrorTrace() func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.ErrorTrace = true @@ -299,6 +317,7 @@ func (f SnapshotRepositoryAnalyze) WithErrorTrace() func(*SnapshotRepositoryAnal } // WithFilterPath filters the properties of the response body. +// func (f SnapshotRepositoryAnalyze) WithFilterPath(v ...string) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { r.FilterPath = v @@ -306,6 +325,7 @@ func (f SnapshotRepositoryAnalyze) WithFilterPath(v ...string) func(*SnapshotRep } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotRepositoryAnalyze) WithHeader(h map[string]string) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { if r.Header == nil { @@ -318,6 +338,7 @@ func (f SnapshotRepositoryAnalyze) WithHeader(h map[string]string) func(*Snapsho } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotRepositoryAnalyze) WithOpaqueID(s string) func(*SnapshotRepositoryAnalyzeRequest) { return func(r *SnapshotRepositoryAnalyzeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.restore.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.restore.go index 224f0dc5f25..e93b8ae3077 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.restore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.restore.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newSnapshotRestoreFunc(t Transport) SnapshotRestore { // SnapshotRestore restores a snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotRestore func(repository string, snapshot string, o ...func(*SnapshotRestoreRequest)) (*Response, error) // SnapshotRestoreRequest configures the Snapshot Restore API request. +// type SnapshotRestoreRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type SnapshotRestoreRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -124,6 +127,10 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -136,10 +143,6 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -159,6 +162,7 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SnapshotRestore) WithContext(v context.Context) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.ctx = v @@ -166,6 +170,7 @@ func (f SnapshotRestore) WithContext(v context.Context) func(*SnapshotRestoreReq } // WithBody - Details of what to restore. +// func (f SnapshotRestore) WithBody(v io.Reader) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.Body = v @@ -173,6 +178,7 @@ func (f SnapshotRestore) WithBody(v io.Reader) func(*SnapshotRestoreRequest) { } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotRestore) WithMasterTimeout(v time.Duration) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.MasterTimeout = v @@ -180,6 +186,7 @@ func (f SnapshotRestore) WithMasterTimeout(v time.Duration) func(*SnapshotRestor } // WithWaitForCompletion - should this request wait until the operation has completed before returning. +// func (f SnapshotRestore) WithWaitForCompletion(v bool) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.WaitForCompletion = &v @@ -187,6 +194,7 @@ func (f SnapshotRestore) WithWaitForCompletion(v bool) func(*SnapshotRestoreRequ } // WithPretty makes the response body pretty-printed. +// func (f SnapshotRestore) WithPretty() func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.Pretty = true @@ -194,6 +202,7 @@ func (f SnapshotRestore) WithPretty() func(*SnapshotRestoreRequest) { } // WithHuman makes statistical values human-readable. +// func (f SnapshotRestore) WithHuman() func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.Human = true @@ -201,6 +210,7 @@ func (f SnapshotRestore) WithHuman() func(*SnapshotRestoreRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotRestore) WithErrorTrace() func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.ErrorTrace = true @@ -208,6 +218,7 @@ func (f SnapshotRestore) WithErrorTrace() func(*SnapshotRestoreRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SnapshotRestore) WithFilterPath(v ...string) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { r.FilterPath = v @@ -215,6 +226,7 @@ func (f SnapshotRestore) WithFilterPath(v ...string) func(*SnapshotRestoreReques } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotRestore) WithHeader(h map[string]string) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { if r.Header == nil { @@ -227,6 +239,7 @@ func (f SnapshotRestore) WithHeader(h map[string]string) func(*SnapshotRestoreRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotRestore) WithOpaqueID(s string) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.status.go index c72453e53e0..34d1bfb94fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSnapshotStatusFunc(t Transport) SnapshotStatus { // SnapshotStatus returns information about the status of a snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotStatus func(o ...func(*SnapshotStatusRequest)) (*Response, error) // SnapshotStatusRequest configures the Snapshot Status API request. +// type SnapshotStatusRequest struct { Repository string Snapshot []string @@ -63,6 +65,7 @@ type SnapshotStatusRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -156,6 +159,7 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f SnapshotStatus) WithContext(v context.Context) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f SnapshotStatus) WithContext(v context.Context) func(*SnapshotStatusReque } // WithRepository - a repository name. +// func (f SnapshotStatus) WithRepository(v string) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.Repository = v @@ -170,6 +175,7 @@ func (f SnapshotStatus) WithRepository(v string) func(*SnapshotStatusRequest) { } // WithSnapshot - a list of snapshot names. +// func (f SnapshotStatus) WithSnapshot(v ...string) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.Snapshot = v @@ -177,6 +183,7 @@ func (f SnapshotStatus) WithSnapshot(v ...string) func(*SnapshotStatusRequest) { } // WithIgnoreUnavailable - whether to ignore unavailable snapshots, defaults to false which means a snapshotmissingexception is thrown. +// func (f SnapshotStatus) WithIgnoreUnavailable(v bool) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.IgnoreUnavailable = &v @@ -184,6 +191,7 @@ func (f SnapshotStatus) WithIgnoreUnavailable(v bool) func(*SnapshotStatusReques } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotStatus) WithMasterTimeout(v time.Duration) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.MasterTimeout = v @@ -191,6 +199,7 @@ func (f SnapshotStatus) WithMasterTimeout(v time.Duration) func(*SnapshotStatusR } // WithPretty makes the response body pretty-printed. +// func (f SnapshotStatus) WithPretty() func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.Pretty = true @@ -198,6 +207,7 @@ func (f SnapshotStatus) WithPretty() func(*SnapshotStatusRequest) { } // WithHuman makes statistical values human-readable. +// func (f SnapshotStatus) WithHuman() func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.Human = true @@ -205,6 +215,7 @@ func (f SnapshotStatus) WithHuman() func(*SnapshotStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotStatus) WithErrorTrace() func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.ErrorTrace = true @@ -212,6 +223,7 @@ func (f SnapshotStatus) WithErrorTrace() func(*SnapshotStatusRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SnapshotStatus) WithFilterPath(v ...string) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { r.FilterPath = v @@ -219,6 +231,7 @@ func (f SnapshotStatus) WithFilterPath(v ...string) func(*SnapshotStatusRequest) } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotStatus) WithHeader(h map[string]string) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { if r.Header == nil { @@ -231,6 +244,7 @@ func (f SnapshotStatus) WithHeader(h map[string]string) func(*SnapshotStatusRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotStatus) WithOpaqueID(s string) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.verify_repository.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.verify_repository.go index b6ca5216870..25c027ea164 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.verify_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.verify_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSnapshotVerifyRepositoryFunc(t Transport) SnapshotVerifyRepository { // SnapshotVerifyRepository verifies a repository. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// type SnapshotVerifyRepository func(repository string, o ...func(*SnapshotVerifyRepositoryRequest)) (*Response, error) // SnapshotVerifyRepositoryRequest configures the Snapshot Verify Repository API request. +// type SnapshotVerifyRepositoryRequest struct { Repository string @@ -61,6 +63,7 @@ type SnapshotVerifyRepositoryRequest struct { } // Do executes the request and returns response or error. +// func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SnapshotVerifyRepository) WithContext(v context.Context) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f SnapshotVerifyRepository) WithContext(v context.Context) func(*SnapshotV } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SnapshotVerifyRepository) WithMasterTimeout(v time.Duration) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.MasterTimeout = v @@ -162,6 +167,7 @@ func (f SnapshotVerifyRepository) WithMasterTimeout(v time.Duration) func(*Snaps } // WithTimeout - explicit operation timeout. +// func (f SnapshotVerifyRepository) WithTimeout(v time.Duration) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.Timeout = v @@ -169,6 +175,7 @@ func (f SnapshotVerifyRepository) WithTimeout(v time.Duration) func(*SnapshotVer } // WithPretty makes the response body pretty-printed. +// func (f SnapshotVerifyRepository) WithPretty() func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f SnapshotVerifyRepository) WithPretty() func(*SnapshotVerifyRepositoryReq } // WithHuman makes statistical values human-readable. +// func (f SnapshotVerifyRepository) WithHuman() func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f SnapshotVerifyRepository) WithHuman() func(*SnapshotVerifyRepositoryRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SnapshotVerifyRepository) WithErrorTrace() func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f SnapshotVerifyRepository) WithErrorTrace() func(*SnapshotVerifyRepositor } // WithFilterPath filters the properties of the response body. +// func (f SnapshotVerifyRepository) WithFilterPath(v ...string) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f SnapshotVerifyRepository) WithFilterPath(v ...string) func(*SnapshotVeri } // WithHeader adds the headers to the HTTP request. +// func (f SnapshotVerifyRepository) WithHeader(h map[string]string) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f SnapshotVerifyRepository) WithHeader(h map[string]string) func(*Snapshot } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SnapshotVerifyRepository) WithOpaqueID(s string) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.cancel.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.cancel.go index c86c2ef8758..a2ffd97335b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.cancel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.cancel.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newTasksCancelFunc(t Transport) TasksCancel { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// type TasksCancel func(o ...func(*TasksCancelRequest)) (*Response, error) // TasksCancelRequest configures the Tasks Cancel API request. +// type TasksCancelRequest struct { TaskID string @@ -65,6 +67,7 @@ type TasksCancelRequest struct { } // Do executes the request and returns response or error. +// func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -162,6 +165,7 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f TasksCancel) WithContext(v context.Context) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f TasksCancel) WithContext(v context.Context) func(*TasksCancelRequest) { } // WithTaskID - cancel the task with specified task ID (node_id:task_number). +// func (f TasksCancel) WithTaskID(v string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.TaskID = v @@ -176,6 +181,7 @@ func (f TasksCancel) WithTaskID(v string) func(*TasksCancelRequest) { } // WithActions - a list of actions that should be cancelled. leave empty to cancel all.. +// func (f TasksCancel) WithActions(v ...string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.Actions = v @@ -183,6 +189,7 @@ func (f TasksCancel) WithActions(v ...string) func(*TasksCancelRequest) { } // WithNodes - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f TasksCancel) WithNodes(v ...string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.Nodes = v @@ -190,6 +197,7 @@ func (f TasksCancel) WithNodes(v ...string) func(*TasksCancelRequest) { } // WithParentTaskID - cancel tasks with specified parent task ID (node_id:task_number). set to -1 to cancel all.. +// func (f TasksCancel) WithParentTaskID(v string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.ParentTaskID = v @@ -197,6 +205,7 @@ func (f TasksCancel) WithParentTaskID(v string) func(*TasksCancelRequest) { } // WithWaitForCompletion - should the request block until the cancellation of the task and its descendant tasks is completed. defaults to false. +// func (f TasksCancel) WithWaitForCompletion(v bool) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.WaitForCompletion = &v @@ -204,6 +213,7 @@ func (f TasksCancel) WithWaitForCompletion(v bool) func(*TasksCancelRequest) { } // WithPretty makes the response body pretty-printed. +// func (f TasksCancel) WithPretty() func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.Pretty = true @@ -211,6 +221,7 @@ func (f TasksCancel) WithPretty() func(*TasksCancelRequest) { } // WithHuman makes statistical values human-readable. +// func (f TasksCancel) WithHuman() func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.Human = true @@ -218,6 +229,7 @@ func (f TasksCancel) WithHuman() func(*TasksCancelRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TasksCancel) WithErrorTrace() func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.ErrorTrace = true @@ -225,6 +237,7 @@ func (f TasksCancel) WithErrorTrace() func(*TasksCancelRequest) { } // WithFilterPath filters the properties of the response body. +// func (f TasksCancel) WithFilterPath(v ...string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { r.FilterPath = v @@ -232,6 +245,7 @@ func (f TasksCancel) WithFilterPath(v ...string) func(*TasksCancelRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f TasksCancel) WithHeader(h map[string]string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { if r.Header == nil { @@ -244,6 +258,7 @@ func (f TasksCancel) WithHeader(h map[string]string) func(*TasksCancelRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TasksCancel) WithOpaqueID(s string) func(*TasksCancelRequest) { return func(r *TasksCancelRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.get.go index af0362fa7fd..c7390c3c1ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newTasksGetFunc(t Transport) TasksGet { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// type TasksGet func(task_id string, o ...func(*TasksGetRequest)) (*Response, error) // TasksGetRequest configures the Tasks Get API request. +// type TasksGetRequest struct { TaskID string @@ -64,6 +66,7 @@ type TasksGetRequest struct { } // Do executes the request and returns response or error. +// func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -149,6 +152,7 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f TasksGet) WithContext(v context.Context) func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f TasksGet) WithContext(v context.Context) func(*TasksGetRequest) { } // WithTimeout - explicit operation timeout. +// func (f TasksGet) WithTimeout(v time.Duration) func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.Timeout = v @@ -163,6 +168,7 @@ func (f TasksGet) WithTimeout(v time.Duration) func(*TasksGetRequest) { } // WithWaitForCompletion - wait for the matching tasks to complete (default: false). +// func (f TasksGet) WithWaitForCompletion(v bool) func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.WaitForCompletion = &v @@ -170,6 +176,7 @@ func (f TasksGet) WithWaitForCompletion(v bool) func(*TasksGetRequest) { } // WithPretty makes the response body pretty-printed. +// func (f TasksGet) WithPretty() func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.Pretty = true @@ -177,6 +184,7 @@ func (f TasksGet) WithPretty() func(*TasksGetRequest) { } // WithHuman makes statistical values human-readable. +// func (f TasksGet) WithHuman() func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.Human = true @@ -184,6 +192,7 @@ func (f TasksGet) WithHuman() func(*TasksGetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TasksGet) WithErrorTrace() func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.ErrorTrace = true @@ -191,6 +200,7 @@ func (f TasksGet) WithErrorTrace() func(*TasksGetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f TasksGet) WithFilterPath(v ...string) func(*TasksGetRequest) { return func(r *TasksGetRequest) { r.FilterPath = v @@ -198,6 +208,7 @@ func (f TasksGet) WithFilterPath(v ...string) func(*TasksGetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f TasksGet) WithHeader(h map[string]string) func(*TasksGetRequest) { return func(r *TasksGetRequest) { if r.Header == nil { @@ -210,6 +221,7 @@ func (f TasksGet) WithHeader(h map[string]string) func(*TasksGetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TasksGet) WithOpaqueID(s string) func(*TasksGetRequest) { return func(r *TasksGetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.list.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.list.go index 047f4901d75..4c023e0bd94 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.tasks.list.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newTasksListFunc(t Transport) TasksList { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// type TasksList func(o ...func(*TasksListRequest)) (*Response, error) // TasksListRequest configures the Tasks List API request. +// type TasksListRequest struct { Actions []string Detailed *bool @@ -67,6 +69,7 @@ type TasksListRequest struct { } // Do executes the request and returns response or error. +// func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -169,6 +172,7 @@ func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f TasksList) WithContext(v context.Context) func(*TasksListRequest) { return func(r *TasksListRequest) { r.ctx = v @@ -176,6 +180,7 @@ func (f TasksList) WithContext(v context.Context) func(*TasksListRequest) { } // WithActions - a list of actions that should be returned. leave empty to return all.. +// func (f TasksList) WithActions(v ...string) func(*TasksListRequest) { return func(r *TasksListRequest) { r.Actions = v @@ -183,6 +188,7 @@ func (f TasksList) WithActions(v ...string) func(*TasksListRequest) { } // WithDetailed - return detailed task information (default: false). +// func (f TasksList) WithDetailed(v bool) func(*TasksListRequest) { return func(r *TasksListRequest) { r.Detailed = &v @@ -190,6 +196,7 @@ func (f TasksList) WithDetailed(v bool) func(*TasksListRequest) { } // WithGroupBy - group tasks by nodes or parent/child relationships. +// func (f TasksList) WithGroupBy(v string) func(*TasksListRequest) { return func(r *TasksListRequest) { r.GroupBy = v @@ -197,6 +204,7 @@ func (f TasksList) WithGroupBy(v string) func(*TasksListRequest) { } // WithNodes - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f TasksList) WithNodes(v ...string) func(*TasksListRequest) { return func(r *TasksListRequest) { r.Nodes = v @@ -204,6 +212,7 @@ func (f TasksList) WithNodes(v ...string) func(*TasksListRequest) { } // WithParentTaskID - return tasks with specified parent task ID (node_id:task_number). set to -1 to return all.. +// func (f TasksList) WithParentTaskID(v string) func(*TasksListRequest) { return func(r *TasksListRequest) { r.ParentTaskID = v @@ -211,6 +220,7 @@ func (f TasksList) WithParentTaskID(v string) func(*TasksListRequest) { } // WithTimeout - explicit operation timeout. +// func (f TasksList) WithTimeout(v time.Duration) func(*TasksListRequest) { return func(r *TasksListRequest) { r.Timeout = v @@ -218,6 +228,7 @@ func (f TasksList) WithTimeout(v time.Duration) func(*TasksListRequest) { } // WithWaitForCompletion - wait for the matching tasks to complete (default: false). +// func (f TasksList) WithWaitForCompletion(v bool) func(*TasksListRequest) { return func(r *TasksListRequest) { r.WaitForCompletion = &v @@ -225,6 +236,7 @@ func (f TasksList) WithWaitForCompletion(v bool) func(*TasksListRequest) { } // WithPretty makes the response body pretty-printed. +// func (f TasksList) WithPretty() func(*TasksListRequest) { return func(r *TasksListRequest) { r.Pretty = true @@ -232,6 +244,7 @@ func (f TasksList) WithPretty() func(*TasksListRequest) { } // WithHuman makes statistical values human-readable. +// func (f TasksList) WithHuman() func(*TasksListRequest) { return func(r *TasksListRequest) { r.Human = true @@ -239,6 +252,7 @@ func (f TasksList) WithHuman() func(*TasksListRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TasksList) WithErrorTrace() func(*TasksListRequest) { return func(r *TasksListRequest) { r.ErrorTrace = true @@ -246,6 +260,7 @@ func (f TasksList) WithErrorTrace() func(*TasksListRequest) { } // WithFilterPath filters the properties of the response body. +// func (f TasksList) WithFilterPath(v ...string) func(*TasksListRequest) { return func(r *TasksListRequest) { r.FilterPath = v @@ -253,6 +268,7 @@ func (f TasksList) WithFilterPath(v ...string) func(*TasksListRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f TasksList) WithHeader(h map[string]string) func(*TasksListRequest) { return func(r *TasksListRequest) { if r.Header == nil { @@ -265,6 +281,7 @@ func (f TasksList) WithHeader(h map[string]string) func(*TasksListRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TasksList) WithOpaqueID(s string) func(*TasksListRequest) { return func(r *TasksListRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.terms_enum.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.terms_enum.go index 26b6b5deb1c..3556a71977d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.terms_enum.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.terms_enum.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newTermsEnumFunc(t Transport) TermsEnum { // TermsEnum the terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html. +// type TermsEnum func(index []string, o ...func(*TermsEnumRequest)) (*Response, error) // TermsEnumRequest configures the Terms Enum API request. +// type TermsEnumRequest struct { Index []string @@ -61,6 +63,7 @@ type TermsEnumRequest struct { } // Do executes the request and returns response or error. +// func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -111,6 +114,10 @@ func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -123,10 +130,6 @@ func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -146,6 +149,7 @@ func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f TermsEnum) WithContext(v context.Context) func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { r.ctx = v @@ -153,6 +157,7 @@ func (f TermsEnum) WithContext(v context.Context) func(*TermsEnumRequest) { } // WithBody - field name, string which is the prefix expected in matching terms, timeout and size for max number of results. +// func (f TermsEnum) WithBody(v io.Reader) func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { r.Body = v @@ -160,6 +165,7 @@ func (f TermsEnum) WithBody(v io.Reader) func(*TermsEnumRequest) { } // WithPretty makes the response body pretty-printed. +// func (f TermsEnum) WithPretty() func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { r.Pretty = true @@ -167,6 +173,7 @@ func (f TermsEnum) WithPretty() func(*TermsEnumRequest) { } // WithHuman makes statistical values human-readable. +// func (f TermsEnum) WithHuman() func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { r.Human = true @@ -174,6 +181,7 @@ func (f TermsEnum) WithHuman() func(*TermsEnumRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TermsEnum) WithErrorTrace() func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { r.ErrorTrace = true @@ -181,6 +189,7 @@ func (f TermsEnum) WithErrorTrace() func(*TermsEnumRequest) { } // WithFilterPath filters the properties of the response body. +// func (f TermsEnum) WithFilterPath(v ...string) func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { r.FilterPath = v @@ -188,6 +197,7 @@ func (f TermsEnum) WithFilterPath(v ...string) func(*TermsEnumRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f TermsEnum) WithHeader(h map[string]string) func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { if r.Header == nil { @@ -200,6 +210,7 @@ func (f TermsEnum) WithHeader(h map[string]string) func(*TermsEnumRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TermsEnum) WithOpaqueID(s string) func(*TermsEnumRequest) { return func(r *TermsEnumRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.termvectors.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.termvectors.go index 10cdf6a3592..6df1edb68ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.termvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.termvectors.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newTermvectorsFunc(t Transport) Termvectors { // Termvectors returns information and statistics about terms in the fields of a particular document. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html. +// type Termvectors func(index string, o ...func(*TermvectorsRequest)) (*Response, error) // TermvectorsRequest configures the Termvectors API request. +// type TermvectorsRequest struct { Index string DocumentType string @@ -75,6 +77,7 @@ type TermvectorsRequest struct { } // Do executes the request and returns response or error. +// func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -177,6 +180,10 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo 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 @@ -189,10 +196,6 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -212,6 +215,7 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f Termvectors) WithContext(v context.Context) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.ctx = v @@ -219,6 +223,7 @@ func (f Termvectors) WithContext(v context.Context) func(*TermvectorsRequest) { } // WithBody - Define parameters and or supply a document to get termvectors for. See documentation.. +// func (f Termvectors) WithBody(v io.Reader) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Body = v @@ -226,6 +231,7 @@ func (f Termvectors) WithBody(v io.Reader) func(*TermvectorsRequest) { } // WithDocumentID - the ID of the document, when not specified a doc param should be supplied.. +// func (f Termvectors) WithDocumentID(v string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.DocumentID = v @@ -233,6 +239,7 @@ func (f Termvectors) WithDocumentID(v string) func(*TermvectorsRequest) { } // WithDocumentType - the type of the document.. +// func (f Termvectors) WithDocumentType(v string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.DocumentType = v @@ -240,6 +247,7 @@ func (f Termvectors) WithDocumentType(v string) func(*TermvectorsRequest) { } // WithFields - a list of fields to return.. +// func (f Termvectors) WithFields(v ...string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Fields = v @@ -247,6 +255,7 @@ func (f Termvectors) WithFields(v ...string) func(*TermvectorsRequest) { } // WithFieldStatistics - specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.. +// func (f Termvectors) WithFieldStatistics(v bool) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.FieldStatistics = &v @@ -254,6 +263,7 @@ func (f Termvectors) WithFieldStatistics(v bool) func(*TermvectorsRequest) { } // WithOffsets - specifies if term offsets should be returned.. +// func (f Termvectors) WithOffsets(v bool) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Offsets = &v @@ -261,6 +271,7 @@ func (f Termvectors) WithOffsets(v bool) func(*TermvectorsRequest) { } // WithPayloads - specifies if term payloads should be returned.. +// func (f Termvectors) WithPayloads(v bool) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Payloads = &v @@ -268,6 +279,7 @@ func (f Termvectors) WithPayloads(v bool) func(*TermvectorsRequest) { } // WithPositions - specifies if term positions should be returned.. +// func (f Termvectors) WithPositions(v bool) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Positions = &v @@ -275,6 +287,7 @@ func (f Termvectors) WithPositions(v bool) func(*TermvectorsRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random).. +// func (f Termvectors) WithPreference(v string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Preference = v @@ -282,6 +295,7 @@ func (f Termvectors) WithPreference(v string) func(*TermvectorsRequest) { } // WithRealtime - specifies if request is real-time as opposed to near-real-time (default: true).. +// func (f Termvectors) WithRealtime(v bool) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Realtime = &v @@ -289,6 +303,7 @@ func (f Termvectors) WithRealtime(v bool) func(*TermvectorsRequest) { } // WithRouting - specific routing value.. +// func (f Termvectors) WithRouting(v string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Routing = v @@ -296,6 +311,7 @@ func (f Termvectors) WithRouting(v string) func(*TermvectorsRequest) { } // WithTermStatistics - specifies if total term frequency and document frequency should be returned.. +// func (f Termvectors) WithTermStatistics(v bool) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.TermStatistics = &v @@ -303,6 +319,7 @@ func (f Termvectors) WithTermStatistics(v bool) func(*TermvectorsRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f Termvectors) WithVersion(v int) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Version = &v @@ -310,6 +327,7 @@ func (f Termvectors) WithVersion(v int) func(*TermvectorsRequest) { } // WithVersionType - specific version type. +// func (f Termvectors) WithVersionType(v string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.VersionType = v @@ -317,6 +335,7 @@ func (f Termvectors) WithVersionType(v string) func(*TermvectorsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Termvectors) WithPretty() func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Pretty = true @@ -324,6 +343,7 @@ func (f Termvectors) WithPretty() func(*TermvectorsRequest) { } // WithHuman makes statistical values human-readable. +// func (f Termvectors) WithHuman() func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Human = true @@ -331,6 +351,7 @@ func (f Termvectors) WithHuman() func(*TermvectorsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Termvectors) WithErrorTrace() func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.ErrorTrace = true @@ -338,6 +359,7 @@ func (f Termvectors) WithErrorTrace() func(*TermvectorsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Termvectors) WithFilterPath(v ...string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.FilterPath = v @@ -345,6 +367,7 @@ func (f Termvectors) WithFilterPath(v ...string) func(*TermvectorsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Termvectors) WithHeader(h map[string]string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { if r.Header == nil { @@ -357,6 +380,7 @@ func (f Termvectors) WithHeader(h map[string]string) func(*TermvectorsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Termvectors) WithOpaqueID(s string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update.go index 6c541b0e33d..b5f80fe3901 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newUpdateFunc(t Transport) Update { // Update updates a document with a script or partial document. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html. +// type Update func(index string, id string, body io.Reader, o ...func(*UpdateRequest)) (*Response, error) // UpdateRequest configures the Update API request. +// type UpdateRequest struct { Index string DocumentType string @@ -77,6 +79,7 @@ type UpdateRequest struct { } // Do executes the request and returns response or error. +// func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -181,6 +184,10 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, 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 @@ -193,10 +200,6 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -216,6 +219,7 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f Update) WithContext(v context.Context) func(*UpdateRequest) { return func(r *UpdateRequest) { r.ctx = v @@ -223,6 +227,7 @@ func (f Update) WithContext(v context.Context) func(*UpdateRequest) { } // WithDocumentType - the type of the document. +// func (f Update) WithDocumentType(v string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.DocumentType = v @@ -230,6 +235,7 @@ func (f Update) WithDocumentType(v string) func(*UpdateRequest) { } // WithIfPrimaryTerm - only perform the update operation if the last operation that has changed the document has the specified primary term. +// func (f Update) WithIfPrimaryTerm(v int) func(*UpdateRequest) { return func(r *UpdateRequest) { r.IfPrimaryTerm = &v @@ -237,6 +243,7 @@ func (f Update) WithIfPrimaryTerm(v int) func(*UpdateRequest) { } // WithIfSeqNo - only perform the update operation if the last operation that has changed the document has the specified sequence number. +// func (f Update) WithIfSeqNo(v int) func(*UpdateRequest) { return func(r *UpdateRequest) { r.IfSeqNo = &v @@ -244,6 +251,7 @@ func (f Update) WithIfSeqNo(v int) func(*UpdateRequest) { } // WithLang - the script language (default: painless). +// func (f Update) WithLang(v string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.Lang = v @@ -251,6 +259,7 @@ func (f Update) WithLang(v string) func(*UpdateRequest) { } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.. +// func (f Update) WithRefresh(v string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.Refresh = v @@ -258,6 +267,7 @@ func (f Update) WithRefresh(v string) func(*UpdateRequest) { } // WithRequireAlias - when true, requires destination is an alias. default is false. +// func (f Update) WithRequireAlias(v bool) func(*UpdateRequest) { return func(r *UpdateRequest) { r.RequireAlias = &v @@ -265,6 +275,7 @@ func (f Update) WithRequireAlias(v bool) func(*UpdateRequest) { } // WithRetryOnConflict - specify how many times should the operation be retried when a conflict occurs (default: 0). +// func (f Update) WithRetryOnConflict(v int) func(*UpdateRequest) { return func(r *UpdateRequest) { r.RetryOnConflict = &v @@ -272,6 +283,7 @@ func (f Update) WithRetryOnConflict(v int) func(*UpdateRequest) { } // WithRouting - specific routing value. +// func (f Update) WithRouting(v string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.Routing = v @@ -279,6 +291,7 @@ func (f Update) WithRouting(v string) func(*UpdateRequest) { } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f Update) WithSource(v ...string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.Source = v @@ -286,6 +299,7 @@ func (f Update) WithSource(v ...string) func(*UpdateRequest) { } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f Update) WithSourceExcludes(v ...string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.SourceExcludes = v @@ -293,6 +307,7 @@ func (f Update) WithSourceExcludes(v ...string) func(*UpdateRequest) { } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f Update) WithSourceIncludes(v ...string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.SourceIncludes = v @@ -300,6 +315,7 @@ func (f Update) WithSourceIncludes(v ...string) func(*UpdateRequest) { } // WithTimeout - explicit operation timeout. +// func (f Update) WithTimeout(v time.Duration) func(*UpdateRequest) { return func(r *UpdateRequest) { r.Timeout = v @@ -307,6 +323,7 @@ func (f Update) WithTimeout(v time.Duration) func(*UpdateRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the update operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f Update) WithWaitForActiveShards(v string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.WaitForActiveShards = v @@ -314,6 +331,7 @@ func (f Update) WithWaitForActiveShards(v string) func(*UpdateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f Update) WithPretty() func(*UpdateRequest) { return func(r *UpdateRequest) { r.Pretty = true @@ -321,6 +339,7 @@ func (f Update) WithPretty() func(*UpdateRequest) { } // WithHuman makes statistical values human-readable. +// func (f Update) WithHuman() func(*UpdateRequest) { return func(r *UpdateRequest) { r.Human = true @@ -328,6 +347,7 @@ func (f Update) WithHuman() func(*UpdateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f Update) WithErrorTrace() func(*UpdateRequest) { return func(r *UpdateRequest) { r.ErrorTrace = true @@ -335,6 +355,7 @@ func (f Update) WithErrorTrace() func(*UpdateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f Update) WithFilterPath(v ...string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.FilterPath = v @@ -342,6 +363,7 @@ func (f Update) WithFilterPath(v ...string) func(*UpdateRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f Update) WithHeader(h map[string]string) func(*UpdateRequest) { return func(r *UpdateRequest) { if r.Header == nil { @@ -354,6 +376,7 @@ func (f Update) WithHeader(h map[string]string) func(*UpdateRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f Update) WithOpaqueID(s string) func(*UpdateRequest) { return func(r *UpdateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query.go index a85c5f3cc43..caa5b3565e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -46,9 +46,11 @@ func newUpdateByQueryFunc(t Transport) UpdateByQuery { // for example to pick up a mapping change. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html. +// type UpdateByQuery func(index []string, o ...func(*UpdateByQueryRequest)) (*Response, error) // UpdateByQueryRequest configures the Update By Query API request. +// type UpdateByQueryRequest struct { Index []string DocumentType []string @@ -99,6 +101,7 @@ type UpdateByQueryRequest struct { } // Do executes the request and returns response or error. +// func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -281,6 +284,10 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -293,10 +300,6 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -316,6 +319,7 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f UpdateByQuery) WithContext(v context.Context) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.ctx = v @@ -323,6 +327,7 @@ func (f UpdateByQuery) WithContext(v context.Context) func(*UpdateByQueryRequest } // WithBody - The search definition using the Query DSL. +// func (f UpdateByQuery) WithBody(v io.Reader) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Body = v @@ -330,6 +335,7 @@ func (f UpdateByQuery) WithBody(v io.Reader) func(*UpdateByQueryRequest) { } // WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// func (f UpdateByQuery) WithDocumentType(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.DocumentType = v @@ -337,6 +343,7 @@ func (f UpdateByQuery) WithDocumentType(v ...string) func(*UpdateByQueryRequest) } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f UpdateByQuery) WithAllowNoIndices(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.AllowNoIndices = &v @@ -344,6 +351,7 @@ func (f UpdateByQuery) WithAllowNoIndices(v bool) func(*UpdateByQueryRequest) { } // WithAnalyzer - the analyzer to use for the query string. +// func (f UpdateByQuery) WithAnalyzer(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Analyzer = v @@ -351,6 +359,7 @@ func (f UpdateByQuery) WithAnalyzer(v string) func(*UpdateByQueryRequest) { } // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). +// func (f UpdateByQuery) WithAnalyzeWildcard(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.AnalyzeWildcard = &v @@ -358,6 +367,7 @@ func (f UpdateByQuery) WithAnalyzeWildcard(v bool) func(*UpdateByQueryRequest) { } // WithConflicts - what to do when the update by query hits version conflicts?. +// func (f UpdateByQuery) WithConflicts(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Conflicts = v @@ -365,6 +375,7 @@ func (f UpdateByQuery) WithConflicts(v string) func(*UpdateByQueryRequest) { } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f UpdateByQuery) WithDefaultOperator(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.DefaultOperator = v @@ -372,6 +383,7 @@ func (f UpdateByQuery) WithDefaultOperator(v string) func(*UpdateByQueryRequest) } // WithDf - the field to use as default where no field prefix is given in the query string. +// func (f UpdateByQuery) WithDf(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Df = v @@ -379,6 +391,7 @@ func (f UpdateByQuery) WithDf(v string) func(*UpdateByQueryRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f UpdateByQuery) WithExpandWildcards(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.ExpandWildcards = v @@ -386,6 +399,7 @@ func (f UpdateByQuery) WithExpandWildcards(v string) func(*UpdateByQueryRequest) } // WithFrom - starting offset (default: 0). +// func (f UpdateByQuery) WithFrom(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.From = &v @@ -393,6 +407,7 @@ func (f UpdateByQuery) WithFrom(v int) func(*UpdateByQueryRequest) { } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f UpdateByQuery) WithIgnoreUnavailable(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.IgnoreUnavailable = &v @@ -400,6 +415,7 @@ func (f UpdateByQuery) WithIgnoreUnavailable(v bool) func(*UpdateByQueryRequest) } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f UpdateByQuery) WithLenient(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Lenient = &v @@ -407,6 +423,7 @@ func (f UpdateByQuery) WithLenient(v bool) func(*UpdateByQueryRequest) { } // WithMaxDocs - maximum number of documents to process (default: all documents). +// func (f UpdateByQuery) WithMaxDocs(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.MaxDocs = &v @@ -414,6 +431,7 @@ func (f UpdateByQuery) WithMaxDocs(v int) func(*UpdateByQueryRequest) { } // WithPipeline - ingest pipeline to set on index requests made by this action. (default: none). +// func (f UpdateByQuery) WithPipeline(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Pipeline = v @@ -421,6 +439,7 @@ func (f UpdateByQuery) WithPipeline(v string) func(*UpdateByQueryRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f UpdateByQuery) WithPreference(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Preference = v @@ -428,6 +447,7 @@ func (f UpdateByQuery) WithPreference(v string) func(*UpdateByQueryRequest) { } // WithQuery - query in the lucene query string syntax. +// func (f UpdateByQuery) WithQuery(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Query = v @@ -435,6 +455,7 @@ func (f UpdateByQuery) WithQuery(v string) func(*UpdateByQueryRequest) { } // WithRefresh - should the affected indexes be refreshed?. +// func (f UpdateByQuery) WithRefresh(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Refresh = &v @@ -442,6 +463,7 @@ func (f UpdateByQuery) WithRefresh(v bool) func(*UpdateByQueryRequest) { } // WithRequestCache - specify if request cache should be used for this request or not, defaults to index level setting. +// func (f UpdateByQuery) WithRequestCache(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.RequestCache = &v @@ -449,6 +471,7 @@ func (f UpdateByQuery) WithRequestCache(v bool) func(*UpdateByQueryRequest) { } // WithRequestsPerSecond - the throttle to set on this request in sub-requests per second. -1 means no throttle.. +// func (f UpdateByQuery) WithRequestsPerSecond(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.RequestsPerSecond = &v @@ -456,6 +479,7 @@ func (f UpdateByQuery) WithRequestsPerSecond(v int) func(*UpdateByQueryRequest) } // WithRouting - a list of specific routing values. +// func (f UpdateByQuery) WithRouting(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Routing = v @@ -463,6 +487,7 @@ func (f UpdateByQuery) WithRouting(v ...string) func(*UpdateByQueryRequest) { } // WithScroll - specify how long a consistent view of the index should be maintained for scrolled search. +// func (f UpdateByQuery) WithScroll(v time.Duration) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Scroll = v @@ -470,6 +495,7 @@ func (f UpdateByQuery) WithScroll(v time.Duration) func(*UpdateByQueryRequest) { } // WithScrollSize - size on the scroll request powering the update by query. +// func (f UpdateByQuery) WithScrollSize(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.ScrollSize = &v @@ -477,6 +503,7 @@ func (f UpdateByQuery) WithScrollSize(v int) func(*UpdateByQueryRequest) { } // WithSearchTimeout - explicit timeout for each search request. defaults to no timeout.. +// func (f UpdateByQuery) WithSearchTimeout(v time.Duration) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.SearchTimeout = v @@ -484,6 +511,7 @@ func (f UpdateByQuery) WithSearchTimeout(v time.Duration) func(*UpdateByQueryReq } // WithSearchType - search operation type. +// func (f UpdateByQuery) WithSearchType(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.SearchType = v @@ -491,6 +519,7 @@ func (f UpdateByQuery) WithSearchType(v string) func(*UpdateByQueryRequest) { } // WithSize - deprecated, please use `max_docs` instead. +// func (f UpdateByQuery) WithSize(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Size = &v @@ -498,6 +527,7 @@ func (f UpdateByQuery) WithSize(v int) func(*UpdateByQueryRequest) { } // WithSlices - the number of slices this task should be divided into. defaults to 1, meaning the task isn't sliced into subtasks. can be set to `auto`.. +// func (f UpdateByQuery) WithSlices(v interface{}) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Slices = v @@ -505,6 +535,7 @@ func (f UpdateByQuery) WithSlices(v interface{}) func(*UpdateByQueryRequest) { } // WithSort - a list of : pairs. +// func (f UpdateByQuery) WithSort(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Sort = v @@ -512,6 +543,7 @@ func (f UpdateByQuery) WithSort(v ...string) func(*UpdateByQueryRequest) { } // WithStats - specific 'tag' of the request for logging and statistical purposes. +// func (f UpdateByQuery) WithStats(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Stats = v @@ -519,6 +551,7 @@ func (f UpdateByQuery) WithStats(v ...string) func(*UpdateByQueryRequest) { } // WithTerminateAfter - the maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.. +// func (f UpdateByQuery) WithTerminateAfter(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.TerminateAfter = &v @@ -526,6 +559,7 @@ func (f UpdateByQuery) WithTerminateAfter(v int) func(*UpdateByQueryRequest) { } // WithTimeout - time each individual bulk request should wait for shards that are unavailable.. +// func (f UpdateByQuery) WithTimeout(v time.Duration) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Timeout = v @@ -533,6 +567,7 @@ func (f UpdateByQuery) WithTimeout(v time.Duration) func(*UpdateByQueryRequest) } // WithVersion - specify whether to return document version as part of a hit. +// func (f UpdateByQuery) WithVersion(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Version = &v @@ -540,6 +575,7 @@ func (f UpdateByQuery) WithVersion(v bool) func(*UpdateByQueryRequest) { } // WithVersionType - should the document increment the version number (internal) on hit or not (reindex). +// func (f UpdateByQuery) WithVersionType(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.VersionType = &v @@ -547,6 +583,7 @@ func (f UpdateByQuery) WithVersionType(v bool) func(*UpdateByQueryRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before proceeding with the update by query operation. defaults to 1, meaning the primary shard only. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f UpdateByQuery) WithWaitForActiveShards(v string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.WaitForActiveShards = v @@ -554,6 +591,7 @@ func (f UpdateByQuery) WithWaitForActiveShards(v string) func(*UpdateByQueryRequ } // WithWaitForCompletion - should the request should block until the update by query operation is complete.. +// func (f UpdateByQuery) WithWaitForCompletion(v bool) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.WaitForCompletion = &v @@ -561,6 +599,7 @@ func (f UpdateByQuery) WithWaitForCompletion(v bool) func(*UpdateByQueryRequest) } // WithPretty makes the response body pretty-printed. +// func (f UpdateByQuery) WithPretty() func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Pretty = true @@ -568,6 +607,7 @@ func (f UpdateByQuery) WithPretty() func(*UpdateByQueryRequest) { } // WithHuman makes statistical values human-readable. +// func (f UpdateByQuery) WithHuman() func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.Human = true @@ -575,6 +615,7 @@ func (f UpdateByQuery) WithHuman() func(*UpdateByQueryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f UpdateByQuery) WithErrorTrace() func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.ErrorTrace = true @@ -582,6 +623,7 @@ func (f UpdateByQuery) WithErrorTrace() func(*UpdateByQueryRequest) { } // WithFilterPath filters the properties of the response body. +// func (f UpdateByQuery) WithFilterPath(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.FilterPath = v @@ -589,6 +631,7 @@ func (f UpdateByQuery) WithFilterPath(v ...string) func(*UpdateByQueryRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f UpdateByQuery) WithHeader(h map[string]string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { if r.Header == nil { @@ -601,6 +644,7 @@ func (f UpdateByQuery) WithHeader(h map[string]string) func(*UpdateByQueryReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f UpdateByQuery) WithOpaqueID(s string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query_rethrottle.go index 206d0b573be..c3c3e4f6f5b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.update_by_query_rethrottle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newUpdateByQueryRethrottleFunc(t Transport) UpdateByQueryRethrottle { // UpdateByQueryRethrottle changes the number of requests per second for a particular Update By Query operation. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html. +// type UpdateByQueryRethrottle func(task_id string, requests_per_second *int, o ...func(*UpdateByQueryRethrottleRequest)) (*Response, error) // UpdateByQueryRethrottleRequest configures the Update By Query Rethrottle API request. +// type UpdateByQueryRethrottleRequest struct { TaskID string @@ -60,6 +62,7 @@ type UpdateByQueryRethrottleRequest struct { } // Do executes the request and returns response or error. +// func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f UpdateByQueryRethrottle) WithContext(v context.Context) func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f UpdateByQueryRethrottle) WithContext(v context.Context) func(*UpdateByQu } // WithRequestsPerSecond - the throttle to set on this request in floating sub-requests per second. -1 means set no throttle.. +// func (f UpdateByQueryRethrottle) WithRequestsPerSecond(v int) func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { r.RequestsPerSecond = &v @@ -157,6 +162,7 @@ func (f UpdateByQueryRethrottle) WithRequestsPerSecond(v int) func(*UpdateByQuer } // WithPretty makes the response body pretty-printed. +// func (f UpdateByQueryRethrottle) WithPretty() func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f UpdateByQueryRethrottle) WithPretty() func(*UpdateByQueryRethrottleReque } // WithHuman makes statistical values human-readable. +// func (f UpdateByQueryRethrottle) WithHuman() func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f UpdateByQueryRethrottle) WithHuman() func(*UpdateByQueryRethrottleReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f UpdateByQueryRethrottle) WithErrorTrace() func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f UpdateByQueryRethrottle) WithErrorTrace() func(*UpdateByQueryRethrottleR } // WithFilterPath filters the properties of the response body. +// func (f UpdateByQueryRethrottle) WithFilterPath(v ...string) func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f UpdateByQueryRethrottle) WithFilterPath(v ...string) func(*UpdateByQuery } // WithHeader adds the headers to the HTTP request. +// func (f UpdateByQueryRethrottle) WithHeader(h map[string]string) func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f UpdateByQueryRethrottle) WithHeader(h map[string]string) func(*UpdateByQ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f UpdateByQueryRethrottle) WithOpaqueID(s string) func(*UpdateByQueryRethrottleRequest) { return func(r *UpdateByQueryRethrottleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.delete.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.delete.go index 2a1c5185046..05c2d5c0ab8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newAsyncSearchDeleteFunc(t Transport) AsyncSearchDelete { // AsyncSearchDelete - Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// type AsyncSearchDelete func(id string, o ...func(*AsyncSearchDeleteRequest)) (*Response, error) // AsyncSearchDeleteRequest configures the Async Search Delete API request. +// type AsyncSearchDeleteRequest struct { DocumentID string @@ -57,6 +59,7 @@ type AsyncSearchDeleteRequest struct { } // Do executes the request and returns response or error. +// func (r AsyncSearchDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -134,6 +137,7 @@ func (r AsyncSearchDeleteRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f AsyncSearchDelete) WithContext(v context.Context) func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { r.ctx = v @@ -141,6 +145,7 @@ func (f AsyncSearchDelete) WithContext(v context.Context) func(*AsyncSearchDelet } // WithPretty makes the response body pretty-printed. +// func (f AsyncSearchDelete) WithPretty() func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { r.Pretty = true @@ -148,6 +153,7 @@ func (f AsyncSearchDelete) WithPretty() func(*AsyncSearchDeleteRequest) { } // WithHuman makes statistical values human-readable. +// func (f AsyncSearchDelete) WithHuman() func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { r.Human = true @@ -155,6 +161,7 @@ func (f AsyncSearchDelete) WithHuman() func(*AsyncSearchDeleteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AsyncSearchDelete) WithErrorTrace() func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { r.ErrorTrace = true @@ -162,6 +169,7 @@ func (f AsyncSearchDelete) WithErrorTrace() func(*AsyncSearchDeleteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f AsyncSearchDelete) WithFilterPath(v ...string) func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { r.FilterPath = v @@ -169,6 +177,7 @@ func (f AsyncSearchDelete) WithFilterPath(v ...string) func(*AsyncSearchDeleteRe } // WithHeader adds the headers to the HTTP request. +// func (f AsyncSearchDelete) WithHeader(h map[string]string) func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { if r.Header == nil { @@ -181,6 +190,7 @@ func (f AsyncSearchDelete) WithHeader(h map[string]string) func(*AsyncSearchDele } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AsyncSearchDelete) WithOpaqueID(s string) func(*AsyncSearchDeleteRequest) { return func(r *AsyncSearchDeleteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.get.go index bf4ea6ecadd..fff8a277243 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newAsyncSearchGetFunc(t Transport) AsyncSearchGet { // AsyncSearchGet - Retrieves the results of a previously submitted async search request given its ID. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// type AsyncSearchGet func(id string, o ...func(*AsyncSearchGetRequest)) (*Response, error) // AsyncSearchGetRequest configures the Async Search Get API request. +// type AsyncSearchGetRequest struct { DocumentID string @@ -63,6 +65,7 @@ type AsyncSearchGetRequest struct { } // Do executes the request and returns response or error. +// func (r AsyncSearchGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r AsyncSearchGetRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f AsyncSearchGet) WithContext(v context.Context) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f AsyncSearchGet) WithContext(v context.Context) func(*AsyncSearchGetReque } // WithKeepAlive - specify the time interval in which the results (partial or final) for this search will be available. +// func (f AsyncSearchGet) WithKeepAlive(v time.Duration) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.KeepAlive = v @@ -166,6 +171,7 @@ func (f AsyncSearchGet) WithKeepAlive(v time.Duration) func(*AsyncSearchGetReque } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f AsyncSearchGet) WithTypedKeys(v bool) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.TypedKeys = &v @@ -173,6 +179,7 @@ func (f AsyncSearchGet) WithTypedKeys(v bool) func(*AsyncSearchGetRequest) { } // WithWaitForCompletionTimeout - specify the time that the request should block waiting for the final response. +// func (f AsyncSearchGet) WithWaitForCompletionTimeout(v time.Duration) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.WaitForCompletionTimeout = v @@ -180,6 +187,7 @@ func (f AsyncSearchGet) WithWaitForCompletionTimeout(v time.Duration) func(*Asyn } // WithPretty makes the response body pretty-printed. +// func (f AsyncSearchGet) WithPretty() func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f AsyncSearchGet) WithPretty() func(*AsyncSearchGetRequest) { } // WithHuman makes statistical values human-readable. +// func (f AsyncSearchGet) WithHuman() func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f AsyncSearchGet) WithHuman() func(*AsyncSearchGetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AsyncSearchGet) WithErrorTrace() func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f AsyncSearchGet) WithErrorTrace() func(*AsyncSearchGetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f AsyncSearchGet) WithFilterPath(v ...string) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f AsyncSearchGet) WithFilterPath(v ...string) func(*AsyncSearchGetRequest) } // WithHeader adds the headers to the HTTP request. +// func (f AsyncSearchGet) WithHeader(h map[string]string) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f AsyncSearchGet) WithHeader(h map[string]string) func(*AsyncSearchGetRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AsyncSearchGet) WithOpaqueID(s string) func(*AsyncSearchGetRequest) { return func(r *AsyncSearchGetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.status.go index 5409a305ae2..b8f654ba152 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newAsyncSearchStatusFunc(t Transport) AsyncSearchStatus { // AsyncSearchStatus - Retrieves the status of a previously submitted async search request given its ID. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// type AsyncSearchStatus func(id string, o ...func(*AsyncSearchStatusRequest)) (*Response, error) // AsyncSearchStatusRequest configures the Async Search Status API request. +// type AsyncSearchStatusRequest struct { DocumentID string @@ -57,6 +59,7 @@ type AsyncSearchStatusRequest struct { } // Do executes the request and returns response or error. +// func (r AsyncSearchStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r AsyncSearchStatusRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f AsyncSearchStatus) WithContext(v context.Context) func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f AsyncSearchStatus) WithContext(v context.Context) func(*AsyncSearchStatu } // WithPretty makes the response body pretty-printed. +// func (f AsyncSearchStatus) WithPretty() func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f AsyncSearchStatus) WithPretty() func(*AsyncSearchStatusRequest) { } // WithHuman makes statistical values human-readable. +// func (f AsyncSearchStatus) WithHuman() func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f AsyncSearchStatus) WithHuman() func(*AsyncSearchStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AsyncSearchStatus) WithErrorTrace() func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f AsyncSearchStatus) WithErrorTrace() func(*AsyncSearchStatusRequest) { } // WithFilterPath filters the properties of the response body. +// func (f AsyncSearchStatus) WithFilterPath(v ...string) func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f AsyncSearchStatus) WithFilterPath(v ...string) func(*AsyncSearchStatusRe } // WithHeader adds the headers to the HTTP request. +// func (f AsyncSearchStatus) WithHeader(h map[string]string) func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f AsyncSearchStatus) WithHeader(h map[string]string) func(*AsyncSearchStat } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AsyncSearchStatus) WithOpaqueID(s string) func(*AsyncSearchStatusRequest) { return func(r *AsyncSearchStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.submit.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.submit.go index fb3096a28e2..f15d2b6662f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.submit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.async_search.submit.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newAsyncSearchSubmitFunc(t Transport) AsyncSearchSubmit { // AsyncSearchSubmit - Executes a search request asynchronously. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// type AsyncSearchSubmit func(o ...func(*AsyncSearchSubmitRequest)) (*Response, error) // AsyncSearchSubmitRequest configures the Async Search Submit API request. +// type AsyncSearchSubmitRequest struct { Index []string @@ -104,6 +106,7 @@ type AsyncSearchSubmitRequest struct { } // Do executes the request and returns response or error. +// func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -316,6 +319,10 @@ func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) ( 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 @@ -328,10 +335,6 @@ func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) ( } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -351,6 +354,7 @@ func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f AsyncSearchSubmit) WithContext(v context.Context) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.ctx = v @@ -358,6 +362,7 @@ func (f AsyncSearchSubmit) WithContext(v context.Context) func(*AsyncSearchSubmi } // WithBody - The search definition using the Query DSL. +// func (f AsyncSearchSubmit) WithBody(v io.Reader) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Body = v @@ -365,6 +370,7 @@ func (f AsyncSearchSubmit) WithBody(v io.Reader) func(*AsyncSearchSubmitRequest) } // WithIndex - a list of index names to search; use _all to perform the operation on all indices. +// func (f AsyncSearchSubmit) WithIndex(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Index = v @@ -372,6 +378,7 @@ func (f AsyncSearchSubmit) WithIndex(v ...string) func(*AsyncSearchSubmitRequest } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f AsyncSearchSubmit) WithAllowNoIndices(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.AllowNoIndices = &v @@ -379,6 +386,7 @@ func (f AsyncSearchSubmit) WithAllowNoIndices(v bool) func(*AsyncSearchSubmitReq } // WithAllowPartialSearchResults - indicate if an error should be returned if there is a partial search failure or timeout. +// func (f AsyncSearchSubmit) WithAllowPartialSearchResults(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.AllowPartialSearchResults = &v @@ -386,6 +394,7 @@ func (f AsyncSearchSubmit) WithAllowPartialSearchResults(v bool) func(*AsyncSear } // WithAnalyzer - the analyzer to use for the query string. +// func (f AsyncSearchSubmit) WithAnalyzer(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Analyzer = v @@ -393,6 +402,7 @@ func (f AsyncSearchSubmit) WithAnalyzer(v string) func(*AsyncSearchSubmitRequest } // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). +// func (f AsyncSearchSubmit) WithAnalyzeWildcard(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.AnalyzeWildcard = &v @@ -400,6 +410,7 @@ func (f AsyncSearchSubmit) WithAnalyzeWildcard(v bool) func(*AsyncSearchSubmitRe } // WithBatchedReduceSize - the number of shard results that should be reduced at once on the coordinating node. this value should be used as the granularity at which progress results will be made available.. +// func (f AsyncSearchSubmit) WithBatchedReduceSize(v int) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.BatchedReduceSize = &v @@ -407,6 +418,7 @@ func (f AsyncSearchSubmit) WithBatchedReduceSize(v int) func(*AsyncSearchSubmitR } // WithDefaultOperator - the default operator for query string query (and or or). +// func (f AsyncSearchSubmit) WithDefaultOperator(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.DefaultOperator = v @@ -414,6 +426,7 @@ func (f AsyncSearchSubmit) WithDefaultOperator(v string) func(*AsyncSearchSubmit } // WithDf - the field to use as default where no field prefix is given in the query string. +// func (f AsyncSearchSubmit) WithDf(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Df = v @@ -421,6 +434,7 @@ func (f AsyncSearchSubmit) WithDf(v string) func(*AsyncSearchSubmitRequest) { } // WithDocvalueFields - a list of fields to return as the docvalue representation of a field for each hit. +// func (f AsyncSearchSubmit) WithDocvalueFields(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.DocvalueFields = v @@ -428,6 +442,7 @@ func (f AsyncSearchSubmit) WithDocvalueFields(v ...string) func(*AsyncSearchSubm } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f AsyncSearchSubmit) WithExpandWildcards(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.ExpandWildcards = v @@ -435,6 +450,7 @@ func (f AsyncSearchSubmit) WithExpandWildcards(v string) func(*AsyncSearchSubmit } // WithExplain - specify whether to return detailed information about score computation as part of a hit. +// func (f AsyncSearchSubmit) WithExplain(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Explain = &v @@ -442,6 +458,7 @@ func (f AsyncSearchSubmit) WithExplain(v bool) func(*AsyncSearchSubmitRequest) { } // WithFrom - starting offset (default: 0). +// func (f AsyncSearchSubmit) WithFrom(v int) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.From = &v @@ -449,6 +466,7 @@ func (f AsyncSearchSubmit) WithFrom(v int) func(*AsyncSearchSubmitRequest) { } // WithIgnoreThrottled - whether specified concrete, expanded or aliased indices should be ignored when throttled. +// func (f AsyncSearchSubmit) WithIgnoreThrottled(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.IgnoreThrottled = &v @@ -456,6 +474,7 @@ func (f AsyncSearchSubmit) WithIgnoreThrottled(v bool) func(*AsyncSearchSubmitRe } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f AsyncSearchSubmit) WithIgnoreUnavailable(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.IgnoreUnavailable = &v @@ -463,6 +482,7 @@ func (f AsyncSearchSubmit) WithIgnoreUnavailable(v bool) func(*AsyncSearchSubmit } // WithKeepAlive - update the time interval in which the results (partial or final) for this search will be available. +// func (f AsyncSearchSubmit) WithKeepAlive(v time.Duration) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.KeepAlive = v @@ -470,6 +490,7 @@ func (f AsyncSearchSubmit) WithKeepAlive(v time.Duration) func(*AsyncSearchSubmi } // WithKeepOnCompletion - control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false). +// func (f AsyncSearchSubmit) WithKeepOnCompletion(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.KeepOnCompletion = &v @@ -477,6 +498,7 @@ func (f AsyncSearchSubmit) WithKeepOnCompletion(v bool) func(*AsyncSearchSubmitR } // WithLenient - specify whether format-based query failures (such as providing text to a numeric field) should be ignored. +// func (f AsyncSearchSubmit) WithLenient(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Lenient = &v @@ -484,6 +506,7 @@ func (f AsyncSearchSubmit) WithLenient(v bool) func(*AsyncSearchSubmitRequest) { } // WithMaxConcurrentShardRequests - the number of concurrent shard requests per node this search executes concurrently. this value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. +// func (f AsyncSearchSubmit) WithMaxConcurrentShardRequests(v int) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.MaxConcurrentShardRequests = &v @@ -491,6 +514,7 @@ func (f AsyncSearchSubmit) WithMaxConcurrentShardRequests(v int) func(*AsyncSear } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f AsyncSearchSubmit) WithPreference(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Preference = v @@ -498,6 +522,7 @@ func (f AsyncSearchSubmit) WithPreference(v string) func(*AsyncSearchSubmitReque } // WithQuery - query in the lucene query string syntax. +// func (f AsyncSearchSubmit) WithQuery(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Query = v @@ -505,6 +530,7 @@ func (f AsyncSearchSubmit) WithQuery(v string) func(*AsyncSearchSubmitRequest) { } // WithRequestCache - specify if request cache should be used for this request or not, defaults to true. +// func (f AsyncSearchSubmit) WithRequestCache(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.RequestCache = &v @@ -512,6 +538,7 @@ func (f AsyncSearchSubmit) WithRequestCache(v bool) func(*AsyncSearchSubmitReque } // WithRouting - a list of specific routing values. +// func (f AsyncSearchSubmit) WithRouting(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Routing = v @@ -519,6 +546,7 @@ func (f AsyncSearchSubmit) WithRouting(v ...string) func(*AsyncSearchSubmitReque } // WithSearchType - search operation type. +// func (f AsyncSearchSubmit) WithSearchType(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SearchType = v @@ -526,6 +554,7 @@ func (f AsyncSearchSubmit) WithSearchType(v string) func(*AsyncSearchSubmitReque } // WithSeqNoPrimaryTerm - specify whether to return sequence number and primary term of the last modification of each hit. +// func (f AsyncSearchSubmit) WithSeqNoPrimaryTerm(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SeqNoPrimaryTerm = &v @@ -533,6 +562,7 @@ func (f AsyncSearchSubmit) WithSeqNoPrimaryTerm(v bool) func(*AsyncSearchSubmitR } // WithSize - number of hits to return (default: 10). +// func (f AsyncSearchSubmit) WithSize(v int) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Size = &v @@ -540,6 +570,7 @@ func (f AsyncSearchSubmit) WithSize(v int) func(*AsyncSearchSubmitRequest) { } // WithSort - a list of : pairs. +// func (f AsyncSearchSubmit) WithSort(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Sort = v @@ -547,6 +578,7 @@ func (f AsyncSearchSubmit) WithSort(v ...string) func(*AsyncSearchSubmitRequest) } // WithSource - true or false to return the _source field or not, or a list of fields to return. +// func (f AsyncSearchSubmit) WithSource(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Source = v @@ -554,6 +586,7 @@ func (f AsyncSearchSubmit) WithSource(v ...string) func(*AsyncSearchSubmitReques } // WithSourceExcludes - a list of fields to exclude from the returned _source field. +// func (f AsyncSearchSubmit) WithSourceExcludes(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SourceExcludes = v @@ -561,6 +594,7 @@ func (f AsyncSearchSubmit) WithSourceExcludes(v ...string) func(*AsyncSearchSubm } // WithSourceIncludes - a list of fields to extract and return from the _source field. +// func (f AsyncSearchSubmit) WithSourceIncludes(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SourceIncludes = v @@ -568,6 +602,7 @@ func (f AsyncSearchSubmit) WithSourceIncludes(v ...string) func(*AsyncSearchSubm } // WithStats - specific 'tag' of the request for logging and statistical purposes. +// func (f AsyncSearchSubmit) WithStats(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Stats = v @@ -575,6 +610,7 @@ func (f AsyncSearchSubmit) WithStats(v ...string) func(*AsyncSearchSubmitRequest } // WithStoredFields - a list of stored fields to return as part of a hit. +// func (f AsyncSearchSubmit) WithStoredFields(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.StoredFields = v @@ -582,6 +618,7 @@ func (f AsyncSearchSubmit) WithStoredFields(v ...string) func(*AsyncSearchSubmit } // WithSuggestField - specify which field to use for suggestions. +// func (f AsyncSearchSubmit) WithSuggestField(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SuggestField = v @@ -589,6 +626,7 @@ func (f AsyncSearchSubmit) WithSuggestField(v string) func(*AsyncSearchSubmitReq } // WithSuggestMode - specify suggest mode. +// func (f AsyncSearchSubmit) WithSuggestMode(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SuggestMode = v @@ -596,6 +634,7 @@ func (f AsyncSearchSubmit) WithSuggestMode(v string) func(*AsyncSearchSubmitRequ } // WithSuggestSize - how many suggestions to return in response. +// func (f AsyncSearchSubmit) WithSuggestSize(v int) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SuggestSize = &v @@ -603,6 +642,7 @@ func (f AsyncSearchSubmit) WithSuggestSize(v int) func(*AsyncSearchSubmitRequest } // WithSuggestText - the source text for which the suggestions should be returned. +// func (f AsyncSearchSubmit) WithSuggestText(v string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.SuggestText = v @@ -610,6 +650,7 @@ func (f AsyncSearchSubmit) WithSuggestText(v string) func(*AsyncSearchSubmitRequ } // WithTerminateAfter - the maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.. +// func (f AsyncSearchSubmit) WithTerminateAfter(v int) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.TerminateAfter = &v @@ -617,6 +658,7 @@ func (f AsyncSearchSubmit) WithTerminateAfter(v int) func(*AsyncSearchSubmitRequ } // WithTimeout - explicit operation timeout. +// func (f AsyncSearchSubmit) WithTimeout(v time.Duration) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Timeout = v @@ -624,6 +666,7 @@ func (f AsyncSearchSubmit) WithTimeout(v time.Duration) func(*AsyncSearchSubmitR } // WithTrackScores - whether to calculate and return scores even if they are not used for sorting. +// func (f AsyncSearchSubmit) WithTrackScores(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.TrackScores = &v @@ -631,6 +674,7 @@ func (f AsyncSearchSubmit) WithTrackScores(v bool) func(*AsyncSearchSubmitReques } // WithTrackTotalHits - indicate if the number of documents that match the query should be tracked. +// func (f AsyncSearchSubmit) WithTrackTotalHits(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.TrackTotalHits = &v @@ -638,6 +682,7 @@ func (f AsyncSearchSubmit) WithTrackTotalHits(v bool) func(*AsyncSearchSubmitReq } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f AsyncSearchSubmit) WithTypedKeys(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.TypedKeys = &v @@ -645,6 +690,7 @@ func (f AsyncSearchSubmit) WithTypedKeys(v bool) func(*AsyncSearchSubmitRequest) } // WithVersion - specify whether to return document version as part of a hit. +// func (f AsyncSearchSubmit) WithVersion(v bool) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Version = &v @@ -652,6 +698,7 @@ func (f AsyncSearchSubmit) WithVersion(v bool) func(*AsyncSearchSubmitRequest) { } // WithWaitForCompletionTimeout - specify the time that the request should block waiting for the final response. +// func (f AsyncSearchSubmit) WithWaitForCompletionTimeout(v time.Duration) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.WaitForCompletionTimeout = v @@ -659,6 +706,7 @@ func (f AsyncSearchSubmit) WithWaitForCompletionTimeout(v time.Duration) func(*A } // WithPretty makes the response body pretty-printed. +// func (f AsyncSearchSubmit) WithPretty() func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Pretty = true @@ -666,6 +714,7 @@ func (f AsyncSearchSubmit) WithPretty() func(*AsyncSearchSubmitRequest) { } // WithHuman makes statistical values human-readable. +// func (f AsyncSearchSubmit) WithHuman() func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.Human = true @@ -673,6 +722,7 @@ func (f AsyncSearchSubmit) WithHuman() func(*AsyncSearchSubmitRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AsyncSearchSubmit) WithErrorTrace() func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.ErrorTrace = true @@ -680,6 +730,7 @@ func (f AsyncSearchSubmit) WithErrorTrace() func(*AsyncSearchSubmitRequest) { } // WithFilterPath filters the properties of the response body. +// func (f AsyncSearchSubmit) WithFilterPath(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.FilterPath = v @@ -687,6 +738,7 @@ func (f AsyncSearchSubmit) WithFilterPath(v ...string) func(*AsyncSearchSubmitRe } // WithHeader adds the headers to the HTTP request. +// func (f AsyncSearchSubmit) WithHeader(h map[string]string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { if r.Header == nil { @@ -699,6 +751,7 @@ func (f AsyncSearchSubmit) WithHeader(h map[string]string) func(*AsyncSearchSubm } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AsyncSearchSubmit) WithOpaqueID(s string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go index 96e1ff6e19f..a368b69f3dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newAutoscalingDeleteAutoscalingPolicyFunc(t Transport) AutoscalingDeleteAut // AutoscalingDeleteAutoscalingPolicy - Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html. +// type AutoscalingDeleteAutoscalingPolicy func(name string, o ...func(*AutoscalingDeleteAutoscalingPolicyRequest)) (*Response, error) // AutoscalingDeleteAutoscalingPolicyRequest configures the Autoscaling Delete Autoscaling Policy API request. +// type AutoscalingDeleteAutoscalingPolicyRequest struct { Name string @@ -57,6 +59,7 @@ type AutoscalingDeleteAutoscalingPolicyRequest struct { } // Do executes the request and returns response or error. +// func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(ctx context.Context, trans } // WithContext sets the request context. +// func (f AutoscalingDeleteAutoscalingPolicy) WithContext(v context.Context) func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f AutoscalingDeleteAutoscalingPolicy) WithContext(v context.Context) func( } // WithPretty makes the response body pretty-printed. +// func (f AutoscalingDeleteAutoscalingPolicy) WithPretty() func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f AutoscalingDeleteAutoscalingPolicy) WithPretty() func(*AutoscalingDelete } // WithHuman makes statistical values human-readable. +// func (f AutoscalingDeleteAutoscalingPolicy) WithHuman() func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f AutoscalingDeleteAutoscalingPolicy) WithHuman() func(*AutoscalingDeleteA } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AutoscalingDeleteAutoscalingPolicy) WithErrorTrace() func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f AutoscalingDeleteAutoscalingPolicy) WithErrorTrace() func(*AutoscalingDe } // WithFilterPath filters the properties of the response body. +// func (f AutoscalingDeleteAutoscalingPolicy) WithFilterPath(v ...string) func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f AutoscalingDeleteAutoscalingPolicy) WithFilterPath(v ...string) func(*Au } // WithHeader adds the headers to the HTTP request. +// func (f AutoscalingDeleteAutoscalingPolicy) WithHeader(h map[string]string) func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f AutoscalingDeleteAutoscalingPolicy) WithHeader(h map[string]string) func } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AutoscalingDeleteAutoscalingPolicy) WithOpaqueID(s string) func(*AutoscalingDeleteAutoscalingPolicyRequest) { return func(r *AutoscalingDeleteAutoscalingPolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go index 94f7178c8ec..4d79f5dbb34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newAutoscalingGetAutoscalingCapacityFunc(t Transport) AutoscalingGetAutosca // AutoscalingGetAutoscalingCapacity - Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html. +// type AutoscalingGetAutoscalingCapacity func(o ...func(*AutoscalingGetAutoscalingCapacityRequest)) (*Response, error) // AutoscalingGetAutoscalingCapacityRequest configures the Autoscaling Get Autoscaling Capacity API request. +// type AutoscalingGetAutoscalingCapacityRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type AutoscalingGetAutoscalingCapacityRequest struct { } // Do executes the request and returns response or error. +// func (r AutoscalingGetAutoscalingCapacityRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r AutoscalingGetAutoscalingCapacityRequest) Do(ctx context.Context, transp } // WithContext sets the request context. +// func (f AutoscalingGetAutoscalingCapacity) WithContext(v context.Context) func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f AutoscalingGetAutoscalingCapacity) WithContext(v context.Context) func(* } // WithPretty makes the response body pretty-printed. +// func (f AutoscalingGetAutoscalingCapacity) WithPretty() func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f AutoscalingGetAutoscalingCapacity) WithPretty() func(*AutoscalingGetAuto } // WithHuman makes statistical values human-readable. +// func (f AutoscalingGetAutoscalingCapacity) WithHuman() func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f AutoscalingGetAutoscalingCapacity) WithHuman() func(*AutoscalingGetAutos } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AutoscalingGetAutoscalingCapacity) WithErrorTrace() func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f AutoscalingGetAutoscalingCapacity) WithErrorTrace() func(*AutoscalingGet } // WithFilterPath filters the properties of the response body. +// func (f AutoscalingGetAutoscalingCapacity) WithFilterPath(v ...string) func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f AutoscalingGetAutoscalingCapacity) WithFilterPath(v ...string) func(*Aut } // WithHeader adds the headers to the HTTP request. +// func (f AutoscalingGetAutoscalingCapacity) WithHeader(h map[string]string) func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f AutoscalingGetAutoscalingCapacity) WithHeader(h map[string]string) func( } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AutoscalingGetAutoscalingCapacity) WithOpaqueID(s string) func(*AutoscalingGetAutoscalingCapacityRequest) { return func(r *AutoscalingGetAutoscalingCapacityRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_policy.go index 3df64c3c262..f53b2eb6ebc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.get_autoscaling_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newAutoscalingGetAutoscalingPolicyFunc(t Transport) AutoscalingGetAutoscali // AutoscalingGetAutoscalingPolicy - Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html. +// type AutoscalingGetAutoscalingPolicy func(name string, o ...func(*AutoscalingGetAutoscalingPolicyRequest)) (*Response, error) // AutoscalingGetAutoscalingPolicyRequest configures the Autoscaling Get Autoscaling Policy API request. +// type AutoscalingGetAutoscalingPolicyRequest struct { Name string @@ -57,6 +59,7 @@ type AutoscalingGetAutoscalingPolicyRequest struct { } // Do executes the request and returns response or error. +// func (r AutoscalingGetAutoscalingPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r AutoscalingGetAutoscalingPolicyRequest) Do(ctx context.Context, transpor } // WithContext sets the request context. +// func (f AutoscalingGetAutoscalingPolicy) WithContext(v context.Context) func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f AutoscalingGetAutoscalingPolicy) WithContext(v context.Context) func(*Au } // WithPretty makes the response body pretty-printed. +// func (f AutoscalingGetAutoscalingPolicy) WithPretty() func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f AutoscalingGetAutoscalingPolicy) WithPretty() func(*AutoscalingGetAutosc } // WithHuman makes statistical values human-readable. +// func (f AutoscalingGetAutoscalingPolicy) WithHuman() func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f AutoscalingGetAutoscalingPolicy) WithHuman() func(*AutoscalingGetAutosca } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AutoscalingGetAutoscalingPolicy) WithErrorTrace() func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f AutoscalingGetAutoscalingPolicy) WithErrorTrace() func(*AutoscalingGetAu } // WithFilterPath filters the properties of the response body. +// func (f AutoscalingGetAutoscalingPolicy) WithFilterPath(v ...string) func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f AutoscalingGetAutoscalingPolicy) WithFilterPath(v ...string) func(*Autos } // WithHeader adds the headers to the HTTP request. +// func (f AutoscalingGetAutoscalingPolicy) WithHeader(h map[string]string) func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f AutoscalingGetAutoscalingPolicy) WithHeader(h map[string]string) func(*A } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AutoscalingGetAutoscalingPolicy) WithOpaqueID(s string) func(*AutoscalingGetAutoscalingPolicyRequest) { return func(r *AutoscalingGetAutoscalingPolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.put_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.put_autoscaling_policy.go index e62a2f039f5..a64745a1e01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.put_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.autoscaling.put_autoscaling_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newAutoscalingPutAutoscalingPolicyFunc(t Transport) AutoscalingPutAutoscali // AutoscalingPutAutoscalingPolicy - Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html. +// type AutoscalingPutAutoscalingPolicy func(name string, body io.Reader, o ...func(*AutoscalingPutAutoscalingPolicyRequest)) (*Response, error) // AutoscalingPutAutoscalingPolicyRequest configures the Autoscaling Put Autoscaling Policy API request. +// type AutoscalingPutAutoscalingPolicyRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type AutoscalingPutAutoscalingPolicyRequest struct { } // Do executes the request and returns response or error. +// func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transpor 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 @@ -120,10 +127,6 @@ func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transpor } // WithContext sets the request context. +// func (f AutoscalingPutAutoscalingPolicy) WithContext(v context.Context) func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f AutoscalingPutAutoscalingPolicy) WithContext(v context.Context) func(*Au } // WithPretty makes the response body pretty-printed. +// func (f AutoscalingPutAutoscalingPolicy) WithPretty() func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f AutoscalingPutAutoscalingPolicy) WithPretty() func(*AutoscalingPutAutosc } // WithHuman makes statistical values human-readable. +// func (f AutoscalingPutAutoscalingPolicy) WithHuman() func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f AutoscalingPutAutoscalingPolicy) WithHuman() func(*AutoscalingPutAutosca } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f AutoscalingPutAutoscalingPolicy) WithErrorTrace() func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f AutoscalingPutAutoscalingPolicy) WithErrorTrace() func(*AutoscalingPutAu } // WithFilterPath filters the properties of the response body. +// func (f AutoscalingPutAutoscalingPolicy) WithFilterPath(v ...string) func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f AutoscalingPutAutoscalingPolicy) WithFilterPath(v ...string) func(*Autos } // WithHeader adds the headers to the HTTP request. +// func (f AutoscalingPutAutoscalingPolicy) WithHeader(h map[string]string) func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f AutoscalingPutAutoscalingPolicy) WithHeader(h map[string]string) func(*A } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f AutoscalingPutAutoscalingPolicy) WithOpaqueID(s string) func(*AutoscalingPutAutoscalingPolicyRequest) { return func(r *AutoscalingPutAutoscalingPolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_data_frame_analytics.go index e1567d4a0ab..b717f6630cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatMLDataFrameAnalyticsFunc(t Transport) CatMLDataFrameAnalytics { // CatMLDataFrameAnalytics - Gets configuration and usage information about data frame analytics jobs. // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html. +// type CatMLDataFrameAnalytics func(o ...func(*CatMLDataFrameAnalyticsRequest)) (*Response, error) // CatMLDataFrameAnalyticsRequest configures the CatML Data Frame Analytics API request. +// type CatMLDataFrameAnalyticsRequest struct { DocumentID string @@ -67,6 +69,7 @@ type CatMLDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r CatMLDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -184,6 +187,7 @@ func (r CatMLDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f CatMLDataFrameAnalytics) WithContext(v context.Context) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.ctx = v @@ -191,6 +195,7 @@ func (f CatMLDataFrameAnalytics) WithContext(v context.Context) func(*CatMLDataF } // WithDocumentID - the ID of the data frame analytics to fetch. +// func (f CatMLDataFrameAnalytics) WithDocumentID(v string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.DocumentID = v @@ -198,6 +203,7 @@ func (f CatMLDataFrameAnalytics) WithDocumentID(v string) func(*CatMLDataFrameAn } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no configs. (this includes `_all` string or when no configs have been specified). +// func (f CatMLDataFrameAnalytics) WithAllowNoMatch(v bool) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.AllowNoMatch = &v @@ -205,6 +211,7 @@ func (f CatMLDataFrameAnalytics) WithAllowNoMatch(v bool) func(*CatMLDataFrameAn } // WithBytes - the unit in which to display byte values. +// func (f CatMLDataFrameAnalytics) WithBytes(v string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.Bytes = v @@ -212,6 +219,7 @@ func (f CatMLDataFrameAnalytics) WithBytes(v string) func(*CatMLDataFrameAnalyti } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatMLDataFrameAnalytics) WithFormat(v string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.Format = v @@ -219,6 +227,7 @@ func (f CatMLDataFrameAnalytics) WithFormat(v string) func(*CatMLDataFrameAnalyt } // WithH - comma-separated list of column names to display. +// func (f CatMLDataFrameAnalytics) WithH(v ...string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.H = v @@ -226,6 +235,7 @@ func (f CatMLDataFrameAnalytics) WithH(v ...string) func(*CatMLDataFrameAnalytic } // WithHelp - return help information. +// func (f CatMLDataFrameAnalytics) WithHelp(v bool) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.Help = &v @@ -233,6 +243,7 @@ func (f CatMLDataFrameAnalytics) WithHelp(v bool) func(*CatMLDataFrameAnalyticsR } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatMLDataFrameAnalytics) WithS(v ...string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.S = v @@ -240,6 +251,7 @@ func (f CatMLDataFrameAnalytics) WithS(v ...string) func(*CatMLDataFrameAnalytic } // WithTime - the unit in which to display time values. +// func (f CatMLDataFrameAnalytics) WithTime(v string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.Time = v @@ -247,6 +259,7 @@ func (f CatMLDataFrameAnalytics) WithTime(v string) func(*CatMLDataFrameAnalytic } // WithV - verbose mode. display column headers. +// func (f CatMLDataFrameAnalytics) WithV(v bool) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.V = &v @@ -254,6 +267,7 @@ func (f CatMLDataFrameAnalytics) WithV(v bool) func(*CatMLDataFrameAnalyticsRequ } // WithPretty makes the response body pretty-printed. +// func (f CatMLDataFrameAnalytics) WithPretty() func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.Pretty = true @@ -261,6 +275,7 @@ func (f CatMLDataFrameAnalytics) WithPretty() func(*CatMLDataFrameAnalyticsReque } // WithHuman makes statistical values human-readable. +// func (f CatMLDataFrameAnalytics) WithHuman() func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.Human = true @@ -268,6 +283,7 @@ func (f CatMLDataFrameAnalytics) WithHuman() func(*CatMLDataFrameAnalyticsReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatMLDataFrameAnalytics) WithErrorTrace() func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -275,6 +291,7 @@ func (f CatMLDataFrameAnalytics) WithErrorTrace() func(*CatMLDataFrameAnalyticsR } // WithFilterPath filters the properties of the response body. +// func (f CatMLDataFrameAnalytics) WithFilterPath(v ...string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { r.FilterPath = v @@ -282,6 +299,7 @@ func (f CatMLDataFrameAnalytics) WithFilterPath(v ...string) func(*CatMLDataFram } // WithHeader adds the headers to the HTTP request. +// func (f CatMLDataFrameAnalytics) WithHeader(h map[string]string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { if r.Header == nil { @@ -294,6 +312,7 @@ func (f CatMLDataFrameAnalytics) WithHeader(h map[string]string) func(*CatMLData } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatMLDataFrameAnalytics) WithOpaqueID(s string) func(*CatMLDataFrameAnalyticsRequest) { return func(r *CatMLDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_datafeeds.go index f650b0b4690..5c36ad042d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_datafeeds.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatMLDatafeedsFunc(t Transport) CatMLDatafeeds { // CatMLDatafeeds - Gets configuration and usage information about datafeeds. // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html. +// type CatMLDatafeeds func(o ...func(*CatMLDatafeedsRequest)) (*Response, error) // CatMLDatafeedsRequest configures the CatML Datafeeds API request. +// type CatMLDatafeedsRequest struct { DatafeedID string @@ -67,6 +69,7 @@ type CatMLDatafeedsRequest struct { } // Do executes the request and returns response or error. +// func (r CatMLDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -182,6 +185,7 @@ func (r CatMLDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f CatMLDatafeeds) WithContext(v context.Context) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.ctx = v @@ -189,6 +193,7 @@ func (f CatMLDatafeeds) WithContext(v context.Context) func(*CatMLDatafeedsReque } // WithDatafeedID - the ID of the datafeeds stats to fetch. +// func (f CatMLDatafeeds) WithDatafeedID(v string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.DatafeedID = v @@ -196,6 +201,7 @@ func (f CatMLDatafeeds) WithDatafeedID(v string) func(*CatMLDatafeedsRequest) { } // WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f CatMLDatafeeds) WithAllowNoDatafeeds(v bool) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.AllowNoDatafeeds = &v @@ -203,6 +209,7 @@ func (f CatMLDatafeeds) WithAllowNoDatafeeds(v bool) func(*CatMLDatafeedsRequest } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f CatMLDatafeeds) WithAllowNoMatch(v bool) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.AllowNoMatch = &v @@ -210,6 +217,7 @@ func (f CatMLDatafeeds) WithAllowNoMatch(v bool) func(*CatMLDatafeedsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatMLDatafeeds) WithFormat(v string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.Format = v @@ -217,6 +225,7 @@ func (f CatMLDatafeeds) WithFormat(v string) func(*CatMLDatafeedsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatMLDatafeeds) WithH(v ...string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.H = v @@ -224,6 +233,7 @@ func (f CatMLDatafeeds) WithH(v ...string) func(*CatMLDatafeedsRequest) { } // WithHelp - return help information. +// func (f CatMLDatafeeds) WithHelp(v bool) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.Help = &v @@ -231,6 +241,7 @@ func (f CatMLDatafeeds) WithHelp(v bool) func(*CatMLDatafeedsRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatMLDatafeeds) WithS(v ...string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.S = v @@ -238,6 +249,7 @@ func (f CatMLDatafeeds) WithS(v ...string) func(*CatMLDatafeedsRequest) { } // WithTime - the unit in which to display time values. +// func (f CatMLDatafeeds) WithTime(v string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.Time = v @@ -245,6 +257,7 @@ func (f CatMLDatafeeds) WithTime(v string) func(*CatMLDatafeedsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatMLDatafeeds) WithV(v bool) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.V = &v @@ -252,6 +265,7 @@ func (f CatMLDatafeeds) WithV(v bool) func(*CatMLDatafeedsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatMLDatafeeds) WithPretty() func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.Pretty = true @@ -259,6 +273,7 @@ func (f CatMLDatafeeds) WithPretty() func(*CatMLDatafeedsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatMLDatafeeds) WithHuman() func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.Human = true @@ -266,6 +281,7 @@ func (f CatMLDatafeeds) WithHuman() func(*CatMLDatafeedsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatMLDatafeeds) WithErrorTrace() func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.ErrorTrace = true @@ -273,6 +289,7 @@ func (f CatMLDatafeeds) WithErrorTrace() func(*CatMLDatafeedsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatMLDatafeeds) WithFilterPath(v ...string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { r.FilterPath = v @@ -280,6 +297,7 @@ func (f CatMLDatafeeds) WithFilterPath(v ...string) func(*CatMLDatafeedsRequest) } // WithHeader adds the headers to the HTTP request. +// func (f CatMLDatafeeds) WithHeader(h map[string]string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { if r.Header == nil { @@ -292,6 +310,7 @@ func (f CatMLDatafeeds) WithHeader(h map[string]string) func(*CatMLDatafeedsRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatMLDatafeeds) WithOpaqueID(s string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_jobs.go index 4099d0700be..efb4ce87c08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_jobs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatMLJobsFunc(t Transport) CatMLJobs { // CatMLJobs - Gets configuration and usage information about anomaly detection jobs. // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html. +// type CatMLJobs func(o ...func(*CatMLJobsRequest)) (*Response, error) // CatMLJobsRequest configures the CatML Jobs API request. +// type CatMLJobsRequest struct { JobID string @@ -68,6 +70,7 @@ type CatMLJobsRequest struct { } // Do executes the request and returns response or error. +// func (r CatMLJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -187,6 +190,7 @@ func (r CatMLJobsRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f CatMLJobs) WithContext(v context.Context) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.ctx = v @@ -194,6 +198,7 @@ func (f CatMLJobs) WithContext(v context.Context) func(*CatMLJobsRequest) { } // WithJobID - the ID of the jobs stats to fetch. +// func (f CatMLJobs) WithJobID(v string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.JobID = v @@ -201,6 +206,7 @@ func (f CatMLJobs) WithJobID(v string) func(*CatMLJobsRequest) { } // WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f CatMLJobs) WithAllowNoJobs(v bool) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.AllowNoJobs = &v @@ -208,6 +214,7 @@ func (f CatMLJobs) WithAllowNoJobs(v bool) func(*CatMLJobsRequest) { } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f CatMLJobs) WithAllowNoMatch(v bool) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.AllowNoMatch = &v @@ -215,6 +222,7 @@ func (f CatMLJobs) WithAllowNoMatch(v bool) func(*CatMLJobsRequest) { } // WithBytes - the unit in which to display byte values. +// func (f CatMLJobs) WithBytes(v string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.Bytes = v @@ -222,6 +230,7 @@ func (f CatMLJobs) WithBytes(v string) func(*CatMLJobsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatMLJobs) WithFormat(v string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.Format = v @@ -229,6 +238,7 @@ func (f CatMLJobs) WithFormat(v string) func(*CatMLJobsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatMLJobs) WithH(v ...string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.H = v @@ -236,6 +246,7 @@ func (f CatMLJobs) WithH(v ...string) func(*CatMLJobsRequest) { } // WithHelp - return help information. +// func (f CatMLJobs) WithHelp(v bool) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.Help = &v @@ -243,6 +254,7 @@ func (f CatMLJobs) WithHelp(v bool) func(*CatMLJobsRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatMLJobs) WithS(v ...string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.S = v @@ -250,6 +262,7 @@ func (f CatMLJobs) WithS(v ...string) func(*CatMLJobsRequest) { } // WithTime - the unit in which to display time values. +// func (f CatMLJobs) WithTime(v string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.Time = v @@ -257,6 +270,7 @@ func (f CatMLJobs) WithTime(v string) func(*CatMLJobsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatMLJobs) WithV(v bool) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.V = &v @@ -264,6 +278,7 @@ func (f CatMLJobs) WithV(v bool) func(*CatMLJobsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatMLJobs) WithPretty() func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.Pretty = true @@ -271,6 +286,7 @@ func (f CatMLJobs) WithPretty() func(*CatMLJobsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatMLJobs) WithHuman() func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.Human = true @@ -278,6 +294,7 @@ func (f CatMLJobs) WithHuman() func(*CatMLJobsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatMLJobs) WithErrorTrace() func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.ErrorTrace = true @@ -285,6 +302,7 @@ func (f CatMLJobs) WithErrorTrace() func(*CatMLJobsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatMLJobs) WithFilterPath(v ...string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { r.FilterPath = v @@ -292,6 +310,7 @@ func (f CatMLJobs) WithFilterPath(v ...string) func(*CatMLJobsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatMLJobs) WithHeader(h map[string]string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { if r.Header == nil { @@ -304,6 +323,7 @@ func (f CatMLJobs) WithHeader(h map[string]string) func(*CatMLJobsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatMLJobs) WithOpaqueID(s string) func(*CatMLJobsRequest) { return func(r *CatMLJobsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_trained_models.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_trained_models.go index dc56acbfe57..62045649376 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_trained_models.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.ml_trained_models.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatMLTrainedModelsFunc(t Transport) CatMLTrainedModels { // CatMLTrainedModels - Gets configuration and usage information about inference trained models. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html. +// type CatMLTrainedModels func(o ...func(*CatMLTrainedModelsRequest)) (*Response, error) // CatMLTrainedModelsRequest configures the CatML Trained Models API request. +// type CatMLTrainedModelsRequest struct { ModelID string @@ -69,6 +71,7 @@ type CatMLTrainedModelsRequest struct { } // Do executes the request and returns response or error. +// func (r CatMLTrainedModelsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -192,6 +195,7 @@ func (r CatMLTrainedModelsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f CatMLTrainedModels) WithContext(v context.Context) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.ctx = v @@ -199,6 +203,7 @@ func (f CatMLTrainedModels) WithContext(v context.Context) func(*CatMLTrainedMod } // WithModelID - the ID of the trained models stats to fetch. +// func (f CatMLTrainedModels) WithModelID(v string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.ModelID = v @@ -206,6 +211,7 @@ func (f CatMLTrainedModels) WithModelID(v string) func(*CatMLTrainedModelsReques } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no trained models. (this includes `_all` string or when no trained models have been specified). +// func (f CatMLTrainedModels) WithAllowNoMatch(v bool) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.AllowNoMatch = &v @@ -213,6 +219,7 @@ func (f CatMLTrainedModels) WithAllowNoMatch(v bool) func(*CatMLTrainedModelsReq } // WithBytes - the unit in which to display byte values. +// func (f CatMLTrainedModels) WithBytes(v string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Bytes = v @@ -220,6 +227,7 @@ func (f CatMLTrainedModels) WithBytes(v string) func(*CatMLTrainedModelsRequest) } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatMLTrainedModels) WithFormat(v string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Format = v @@ -227,6 +235,7 @@ func (f CatMLTrainedModels) WithFormat(v string) func(*CatMLTrainedModelsRequest } // WithFrom - skips a number of trained models. +// func (f CatMLTrainedModels) WithFrom(v int) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.From = &v @@ -234,6 +243,7 @@ func (f CatMLTrainedModels) WithFrom(v int) func(*CatMLTrainedModelsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatMLTrainedModels) WithH(v ...string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.H = v @@ -241,6 +251,7 @@ func (f CatMLTrainedModels) WithH(v ...string) func(*CatMLTrainedModelsRequest) } // WithHelp - return help information. +// func (f CatMLTrainedModels) WithHelp(v bool) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Help = &v @@ -248,6 +259,7 @@ func (f CatMLTrainedModels) WithHelp(v bool) func(*CatMLTrainedModelsRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatMLTrainedModels) WithS(v ...string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.S = v @@ -255,6 +267,7 @@ func (f CatMLTrainedModels) WithS(v ...string) func(*CatMLTrainedModelsRequest) } // WithSize - specifies a max number of trained models to get. +// func (f CatMLTrainedModels) WithSize(v int) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Size = &v @@ -262,6 +275,7 @@ func (f CatMLTrainedModels) WithSize(v int) func(*CatMLTrainedModelsRequest) { } // WithTime - the unit in which to display time values. +// func (f CatMLTrainedModels) WithTime(v string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Time = v @@ -269,6 +283,7 @@ func (f CatMLTrainedModels) WithTime(v string) func(*CatMLTrainedModelsRequest) } // WithV - verbose mode. display column headers. +// func (f CatMLTrainedModels) WithV(v bool) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.V = &v @@ -276,6 +291,7 @@ func (f CatMLTrainedModels) WithV(v bool) func(*CatMLTrainedModelsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatMLTrainedModels) WithPretty() func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Pretty = true @@ -283,6 +299,7 @@ func (f CatMLTrainedModels) WithPretty() func(*CatMLTrainedModelsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatMLTrainedModels) WithHuman() func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.Human = true @@ -290,6 +307,7 @@ func (f CatMLTrainedModels) WithHuman() func(*CatMLTrainedModelsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatMLTrainedModels) WithErrorTrace() func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.ErrorTrace = true @@ -297,6 +315,7 @@ func (f CatMLTrainedModels) WithErrorTrace() func(*CatMLTrainedModelsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatMLTrainedModels) WithFilterPath(v ...string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { r.FilterPath = v @@ -304,6 +323,7 @@ func (f CatMLTrainedModels) WithFilterPath(v ...string) func(*CatMLTrainedModels } // WithHeader adds the headers to the HTTP request. +// func (f CatMLTrainedModels) WithHeader(h map[string]string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { if r.Header == nil { @@ -316,6 +336,7 @@ func (f CatMLTrainedModels) WithHeader(h map[string]string) func(*CatMLTrainedMo } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatMLTrainedModels) WithOpaqueID(s string) func(*CatMLTrainedModelsRequest) { return func(r *CatMLTrainedModelsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.transforms.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.transforms.go index c3816aceaac..63f3413fcfa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.transforms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.cat.transforms.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCatTransformsFunc(t Transport) CatTransforms { // CatTransforms - Gets configuration and usage information about transforms. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html. +// type CatTransforms func(o ...func(*CatTransformsRequest)) (*Response, error) // CatTransformsRequest configures the Cat Transforms API request. +// type CatTransformsRequest struct { TransformID string @@ -68,6 +70,7 @@ type CatTransformsRequest struct { } // Do executes the request and returns response or error. +// func (r CatTransformsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -185,6 +188,7 @@ func (r CatTransformsRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f CatTransforms) WithContext(v context.Context) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.ctx = v @@ -192,6 +196,7 @@ func (f CatTransforms) WithContext(v context.Context) func(*CatTransformsRequest } // WithTransformID - the ID of the transform for which to get stats. '_all' or '*' implies all transforms. +// func (f CatTransforms) WithTransformID(v string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.TransformID = v @@ -199,6 +204,7 @@ func (f CatTransforms) WithTransformID(v string) func(*CatTransformsRequest) { } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f CatTransforms) WithAllowNoMatch(v bool) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.AllowNoMatch = &v @@ -206,6 +212,7 @@ func (f CatTransforms) WithAllowNoMatch(v bool) func(*CatTransformsRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f CatTransforms) WithFormat(v string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.Format = v @@ -213,6 +220,7 @@ func (f CatTransforms) WithFormat(v string) func(*CatTransformsRequest) { } // WithFrom - skips a number of transform configs, defaults to 0. +// func (f CatTransforms) WithFrom(v int) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.From = &v @@ -220,6 +228,7 @@ func (f CatTransforms) WithFrom(v int) func(*CatTransformsRequest) { } // WithH - comma-separated list of column names to display. +// func (f CatTransforms) WithH(v ...string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.H = v @@ -227,6 +236,7 @@ func (f CatTransforms) WithH(v ...string) func(*CatTransformsRequest) { } // WithHelp - return help information. +// func (f CatTransforms) WithHelp(v bool) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.Help = &v @@ -234,6 +244,7 @@ func (f CatTransforms) WithHelp(v bool) func(*CatTransformsRequest) { } // WithS - comma-separated list of column names or column aliases to sort by. +// func (f CatTransforms) WithS(v ...string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.S = v @@ -241,6 +252,7 @@ func (f CatTransforms) WithS(v ...string) func(*CatTransformsRequest) { } // WithSize - specifies a max number of transforms to get, defaults to 100. +// func (f CatTransforms) WithSize(v int) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.Size = &v @@ -248,6 +260,7 @@ func (f CatTransforms) WithSize(v int) func(*CatTransformsRequest) { } // WithTime - the unit in which to display time values. +// func (f CatTransforms) WithTime(v string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.Time = v @@ -255,6 +268,7 @@ func (f CatTransforms) WithTime(v string) func(*CatTransformsRequest) { } // WithV - verbose mode. display column headers. +// func (f CatTransforms) WithV(v bool) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.V = &v @@ -262,6 +276,7 @@ func (f CatTransforms) WithV(v bool) func(*CatTransformsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CatTransforms) WithPretty() func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.Pretty = true @@ -269,6 +284,7 @@ func (f CatTransforms) WithPretty() func(*CatTransformsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CatTransforms) WithHuman() func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.Human = true @@ -276,6 +292,7 @@ func (f CatTransforms) WithHuman() func(*CatTransformsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CatTransforms) WithErrorTrace() func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.ErrorTrace = true @@ -283,6 +300,7 @@ func (f CatTransforms) WithErrorTrace() func(*CatTransformsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CatTransforms) WithFilterPath(v ...string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { r.FilterPath = v @@ -290,6 +308,7 @@ func (f CatTransforms) WithFilterPath(v ...string) func(*CatTransformsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CatTransforms) WithHeader(h map[string]string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { if r.Header == nil { @@ -302,6 +321,7 @@ func (f CatTransforms) WithHeader(h map[string]string) func(*CatTransformsReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CatTransforms) WithOpaqueID(s string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index 5428d8e086d..c992eb2b0a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRDeleteAutoFollowPatternFunc(t Transport) CCRDeleteAutoFollowPattern { // CCRDeleteAutoFollowPattern - Deletes auto-follow patterns. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html. +// type CCRDeleteAutoFollowPattern func(name string, o ...func(*CCRDeleteAutoFollowPatternRequest)) (*Response, error) // CCRDeleteAutoFollowPatternRequest configures the CCR Delete Auto Follow Pattern API request. +// type CCRDeleteAutoFollowPatternRequest struct { Name string @@ -57,6 +59,7 @@ type CCRDeleteAutoFollowPatternRequest struct { } // Do executes the request and returns response or error. +// func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f CCRDeleteAutoFollowPattern) WithContext(v context.Context) func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f CCRDeleteAutoFollowPattern) WithContext(v context.Context) func(*CCRDele } // WithPretty makes the response body pretty-printed. +// func (f CCRDeleteAutoFollowPattern) WithPretty() func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f CCRDeleteAutoFollowPattern) WithPretty() func(*CCRDeleteAutoFollowPatter } // WithHuman makes statistical values human-readable. +// func (f CCRDeleteAutoFollowPattern) WithHuman() func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f CCRDeleteAutoFollowPattern) WithHuman() func(*CCRDeleteAutoFollowPattern } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRDeleteAutoFollowPattern) WithErrorTrace() func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f CCRDeleteAutoFollowPattern) WithErrorTrace() func(*CCRDeleteAutoFollowPa } // WithFilterPath filters the properties of the response body. +// func (f CCRDeleteAutoFollowPattern) WithFilterPath(v ...string) func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f CCRDeleteAutoFollowPattern) WithFilterPath(v ...string) func(*CCRDeleteA } // WithHeader adds the headers to the HTTP request. +// func (f CCRDeleteAutoFollowPattern) WithHeader(h map[string]string) func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f CCRDeleteAutoFollowPattern) WithHeader(h map[string]string) func(*CCRDel } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRDeleteAutoFollowPattern) WithOpaqueID(s string) func(*CCRDeleteAutoFollowPatternRequest) { return func(r *CCRDeleteAutoFollowPatternRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow.go index 4be4848d883..62fe6ba73ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCCRFollowFunc(t Transport) CCRFollow { // CCRFollow - Creates a new follower index configured to follow the referenced leader index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html. +// type CCRFollow func(index string, body io.Reader, o ...func(*CCRFollowRequest)) (*Response, error) // CCRFollowRequest configures the CCR Follow API request. +// type CCRFollowRequest struct { Index string @@ -62,6 +64,7 @@ type CCRFollowRequest struct { } // Do executes the request and returns response or error. +// func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -114,6 +117,10 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -126,10 +133,6 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -149,6 +152,7 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f CCRFollow) WithContext(v context.Context) func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f CCRFollow) WithContext(v context.Context) func(*CCRFollowRequest) { } // WithWaitForActiveShards - sets the number of shard copies that must be active before returning. defaults to 0. set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1). +// func (f CCRFollow) WithWaitForActiveShards(v string) func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { r.WaitForActiveShards = v @@ -163,6 +168,7 @@ func (f CCRFollow) WithWaitForActiveShards(v string) func(*CCRFollowRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CCRFollow) WithPretty() func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { r.Pretty = true @@ -170,6 +176,7 @@ func (f CCRFollow) WithPretty() func(*CCRFollowRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRFollow) WithHuman() func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { r.Human = true @@ -177,6 +184,7 @@ func (f CCRFollow) WithHuman() func(*CCRFollowRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRFollow) WithErrorTrace() func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { r.ErrorTrace = true @@ -184,6 +192,7 @@ func (f CCRFollow) WithErrorTrace() func(*CCRFollowRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRFollow) WithFilterPath(v ...string) func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { r.FilterPath = v @@ -191,6 +200,7 @@ func (f CCRFollow) WithFilterPath(v ...string) func(*CCRFollowRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CCRFollow) WithHeader(h map[string]string) func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { if r.Header == nil { @@ -203,6 +213,7 @@ func (f CCRFollow) WithHeader(h map[string]string) func(*CCRFollowRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRFollow) WithOpaqueID(s string) func(*CCRFollowRequest) { return func(r *CCRFollowRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_info.go index 7c2f2ad0e0a..01feec7e295 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { // CCRFollowInfo - Retrieves information about all follower indices, including parameters and status for each follower index // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html. +// type CCRFollowInfo func(index []string, o ...func(*CCRFollowInfoRequest)) (*Response, error) // CCRFollowInfoRequest configures the CCR Follow Info API request. +// type CCRFollowInfoRequest struct { Index []string @@ -58,6 +60,7 @@ type CCRFollowInfoRequest struct { } // Do executes the request and returns response or error. +// func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f CCRFollowInfo) WithContext(v context.Context) func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f CCRFollowInfo) WithContext(v context.Context) func(*CCRFollowInfoRequest } // WithPretty makes the response body pretty-printed. +// func (f CCRFollowInfo) WithPretty() func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f CCRFollowInfo) WithPretty() func(*CCRFollowInfoRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRFollowInfo) WithHuman() func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f CCRFollowInfo) WithHuman() func(*CCRFollowInfoRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRFollowInfo) WithErrorTrace() func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f CCRFollowInfo) WithErrorTrace() func(*CCRFollowInfoRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRFollowInfo) WithFilterPath(v ...string) func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f CCRFollowInfo) WithFilterPath(v ...string) func(*CCRFollowInfoRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CCRFollowInfo) WithHeader(h map[string]string) func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f CCRFollowInfo) WithHeader(h map[string]string) func(*CCRFollowInfoReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRFollowInfo) WithOpaqueID(s string) func(*CCRFollowInfoRequest) { return func(r *CCRFollowInfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_stats.go index 1fe9440ed28..e7a7eaf0a19 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.follow_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCCRFollowStatsFunc(t Transport) CCRFollowStats { // CCRFollowStats - Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html. +// type CCRFollowStats func(index []string, o ...func(*CCRFollowStatsRequest)) (*Response, error) // CCRFollowStatsRequest configures the CCR Follow Stats API request. +// type CCRFollowStatsRequest struct { Index []string @@ -58,6 +60,7 @@ type CCRFollowStatsRequest struct { } // Do executes the request and returns response or error. +// func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f CCRFollowStats) WithContext(v context.Context) func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f CCRFollowStats) WithContext(v context.Context) func(*CCRFollowStatsReque } // WithPretty makes the response body pretty-printed. +// func (f CCRFollowStats) WithPretty() func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f CCRFollowStats) WithPretty() func(*CCRFollowStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRFollowStats) WithHuman() func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f CCRFollowStats) WithHuman() func(*CCRFollowStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRFollowStats) WithErrorTrace() func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f CCRFollowStats) WithErrorTrace() func(*CCRFollowStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRFollowStats) WithFilterPath(v ...string) func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f CCRFollowStats) WithFilterPath(v ...string) func(*CCRFollowStatsRequest) } // WithHeader adds the headers to the HTTP request. +// func (f CCRFollowStats) WithHeader(h map[string]string) func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f CCRFollowStats) WithHeader(h map[string]string) func(*CCRFollowStatsRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRFollowStats) WithOpaqueID(s string) func(*CCRFollowStatsRequest) { return func(r *CCRFollowStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.forget_follower.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.forget_follower.go index 14f4edb4e99..306da102f1b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.forget_follower.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.forget_follower.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCCRForgetFollowerFunc(t Transport) CCRForgetFollower { // CCRForgetFollower - Removes the follower retention leases from the leader. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html. +// type CCRForgetFollower func(index string, body io.Reader, o ...func(*CCRForgetFollowerRequest)) (*Response, error) // CCRForgetFollowerRequest configures the CCR Forget Follower API request. +// type CCRForgetFollowerRequest struct { Index string @@ -60,6 +62,7 @@ type CCRForgetFollowerRequest struct { } // Do executes the request and returns response or error. +// func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( 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 @@ -120,10 +127,6 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f CCRForgetFollower) WithContext(v context.Context) func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f CCRForgetFollower) WithContext(v context.Context) func(*CCRForgetFollowe } // WithPretty makes the response body pretty-printed. +// func (f CCRForgetFollower) WithPretty() func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f CCRForgetFollower) WithPretty() func(*CCRForgetFollowerRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRForgetFollower) WithHuman() func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f CCRForgetFollower) WithHuman() func(*CCRForgetFollowerRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRForgetFollower) WithErrorTrace() func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f CCRForgetFollower) WithErrorTrace() func(*CCRForgetFollowerRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRForgetFollower) WithFilterPath(v ...string) func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f CCRForgetFollower) WithFilterPath(v ...string) func(*CCRForgetFollowerRe } // WithHeader adds the headers to the HTTP request. +// func (f CCRForgetFollower) WithHeader(h map[string]string) func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f CCRForgetFollower) WithHeader(h map[string]string) func(*CCRForgetFollow } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRForgetFollower) WithOpaqueID(s string) func(*CCRForgetFollowerRequest) { return func(r *CCRForgetFollowerRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.get_auto_follow_pattern.go index dda4eb554bd..c0a2d29126d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRGetAutoFollowPatternFunc(t Transport) CCRGetAutoFollowPattern { // CCRGetAutoFollowPattern - Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html. +// type CCRGetAutoFollowPattern func(o ...func(*CCRGetAutoFollowPatternRequest)) (*Response, error) // CCRGetAutoFollowPatternRequest configures the CCR Get Auto Follow Pattern API request. +// type CCRGetAutoFollowPatternRequest struct { Name string @@ -57,6 +59,7 @@ type CCRGetAutoFollowPatternRequest struct { } // Do executes the request and returns response or error. +// func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f CCRGetAutoFollowPattern) WithContext(v context.Context) func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f CCRGetAutoFollowPattern) WithContext(v context.Context) func(*CCRGetAuto } // WithName - the name of the auto follow pattern.. +// func (f CCRGetAutoFollowPattern) WithName(v string) func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { r.Name = v @@ -152,6 +157,7 @@ func (f CCRGetAutoFollowPattern) WithName(v string) func(*CCRGetAutoFollowPatter } // WithPretty makes the response body pretty-printed. +// func (f CCRGetAutoFollowPattern) WithPretty() func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f CCRGetAutoFollowPattern) WithPretty() func(*CCRGetAutoFollowPatternReque } // WithHuman makes statistical values human-readable. +// func (f CCRGetAutoFollowPattern) WithHuman() func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f CCRGetAutoFollowPattern) WithHuman() func(*CCRGetAutoFollowPatternReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRGetAutoFollowPattern) WithErrorTrace() func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f CCRGetAutoFollowPattern) WithErrorTrace() func(*CCRGetAutoFollowPatternR } // WithFilterPath filters the properties of the response body. +// func (f CCRGetAutoFollowPattern) WithFilterPath(v ...string) func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f CCRGetAutoFollowPattern) WithFilterPath(v ...string) func(*CCRGetAutoFol } // WithHeader adds the headers to the HTTP request. +// func (f CCRGetAutoFollowPattern) WithHeader(h map[string]string) func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f CCRGetAutoFollowPattern) WithHeader(h map[string]string) func(*CCRGetAut } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRGetAutoFollowPattern) WithOpaqueID(s string) func(*CCRGetAutoFollowPatternRequest) { return func(r *CCRGetAutoFollowPatternRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_auto_follow_pattern.go index bb2319e7f84..ecf219f1a54 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRPauseAutoFollowPatternFunc(t Transport) CCRPauseAutoFollowPattern { // CCRPauseAutoFollowPattern - Pauses an auto-follow pattern // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html. +// type CCRPauseAutoFollowPattern func(name string, o ...func(*CCRPauseAutoFollowPatternRequest)) (*Response, error) // CCRPauseAutoFollowPatternRequest configures the CCR Pause Auto Follow Pattern API request. +// type CCRPauseAutoFollowPatternRequest struct { Name string @@ -57,6 +59,7 @@ type CCRPauseAutoFollowPatternRequest struct { } // Do executes the request and returns response or error. +// func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f CCRPauseAutoFollowPattern) WithContext(v context.Context) func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f CCRPauseAutoFollowPattern) WithContext(v context.Context) func(*CCRPause } // WithPretty makes the response body pretty-printed. +// func (f CCRPauseAutoFollowPattern) WithPretty() func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f CCRPauseAutoFollowPattern) WithPretty() func(*CCRPauseAutoFollowPatternR } // WithHuman makes statistical values human-readable. +// func (f CCRPauseAutoFollowPattern) WithHuman() func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f CCRPauseAutoFollowPattern) WithHuman() func(*CCRPauseAutoFollowPatternRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRPauseAutoFollowPattern) WithErrorTrace() func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f CCRPauseAutoFollowPattern) WithErrorTrace() func(*CCRPauseAutoFollowPatt } // WithFilterPath filters the properties of the response body. +// func (f CCRPauseAutoFollowPattern) WithFilterPath(v ...string) func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f CCRPauseAutoFollowPattern) WithFilterPath(v ...string) func(*CCRPauseAut } // WithHeader adds the headers to the HTTP request. +// func (f CCRPauseAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f CCRPauseAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPaus } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRPauseAutoFollowPattern) WithOpaqueID(s string) func(*CCRPauseAutoFollowPatternRequest) { return func(r *CCRPauseAutoFollowPatternRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_follow.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_follow.go index 24c636283e2..c8958d9ca9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.pause_follow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRPauseFollowFunc(t Transport) CCRPauseFollow { // CCRPauseFollow - Pauses a follower index. The follower index will not fetch any additional operations from the leader index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html. +// type CCRPauseFollow func(index string, o ...func(*CCRPauseFollowRequest)) (*Response, error) // CCRPauseFollowRequest configures the CCR Pause Follow API request. +// type CCRPauseFollowRequest struct { Index string @@ -57,6 +59,7 @@ type CCRPauseFollowRequest struct { } // Do executes the request and returns response or error. +// func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f CCRPauseFollow) WithContext(v context.Context) func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f CCRPauseFollow) WithContext(v context.Context) func(*CCRPauseFollowReque } // WithPretty makes the response body pretty-printed. +// func (f CCRPauseFollow) WithPretty() func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f CCRPauseFollow) WithPretty() func(*CCRPauseFollowRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRPauseFollow) WithHuman() func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f CCRPauseFollow) WithHuman() func(*CCRPauseFollowRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRPauseFollow) WithErrorTrace() func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f CCRPauseFollow) WithErrorTrace() func(*CCRPauseFollowRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRPauseFollow) WithFilterPath(v ...string) func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f CCRPauseFollow) WithFilterPath(v ...string) func(*CCRPauseFollowRequest) } // WithHeader adds the headers to the HTTP request. +// func (f CCRPauseFollow) WithHeader(h map[string]string) func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f CCRPauseFollow) WithHeader(h map[string]string) func(*CCRPauseFollowRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRPauseFollow) WithOpaqueID(s string) func(*CCRPauseFollowRequest) { return func(r *CCRPauseFollowRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.put_auto_follow_pattern.go index e558a8ef350..13d5c0b14b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCCRPutAutoFollowPatternFunc(t Transport) CCRPutAutoFollowPattern { // CCRPutAutoFollowPattern - Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html. +// type CCRPutAutoFollowPattern func(name string, body io.Reader, o ...func(*CCRPutAutoFollowPatternRequest)) (*Response, error) // CCRPutAutoFollowPatternRequest configures the CCR Put Auto Follow Pattern API request. +// type CCRPutAutoFollowPatternRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type CCRPutAutoFollowPatternRequest struct { } // Do executes the request and returns response or error. +// func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp 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 @@ -120,10 +127,6 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f CCRPutAutoFollowPattern) WithContext(v context.Context) func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f CCRPutAutoFollowPattern) WithContext(v context.Context) func(*CCRPutAuto } // WithPretty makes the response body pretty-printed. +// func (f CCRPutAutoFollowPattern) WithPretty() func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f CCRPutAutoFollowPattern) WithPretty() func(*CCRPutAutoFollowPatternReque } // WithHuman makes statistical values human-readable. +// func (f CCRPutAutoFollowPattern) WithHuman() func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f CCRPutAutoFollowPattern) WithHuman() func(*CCRPutAutoFollowPatternReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRPutAutoFollowPattern) WithErrorTrace() func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f CCRPutAutoFollowPattern) WithErrorTrace() func(*CCRPutAutoFollowPatternR } // WithFilterPath filters the properties of the response body. +// func (f CCRPutAutoFollowPattern) WithFilterPath(v ...string) func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f CCRPutAutoFollowPattern) WithFilterPath(v ...string) func(*CCRPutAutoFol } // WithHeader adds the headers to the HTTP request. +// func (f CCRPutAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f CCRPutAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPutAut } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRPutAutoFollowPattern) WithOpaqueID(s string) func(*CCRPutAutoFollowPatternRequest) { return func(r *CCRPutAutoFollowPatternRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_auto_follow_pattern.go index f1e7e7bb12a..4f47c8e23b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRResumeAutoFollowPatternFunc(t Transport) CCRResumeAutoFollowPattern { // CCRResumeAutoFollowPattern - Resumes an auto-follow pattern that has been paused // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html. +// type CCRResumeAutoFollowPattern func(name string, o ...func(*CCRResumeAutoFollowPatternRequest)) (*Response, error) // CCRResumeAutoFollowPatternRequest configures the CCR Resume Auto Follow Pattern API request. +// type CCRResumeAutoFollowPatternRequest struct { Name string @@ -57,6 +59,7 @@ type CCRResumeAutoFollowPatternRequest struct { } // Do executes the request and returns response or error. +// func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f CCRResumeAutoFollowPattern) WithContext(v context.Context) func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f CCRResumeAutoFollowPattern) WithContext(v context.Context) func(*CCRResu } // WithPretty makes the response body pretty-printed. +// func (f CCRResumeAutoFollowPattern) WithPretty() func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f CCRResumeAutoFollowPattern) WithPretty() func(*CCRResumeAutoFollowPatter } // WithHuman makes statistical values human-readable. +// func (f CCRResumeAutoFollowPattern) WithHuman() func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f CCRResumeAutoFollowPattern) WithHuman() func(*CCRResumeAutoFollowPattern } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRResumeAutoFollowPattern) WithErrorTrace() func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f CCRResumeAutoFollowPattern) WithErrorTrace() func(*CCRResumeAutoFollowPa } // WithFilterPath filters the properties of the response body. +// func (f CCRResumeAutoFollowPattern) WithFilterPath(v ...string) func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f CCRResumeAutoFollowPattern) WithFilterPath(v ...string) func(*CCRResumeA } // WithHeader adds the headers to the HTTP request. +// func (f CCRResumeAutoFollowPattern) WithHeader(h map[string]string) func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f CCRResumeAutoFollowPattern) WithHeader(h map[string]string) func(*CCRRes } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRResumeAutoFollowPattern) WithOpaqueID(s string) func(*CCRResumeAutoFollowPatternRequest) { return func(r *CCRResumeAutoFollowPatternRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_follow.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_follow.go index 69d99d44808..d7bfbe845fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.resume_follow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newCCRResumeFollowFunc(t Transport) CCRResumeFollow { // CCRResumeFollow - Resumes a follower index that has been paused // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html. +// type CCRResumeFollow func(index string, o ...func(*CCRResumeFollowRequest)) (*Response, error) // CCRResumeFollowRequest configures the CCR Resume Follow API request. +// type CCRResumeFollowRequest struct { Index string @@ -60,6 +62,7 @@ type CCRResumeFollowRequest struct { } // Do executes the request and returns response or error. +// func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -120,10 +127,6 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f CCRResumeFollow) WithContext(v context.Context) func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f CCRResumeFollow) WithContext(v context.Context) func(*CCRResumeFollowReq } // WithBody - The name of the leader index and other optional ccr related parameters. +// func (f CCRResumeFollow) WithBody(v io.Reader) func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f CCRResumeFollow) WithBody(v io.Reader) func(*CCRResumeFollowRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CCRResumeFollow) WithPretty() func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f CCRResumeFollow) WithPretty() func(*CCRResumeFollowRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRResumeFollow) WithHuman() func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f CCRResumeFollow) WithHuman() func(*CCRResumeFollowRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRResumeFollow) WithErrorTrace() func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f CCRResumeFollow) WithErrorTrace() func(*CCRResumeFollowRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRResumeFollow) WithFilterPath(v ...string) func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f CCRResumeFollow) WithFilterPath(v ...string) func(*CCRResumeFollowReques } // WithHeader adds the headers to the HTTP request. +// func (f CCRResumeFollow) WithHeader(h map[string]string) func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f CCRResumeFollow) WithHeader(h map[string]string) func(*CCRResumeFollowRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRResumeFollow) WithOpaqueID(s string) func(*CCRResumeFollowRequest) { return func(r *CCRResumeFollowRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.stats.go index e3efcb18c67..f822d21802a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRStatsFunc(t Transport) CCRStats { // CCRStats - Gets all stats related to cross-cluster replication. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html. +// type CCRStats func(o ...func(*CCRStatsRequest)) (*Response, error) // CCRStatsRequest configures the CCR Stats API request. +// type CCRStatsRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type CCRStatsRequest struct { } // Do executes the request and returns response or error. +// func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f CCRStats) WithContext(v context.Context) func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f CCRStats) WithContext(v context.Context) func(*CCRStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CCRStats) WithPretty() func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f CCRStats) WithPretty() func(*CCRStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRStats) WithHuman() func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f CCRStats) WithHuman() func(*CCRStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRStats) WithErrorTrace() func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f CCRStats) WithErrorTrace() func(*CCRStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRStats) WithFilterPath(v ...string) func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f CCRStats) WithFilterPath(v ...string) func(*CCRStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CCRStats) WithHeader(h map[string]string) func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f CCRStats) WithHeader(h map[string]string) func(*CCRStatsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRStats) WithOpaqueID(s string) func(*CCRStatsRequest) { return func(r *CCRStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.unfollow.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.unfollow.go index ad3e8da29b0..0e4c2e4d8c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.unfollow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ccr.unfollow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newCCRUnfollowFunc(t Transport) CCRUnfollow { // CCRUnfollow - Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html. +// type CCRUnfollow func(index string, o ...func(*CCRUnfollowRequest)) (*Response, error) // CCRUnfollowRequest configures the CCR Unfollow API request. +// type CCRUnfollowRequest struct { Index string @@ -57,6 +59,7 @@ type CCRUnfollowRequest struct { } // Do executes the request and returns response or error. +// func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f CCRUnfollow) WithContext(v context.Context) func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f CCRUnfollow) WithContext(v context.Context) func(*CCRUnfollowRequest) { } // WithPretty makes the response body pretty-printed. +// func (f CCRUnfollow) WithPretty() func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f CCRUnfollow) WithPretty() func(*CCRUnfollowRequest) { } // WithHuman makes statistical values human-readable. +// func (f CCRUnfollow) WithHuman() func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f CCRUnfollow) WithHuman() func(*CCRUnfollowRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f CCRUnfollow) WithErrorTrace() func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f CCRUnfollow) WithErrorTrace() func(*CCRUnfollowRequest) { } // WithFilterPath filters the properties of the response body. +// func (f CCRUnfollow) WithFilterPath(v ...string) func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f CCRUnfollow) WithFilterPath(v ...string) func(*CCRUnfollowRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f CCRUnfollow) WithHeader(h map[string]string) func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f CCRUnfollow) WithHeader(h map[string]string) func(*CCRUnfollowRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f CCRUnfollow) WithOpaqueID(s string) func(*CCRUnfollowRequest) { return func(r *CCRUnfollowRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.close_point_in_time.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.close_point_in_time.go index 12b9eb22efd..df1e9dcf32c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.close_point_in_time.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.close_point_in_time.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newClosePointInTimeFunc(t Transport) ClosePointInTime { // ClosePointInTime - Close a point in time // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html. +// type ClosePointInTime func(o ...func(*ClosePointInTimeRequest)) (*Response, error) // ClosePointInTimeRequest configures the Close Point In Time API request. +// type ClosePointInTimeRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type ClosePointInTimeRequest struct { } // Do executes the request and returns response or error. +// func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (* 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 @@ -113,10 +120,6 @@ func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (* } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f ClosePointInTime) WithContext(v context.Context) func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f ClosePointInTime) WithContext(v context.Context) func(*ClosePointInTimeR } // WithBody - a point-in-time id to close. +// func (f ClosePointInTime) WithBody(v io.Reader) func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { r.Body = v @@ -150,6 +155,7 @@ func (f ClosePointInTime) WithBody(v io.Reader) func(*ClosePointInTimeRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ClosePointInTime) WithPretty() func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f ClosePointInTime) WithPretty() func(*ClosePointInTimeRequest) { } // WithHuman makes statistical values human-readable. +// func (f ClosePointInTime) WithHuman() func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f ClosePointInTime) WithHuman() func(*ClosePointInTimeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ClosePointInTime) WithErrorTrace() func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f ClosePointInTime) WithErrorTrace() func(*ClosePointInTimeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ClosePointInTime) WithFilterPath(v ...string) func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f ClosePointInTime) WithFilterPath(v ...string) func(*ClosePointInTimeRequ } // WithHeader adds the headers to the HTTP request. +// func (f ClosePointInTime) WithHeader(h map[string]string) func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f ClosePointInTime) WithHeader(h map[string]string) func(*ClosePointInTime } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ClosePointInTime) WithOpaqueID(s string) func(*ClosePointInTimeRequest) { return func(r *ClosePointInTimeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go index 33d2fbf233f..9e7ed27abd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newDataFrameTransformDeprecatedDeleteTransformFunc(t Transport) DataFrameTr // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html. +// type DataFrameTransformDeprecatedDeleteTransform func(transform_id string, o ...func(*DataFrameTransformDeprecatedDeleteTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedDeleteTransformRequest configures the Data Frame Transform Deprecated Delete Transform API request. +// type DataFrameTransformDeprecatedDeleteTransformRequest struct { TransformID string @@ -62,6 +64,7 @@ type DataFrameTransformDeprecatedDeleteTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedDeleteTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -145,6 +148,7 @@ func (r DataFrameTransformDeprecatedDeleteTransformRequest) Do(ctx context.Conte } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithContext(v context.Conte } // WithForce - when `true`, the transform is deleted regardless of its current state. the default value is `false`, meaning that the transform must be `stopped` before it can be deleted.. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithForce(v bool) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { r.Force = &v @@ -159,6 +164,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithForce(v bool) func(*Dat } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithPretty() func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithPretty() func(*DataFram } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithHuman() func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithHuman() func(*DataFrame } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithErrorTrace() func(*Data } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithFilterPath(v ...string) } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f DataFrameTransformDeprecatedDeleteTransform) WithHeader(h map[string]str } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedDeleteTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go index 6802aec4544..b9d26bb86a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newDataFrameTransformDeprecatedGetTransformFunc(t Transport) DataFrameTrans // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html. +// type DataFrameTransformDeprecatedGetTransform func(o ...func(*DataFrameTransformDeprecatedGetTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedGetTransformRequest configures the Data Frame Transform Deprecated Get Transform API request. +// type DataFrameTransformDeprecatedGetTransformRequest struct { TransformID string @@ -65,6 +67,7 @@ type DataFrameTransformDeprecatedGetTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedGetTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -162,6 +165,7 @@ func (r DataFrameTransformDeprecatedGetTransformRequest) Do(ctx context.Context, } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedGetTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithContext(v context.Context) } // WithTransformID - the ID or comma delimited list of ID expressions of the transforms to get, '_all' or '*' implies get all transforms. +// func (f DataFrameTransformDeprecatedGetTransform) WithTransformID(v string) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.TransformID = v @@ -176,6 +181,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithTransformID(v string) func } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f DataFrameTransformDeprecatedGetTransform) WithAllowNoMatch(v bool) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.AllowNoMatch = &v @@ -183,6 +189,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithAllowNoMatch(v bool) func( } // WithExcludeGenerated - omits generated fields. allows transform configurations to be easily copied between clusters and within the same cluster. +// func (f DataFrameTransformDeprecatedGetTransform) WithExcludeGenerated(v bool) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.ExcludeGenerated = &v @@ -190,6 +197,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithExcludeGenerated(v bool) f } // WithFrom - skips a number of transform configs, defaults to 0. +// func (f DataFrameTransformDeprecatedGetTransform) WithFrom(v int) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.From = &v @@ -197,6 +205,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithFrom(v int) func(*DataFram } // WithSize - specifies a max number of transforms to get, defaults to 100. +// func (f DataFrameTransformDeprecatedGetTransform) WithSize(v int) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.Size = &v @@ -204,6 +213,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithSize(v int) func(*DataFram } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedGetTransform) WithPretty() func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.Pretty = true @@ -211,6 +221,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithPretty() func(*DataFrameTr } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedGetTransform) WithHuman() func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.Human = true @@ -218,6 +229,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithHuman() func(*DataFrameTra } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedGetTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.ErrorTrace = true @@ -225,6 +237,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithErrorTrace() func(*DataFra } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedGetTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { r.FilterPath = v @@ -232,6 +245,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithFilterPath(v ...string) fu } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedGetTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { if r.Header == nil { @@ -244,6 +258,7 @@ func (f DataFrameTransformDeprecatedGetTransform) WithHeader(h map[string]string } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedGetTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedGetTransformRequest) { return func(r *DataFrameTransformDeprecatedGetTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go index 446d9f30bc0..f6f32f81bfa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newDataFrameTransformDeprecatedGetTransformStatsFunc(t Transport) DataFrame // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html. +// type DataFrameTransformDeprecatedGetTransformStats func(transform_id string, o ...func(*DataFrameTransformDeprecatedGetTransformStatsRequest)) (*Response, error) // DataFrameTransformDeprecatedGetTransformStatsRequest configures the Data Frame Transform Deprecated Get Transform Stats API request. +// type DataFrameTransformDeprecatedGetTransformStatsRequest struct { TransformID string @@ -64,6 +66,7 @@ type DataFrameTransformDeprecatedGetTransformStatsRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedGetTransformStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -157,6 +160,7 @@ func (r DataFrameTransformDeprecatedGetTransformStatsRequest) Do(ctx context.Con } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithContext(v context.Context) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.ctx = v @@ -164,6 +168,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithContext(v context.Con } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f DataFrameTransformDeprecatedGetTransformStats) WithAllowNoMatch(v bool) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.AllowNoMatch = &v @@ -171,6 +176,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithAllowNoMatch(v bool) } // WithFrom - skips a number of transform stats, defaults to 0. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithFrom(v int) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.From = &v @@ -178,6 +184,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithFrom(v int) func(*Dat } // WithSize - specifies a max number of transform stats to get, defaults to 100. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithSize(v int) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.Size = &v @@ -185,6 +192,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithSize(v int) func(*Dat } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithPretty() func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.Pretty = true @@ -192,6 +200,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithPretty() func(*DataFr } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithHuman() func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.Human = true @@ -199,6 +208,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithHuman() func(*DataFra } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithErrorTrace() func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.ErrorTrace = true @@ -206,6 +216,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithErrorTrace() func(*Da } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { r.FilterPath = v @@ -213,6 +224,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithFilterPath(v ...strin } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { if r.Header == nil { @@ -225,6 +237,7 @@ func (f DataFrameTransformDeprecatedGetTransformStats) WithHeader(h map[string]s } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedGetTransformStats) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go index e08ddab4f69..6b7983c945d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newDataFrameTransformDeprecatedPreviewTransformFunc(t Transport) DataFrameT // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html. +// type DataFrameTransformDeprecatedPreviewTransform func(body io.Reader, o ...func(*DataFrameTransformDeprecatedPreviewTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedPreviewTransformRequest configures the Data Frame Transform Deprecated Preview Transform API request. +// type DataFrameTransformDeprecatedPreviewTransformRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type DataFrameTransformDeprecatedPreviewTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedPreviewTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -103,6 +106,10 @@ func (r DataFrameTransformDeprecatedPreviewTransformRequest) Do(ctx context.Cont 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 @@ -115,10 +122,6 @@ func (r DataFrameTransformDeprecatedPreviewTransformRequest) Do(ctx context.Cont } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -138,6 +141,7 @@ func (r DataFrameTransformDeprecatedPreviewTransformRequest) Do(ctx context.Cont } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f DataFrameTransformDeprecatedPreviewTransform) WithContext(v context.Cont } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithPretty() func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f DataFrameTransformDeprecatedPreviewTransform) WithPretty() func(*DataFra } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithHuman() func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f DataFrameTransformDeprecatedPreviewTransform) WithHuman() func(*DataFram } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f DataFrameTransformDeprecatedPreviewTransform) WithErrorTrace() func(*Dat } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f DataFrameTransformDeprecatedPreviewTransform) WithFilterPath(v ...string } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f DataFrameTransformDeprecatedPreviewTransform) WithHeader(h map[string]st } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedPreviewTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go index cc6a3f1b345..932733a7339 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newDataFrameTransformDeprecatedPutTransformFunc(t Transport) DataFrameTrans // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html. +// type DataFrameTransformDeprecatedPutTransform func(body io.Reader, transform_id string, o ...func(*DataFrameTransformDeprecatedPutTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedPutTransformRequest configures the Data Frame Transform Deprecated Put Transform API request. +// type DataFrameTransformDeprecatedPutTransformRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type DataFrameTransformDeprecatedPutTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedPutTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -117,6 +120,10 @@ func (r DataFrameTransformDeprecatedPutTransformRequest) Do(ctx context.Context, 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 @@ -129,10 +136,6 @@ func (r DataFrameTransformDeprecatedPutTransformRequest) Do(ctx context.Context, } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -152,6 +155,7 @@ func (r DataFrameTransformDeprecatedPutTransformRequest) Do(ctx context.Context, } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedPutTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithContext(v context.Context) } // WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// func (f DataFrameTransformDeprecatedPutTransform) WithDeferValidation(v bool) func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { r.DeferValidation = &v @@ -166,6 +171,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithDeferValidation(v bool) fu } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedPutTransform) WithPretty() func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { r.Pretty = true @@ -173,6 +179,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithPretty() func(*DataFrameTr } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedPutTransform) WithHuman() func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { r.Human = true @@ -180,6 +187,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithHuman() func(*DataFrameTra } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedPutTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { r.ErrorTrace = true @@ -187,6 +195,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithErrorTrace() func(*DataFra } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedPutTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { r.FilterPath = v @@ -194,6 +203,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithFilterPath(v ...string) fu } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedPutTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { if r.Header == nil { @@ -206,6 +216,7 @@ func (f DataFrameTransformDeprecatedPutTransform) WithHeader(h map[string]string } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedPutTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedPutTransformRequest) { return func(r *DataFrameTransformDeprecatedPutTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go index 346a97be06a..90411527bcc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newDataFrameTransformDeprecatedStartTransformFunc(t Transport) DataFrameTra // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html. +// type DataFrameTransformDeprecatedStartTransform func(transform_id string, o ...func(*DataFrameTransformDeprecatedStartTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedStartTransformRequest configures the Data Frame Transform Deprecated Start Transform API request. +// type DataFrameTransformDeprecatedStartTransformRequest struct { TransformID string @@ -62,6 +64,7 @@ type DataFrameTransformDeprecatedStartTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedStartTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -147,6 +150,7 @@ func (r DataFrameTransformDeprecatedStartTransformRequest) Do(ctx context.Contex } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedStartTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithContext(v context.Contex } // WithTimeout - controls the time to wait for the transform to start. +// func (f DataFrameTransformDeprecatedStartTransform) WithTimeout(v time.Duration) func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { r.Timeout = v @@ -161,6 +166,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithTimeout(v time.Duration) } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedStartTransform) WithPretty() func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { r.Pretty = true @@ -168,6 +174,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithPretty() func(*DataFrame } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedStartTransform) WithHuman() func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { r.Human = true @@ -175,6 +182,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithHuman() func(*DataFrameT } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedStartTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { r.ErrorTrace = true @@ -182,6 +190,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithErrorTrace() func(*DataF } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedStartTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { r.FilterPath = v @@ -189,6 +198,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithFilterPath(v ...string) } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedStartTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { if r.Header == nil { @@ -201,6 +211,7 @@ func (f DataFrameTransformDeprecatedStartTransform) WithHeader(h map[string]stri } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedStartTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedStartTransformRequest) { return func(r *DataFrameTransformDeprecatedStartTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go index 3b2025c74f1..ad1ff9730c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newDataFrameTransformDeprecatedStopTransformFunc(t Transport) DataFrameTran // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html. +// type DataFrameTransformDeprecatedStopTransform func(transform_id string, o ...func(*DataFrameTransformDeprecatedStopTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedStopTransformRequest configures the Data Frame Transform Deprecated Stop Transform API request. +// type DataFrameTransformDeprecatedStopTransformRequest struct { TransformID string @@ -65,6 +67,7 @@ type DataFrameTransformDeprecatedStopTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedStopTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r DataFrameTransformDeprecatedStopTransformRequest) Do(ctx context.Context } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedStopTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithContext(v context.Context } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f DataFrameTransformDeprecatedStopTransform) WithAllowNoMatch(v bool) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.AllowNoMatch = &v @@ -172,6 +177,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithAllowNoMatch(v bool) func } // WithTimeout - controls the time to wait until the transform has stopped. default to 30 seconds. +// func (f DataFrameTransformDeprecatedStopTransform) WithTimeout(v time.Duration) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.Timeout = v @@ -179,6 +185,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithTimeout(v time.Duration) } // WithWaitForCompletion - whether to wait for the transform to fully stop before returning or not. default to false. +// func (f DataFrameTransformDeprecatedStopTransform) WithWaitForCompletion(v bool) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.WaitForCompletion = &v @@ -186,6 +193,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithWaitForCompletion(v bool) } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedStopTransform) WithPretty() func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.Pretty = true @@ -193,6 +201,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithPretty() func(*DataFrameT } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedStopTransform) WithHuman() func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.Human = true @@ -200,6 +209,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithHuman() func(*DataFrameTr } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedStopTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.ErrorTrace = true @@ -207,6 +217,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithErrorTrace() func(*DataFr } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedStopTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { r.FilterPath = v @@ -214,6 +225,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithFilterPath(v ...string) f } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedStopTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { if r.Header == nil { @@ -226,6 +238,7 @@ func (f DataFrameTransformDeprecatedStopTransform) WithHeader(h map[string]strin } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedStopTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedStopTransformRequest) { return func(r *DataFrameTransformDeprecatedStopTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go index 43cccf8470a..2f22f84f6e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newDataFrameTransformDeprecatedUpdateTransformFunc(t Transport) DataFrameTr // This API is beta. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html. +// type DataFrameTransformDeprecatedUpdateTransform func(body io.Reader, transform_id string, o ...func(*DataFrameTransformDeprecatedUpdateTransformRequest)) (*Response, error) // DataFrameTransformDeprecatedUpdateTransformRequest configures the Data Frame Transform Deprecated Update Transform API request. +// type DataFrameTransformDeprecatedUpdateTransformRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type DataFrameTransformDeprecatedUpdateTransformRequest struct { } // Do executes the request and returns response or error. +// func (r DataFrameTransformDeprecatedUpdateTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -119,6 +122,10 @@ func (r DataFrameTransformDeprecatedUpdateTransformRequest) Do(ctx context.Conte 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 @@ -131,10 +138,6 @@ func (r DataFrameTransformDeprecatedUpdateTransformRequest) Do(ctx context.Conte } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -154,6 +157,7 @@ func (r DataFrameTransformDeprecatedUpdateTransformRequest) Do(ctx context.Conte } // WithContext sets the request context. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithContext(v context.Conte } // WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithDeferValidation(v bool) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { r.DeferValidation = &v @@ -168,6 +173,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithDeferValidation(v bool) } // WithPretty makes the response body pretty-printed. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithPretty() func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { r.Pretty = true @@ -175,6 +181,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithPretty() func(*DataFram } // WithHuman makes statistical values human-readable. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithHuman() func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { r.Human = true @@ -182,6 +189,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithHuman() func(*DataFrame } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { r.ErrorTrace = true @@ -189,6 +197,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithErrorTrace() func(*Data } // WithFilterPath filters the properties of the response body. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { r.FilterPath = v @@ -196,6 +205,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithFilterPath(v ...string) } // WithHeader adds the headers to the HTTP request. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { if r.Header == nil { @@ -208,6 +218,7 @@ func (f DataFrameTransformDeprecatedUpdateTransform) WithHeader(h map[string]str } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f DataFrameTransformDeprecatedUpdateTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.delete_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.delete_policy.go index 931ea8acf24..29cc8e1ce9a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.delete_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.delete_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newEnrichDeletePolicyFunc(t Transport) EnrichDeletePolicy { // EnrichDeletePolicy - Deletes an existing enrich policy and its enrich index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html. +// type EnrichDeletePolicy func(name string, o ...func(*EnrichDeletePolicyRequest)) (*Response, error) // EnrichDeletePolicyRequest configures the Enrich Delete Policy API request. +// type EnrichDeletePolicyRequest struct { Name string @@ -57,6 +59,7 @@ type EnrichDeletePolicyRequest struct { } // Do executes the request and returns response or error. +// func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f EnrichDeletePolicy) WithContext(v context.Context) func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f EnrichDeletePolicy) WithContext(v context.Context) func(*EnrichDeletePol } // WithPretty makes the response body pretty-printed. +// func (f EnrichDeletePolicy) WithPretty() func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f EnrichDeletePolicy) WithPretty() func(*EnrichDeletePolicyRequest) { } // WithHuman makes statistical values human-readable. +// func (f EnrichDeletePolicy) WithHuman() func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f EnrichDeletePolicy) WithHuman() func(*EnrichDeletePolicyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EnrichDeletePolicy) WithErrorTrace() func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f EnrichDeletePolicy) WithErrorTrace() func(*EnrichDeletePolicyRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EnrichDeletePolicy) WithFilterPath(v ...string) func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f EnrichDeletePolicy) WithFilterPath(v ...string) func(*EnrichDeletePolicy } // WithHeader adds the headers to the HTTP request. +// func (f EnrichDeletePolicy) WithHeader(h map[string]string) func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f EnrichDeletePolicy) WithHeader(h map[string]string) func(*EnrichDeletePo } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EnrichDeletePolicy) WithOpaqueID(s string) func(*EnrichDeletePolicyRequest) { return func(r *EnrichDeletePolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.execute_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.execute_policy.go index 9995cdb819a..8ef1b453e59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.execute_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.execute_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newEnrichExecutePolicyFunc(t Transport) EnrichExecutePolicy { // EnrichExecutePolicy - Creates the enrich index for an existing enrich policy. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html. +// type EnrichExecutePolicy func(name string, o ...func(*EnrichExecutePolicyRequest)) (*Response, error) // EnrichExecutePolicyRequest configures the Enrich Execute Policy API request. +// type EnrichExecutePolicyRequest struct { Name string @@ -60,6 +62,7 @@ type EnrichExecutePolicyRequest struct { } // Do executes the request and returns response or error. +// func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -145,6 +148,7 @@ func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f EnrichExecutePolicy) WithContext(v context.Context) func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f EnrichExecutePolicy) WithContext(v context.Context) func(*EnrichExecuteP } // WithWaitForCompletion - should the request should block until the execution is complete.. +// func (f EnrichExecutePolicy) WithWaitForCompletion(v bool) func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { r.WaitForCompletion = &v @@ -159,6 +164,7 @@ func (f EnrichExecutePolicy) WithWaitForCompletion(v bool) func(*EnrichExecutePo } // WithPretty makes the response body pretty-printed. +// func (f EnrichExecutePolicy) WithPretty() func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f EnrichExecutePolicy) WithPretty() func(*EnrichExecutePolicyRequest) { } // WithHuman makes statistical values human-readable. +// func (f EnrichExecutePolicy) WithHuman() func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f EnrichExecutePolicy) WithHuman() func(*EnrichExecutePolicyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EnrichExecutePolicy) WithErrorTrace() func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f EnrichExecutePolicy) WithErrorTrace() func(*EnrichExecutePolicyRequest) } // WithFilterPath filters the properties of the response body. +// func (f EnrichExecutePolicy) WithFilterPath(v ...string) func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f EnrichExecutePolicy) WithFilterPath(v ...string) func(*EnrichExecutePoli } // WithHeader adds the headers to the HTTP request. +// func (f EnrichExecutePolicy) WithHeader(h map[string]string) func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f EnrichExecutePolicy) WithHeader(h map[string]string) func(*EnrichExecute } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EnrichExecutePolicy) WithOpaqueID(s string) func(*EnrichExecutePolicyRequest) { return func(r *EnrichExecutePolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.get_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.get_policy.go index f13805e91cd..1c704b56d55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.get_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.get_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newEnrichGetPolicyFunc(t Transport) EnrichGetPolicy { // EnrichGetPolicy - Gets information about an enrich policy. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html. +// type EnrichGetPolicy func(o ...func(*EnrichGetPolicyRequest)) (*Response, error) // EnrichGetPolicyRequest configures the Enrich Get Policy API request. +// type EnrichGetPolicyRequest struct { Name []string @@ -57,6 +59,7 @@ type EnrichGetPolicyRequest struct { } // Do executes the request and returns response or error. +// func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f EnrichGetPolicy) WithContext(v context.Context) func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f EnrichGetPolicy) WithContext(v context.Context) func(*EnrichGetPolicyReq } // WithName - a list of enrich policy names. +// func (f EnrichGetPolicy) WithName(v ...string) func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { r.Name = v @@ -152,6 +157,7 @@ func (f EnrichGetPolicy) WithName(v ...string) func(*EnrichGetPolicyRequest) { } // WithPretty makes the response body pretty-printed. +// func (f EnrichGetPolicy) WithPretty() func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f EnrichGetPolicy) WithPretty() func(*EnrichGetPolicyRequest) { } // WithHuman makes statistical values human-readable. +// func (f EnrichGetPolicy) WithHuman() func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f EnrichGetPolicy) WithHuman() func(*EnrichGetPolicyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EnrichGetPolicy) WithErrorTrace() func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f EnrichGetPolicy) WithErrorTrace() func(*EnrichGetPolicyRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EnrichGetPolicy) WithFilterPath(v ...string) func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f EnrichGetPolicy) WithFilterPath(v ...string) func(*EnrichGetPolicyReques } // WithHeader adds the headers to the HTTP request. +// func (f EnrichGetPolicy) WithHeader(h map[string]string) func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f EnrichGetPolicy) WithHeader(h map[string]string) func(*EnrichGetPolicyRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EnrichGetPolicy) WithOpaqueID(s string) func(*EnrichGetPolicyRequest) { return func(r *EnrichGetPolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.put_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.put_policy.go index a82982fb478..f64be359145 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.put_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.put_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newEnrichPutPolicyFunc(t Transport) EnrichPutPolicy { // EnrichPutPolicy - Creates a new enrich policy. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html. +// type EnrichPutPolicy func(name string, body io.Reader, o ...func(*EnrichPutPolicyRequest)) (*Response, error) // EnrichPutPolicyRequest configures the Enrich Put Policy API request. +// type EnrichPutPolicyRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type EnrichPutPolicyRequest struct { } // Do executes the request and returns response or error. +// func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -120,10 +127,6 @@ func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f EnrichPutPolicy) WithContext(v context.Context) func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f EnrichPutPolicy) WithContext(v context.Context) func(*EnrichPutPolicyReq } // WithPretty makes the response body pretty-printed. +// func (f EnrichPutPolicy) WithPretty() func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f EnrichPutPolicy) WithPretty() func(*EnrichPutPolicyRequest) { } // WithHuman makes statistical values human-readable. +// func (f EnrichPutPolicy) WithHuman() func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f EnrichPutPolicy) WithHuman() func(*EnrichPutPolicyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EnrichPutPolicy) WithErrorTrace() func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f EnrichPutPolicy) WithErrorTrace() func(*EnrichPutPolicyRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EnrichPutPolicy) WithFilterPath(v ...string) func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f EnrichPutPolicy) WithFilterPath(v ...string) func(*EnrichPutPolicyReques } // WithHeader adds the headers to the HTTP request. +// func (f EnrichPutPolicy) WithHeader(h map[string]string) func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f EnrichPutPolicy) WithHeader(h map[string]string) func(*EnrichPutPolicyRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EnrichPutPolicy) WithOpaqueID(s string) func(*EnrichPutPolicyRequest) { return func(r *EnrichPutPolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.stats.go index 1ae8c7cc1a7..8964f8f0132 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.enrich.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newEnrichStatsFunc(t Transport) EnrichStats { // EnrichStats - Gets enrich coordinator statistics and information about enrich policies that are currently executing. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html. +// type EnrichStats func(o ...func(*EnrichStatsRequest)) (*Response, error) // EnrichStatsRequest configures the Enrich Stats API request. +// type EnrichStatsRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type EnrichStatsRequest struct { } // Do executes the request and returns response or error. +// func (r EnrichStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r EnrichStatsRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f EnrichStats) WithContext(v context.Context) func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f EnrichStats) WithContext(v context.Context) func(*EnrichStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f EnrichStats) WithPretty() func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f EnrichStats) WithPretty() func(*EnrichStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f EnrichStats) WithHuman() func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f EnrichStats) WithHuman() func(*EnrichStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EnrichStats) WithErrorTrace() func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f EnrichStats) WithErrorTrace() func(*EnrichStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EnrichStats) WithFilterPath(v ...string) func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f EnrichStats) WithFilterPath(v ...string) func(*EnrichStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f EnrichStats) WithHeader(h map[string]string) func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f EnrichStats) WithHeader(h map[string]string) func(*EnrichStatsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EnrichStats) WithOpaqueID(s string) func(*EnrichStatsRequest) { return func(r *EnrichStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.delete.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.delete.go index ccc2257ac52..1051b889ac9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newEqlDeleteFunc(t Transport) EqlDelete { // EqlDelete - Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// type EqlDelete func(id string, o ...func(*EqlDeleteRequest)) (*Response, error) // EqlDeleteRequest configures the Eql Delete API request. +// type EqlDeleteRequest struct { DocumentID string @@ -57,6 +59,7 @@ type EqlDeleteRequest struct { } // Do executes the request and returns response or error. +// func (r EqlDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r EqlDeleteRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f EqlDelete) WithContext(v context.Context) func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f EqlDelete) WithContext(v context.Context) func(*EqlDeleteRequest) { } // WithPretty makes the response body pretty-printed. +// func (f EqlDelete) WithPretty() func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f EqlDelete) WithPretty() func(*EqlDeleteRequest) { } // WithHuman makes statistical values human-readable. +// func (f EqlDelete) WithHuman() func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f EqlDelete) WithHuman() func(*EqlDeleteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EqlDelete) WithErrorTrace() func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f EqlDelete) WithErrorTrace() func(*EqlDeleteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EqlDelete) WithFilterPath(v ...string) func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f EqlDelete) WithFilterPath(v ...string) func(*EqlDeleteRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f EqlDelete) WithHeader(h map[string]string) func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f EqlDelete) WithHeader(h map[string]string) func(*EqlDeleteRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EqlDelete) WithOpaqueID(s string) func(*EqlDeleteRequest) { return func(r *EqlDeleteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get.go index 98f01bd9576..2413640729a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newEqlGetFunc(t Transport) EqlGet { // EqlGet - Returns async results from previously executed Event Query Language (EQL) search // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// type EqlGet func(id string, o ...func(*EqlGetRequest)) (*Response, error) // EqlGetRequest configures the Eql Get API request. +// type EqlGetRequest struct { DocumentID string @@ -61,6 +63,7 @@ type EqlGetRequest struct { } // Do executes the request and returns response or error. +// func (r EqlGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r EqlGetRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f EqlGet) WithContext(v context.Context) func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f EqlGet) WithContext(v context.Context) func(*EqlGetRequest) { } // WithKeepAlive - update the time interval in which the results (partial or final) for this search will be available. +// func (f EqlGet) WithKeepAlive(v time.Duration) func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.KeepAlive = v @@ -162,6 +167,7 @@ func (f EqlGet) WithKeepAlive(v time.Duration) func(*EqlGetRequest) { } // WithWaitForCompletionTimeout - specify the time that the request should block waiting for the final response. +// func (f EqlGet) WithWaitForCompletionTimeout(v time.Duration) func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.WaitForCompletionTimeout = v @@ -169,6 +175,7 @@ func (f EqlGet) WithWaitForCompletionTimeout(v time.Duration) func(*EqlGetReques } // WithPretty makes the response body pretty-printed. +// func (f EqlGet) WithPretty() func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f EqlGet) WithPretty() func(*EqlGetRequest) { } // WithHuman makes statistical values human-readable. +// func (f EqlGet) WithHuman() func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f EqlGet) WithHuman() func(*EqlGetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EqlGet) WithErrorTrace() func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f EqlGet) WithErrorTrace() func(*EqlGetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EqlGet) WithFilterPath(v ...string) func(*EqlGetRequest) { return func(r *EqlGetRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f EqlGet) WithFilterPath(v ...string) func(*EqlGetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f EqlGet) WithHeader(h map[string]string) func(*EqlGetRequest) { return func(r *EqlGetRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f EqlGet) WithHeader(h map[string]string) func(*EqlGetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EqlGet) WithOpaqueID(s string) func(*EqlGetRequest) { return func(r *EqlGetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get_status.go index 5c97b9f6096..3fda3afd6e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.get_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newEqlGetStatusFunc(t Transport) EqlGetStatus { // EqlGetStatus - Returns the status of a previously submitted async or stored Event Query Language (EQL) search // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// type EqlGetStatus func(id string, o ...func(*EqlGetStatusRequest)) (*Response, error) // EqlGetStatusRequest configures the Eql Get Status API request. +// type EqlGetStatusRequest struct { DocumentID string @@ -57,6 +59,7 @@ type EqlGetStatusRequest struct { } // Do executes the request and returns response or error. +// func (r EqlGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r EqlGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f EqlGetStatus) WithContext(v context.Context) func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f EqlGetStatus) WithContext(v context.Context) func(*EqlGetStatusRequest) } // WithPretty makes the response body pretty-printed. +// func (f EqlGetStatus) WithPretty() func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f EqlGetStatus) WithPretty() func(*EqlGetStatusRequest) { } // WithHuman makes statistical values human-readable. +// func (f EqlGetStatus) WithHuman() func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f EqlGetStatus) WithHuman() func(*EqlGetStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EqlGetStatus) WithErrorTrace() func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f EqlGetStatus) WithErrorTrace() func(*EqlGetStatusRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EqlGetStatus) WithFilterPath(v ...string) func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f EqlGetStatus) WithFilterPath(v ...string) func(*EqlGetStatusRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f EqlGetStatus) WithHeader(h map[string]string) func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f EqlGetStatus) WithHeader(h map[string]string) func(*EqlGetStatusRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EqlGetStatus) WithOpaqueID(s string) func(*EqlGetStatusRequest) { return func(r *EqlGetStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.search.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.search.go index 375631fb06c..3a90f90ef00 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.eql.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newEqlSearchFunc(t Transport) EqlSearch { // EqlSearch - Returns results matching a query expressed in Event Query Language (EQL) // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// type EqlSearch func(index string, body io.Reader, o ...func(*EqlSearchRequest)) (*Response, error) // EqlSearchRequest configures the Eql Search API request. +// type EqlSearchRequest struct { Index string @@ -66,6 +68,7 @@ type EqlSearchRequest struct { } // Do executes the request and returns response or error. +// func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -126,6 +129,10 @@ func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -138,10 +145,6 @@ func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -161,6 +164,7 @@ func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f EqlSearch) WithContext(v context.Context) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.ctx = v @@ -168,6 +172,7 @@ func (f EqlSearch) WithContext(v context.Context) func(*EqlSearchRequest) { } // WithKeepAlive - update the time interval in which the results (partial or final) for this search will be available. +// func (f EqlSearch) WithKeepAlive(v time.Duration) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.KeepAlive = v @@ -175,6 +180,7 @@ func (f EqlSearch) WithKeepAlive(v time.Duration) func(*EqlSearchRequest) { } // WithKeepOnCompletion - control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false). +// func (f EqlSearch) WithKeepOnCompletion(v bool) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.KeepOnCompletion = &v @@ -182,6 +188,7 @@ func (f EqlSearch) WithKeepOnCompletion(v bool) func(*EqlSearchRequest) { } // WithWaitForCompletionTimeout - specify the time that the request should block waiting for the final response. +// func (f EqlSearch) WithWaitForCompletionTimeout(v time.Duration) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.WaitForCompletionTimeout = v @@ -189,6 +196,7 @@ func (f EqlSearch) WithWaitForCompletionTimeout(v time.Duration) func(*EqlSearch } // WithPretty makes the response body pretty-printed. +// func (f EqlSearch) WithPretty() func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.Pretty = true @@ -196,6 +204,7 @@ func (f EqlSearch) WithPretty() func(*EqlSearchRequest) { } // WithHuman makes statistical values human-readable. +// func (f EqlSearch) WithHuman() func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.Human = true @@ -203,6 +212,7 @@ func (f EqlSearch) WithHuman() func(*EqlSearchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f EqlSearch) WithErrorTrace() func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.ErrorTrace = true @@ -210,6 +220,7 @@ func (f EqlSearch) WithErrorTrace() func(*EqlSearchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f EqlSearch) WithFilterPath(v ...string) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.FilterPath = v @@ -217,6 +228,7 @@ func (f EqlSearch) WithFilterPath(v ...string) func(*EqlSearchRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f EqlSearch) WithHeader(h map[string]string) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { if r.Header == nil { @@ -229,6 +241,7 @@ func (f EqlSearch) WithHeader(h map[string]string) func(*EqlSearchRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f EqlSearch) WithOpaqueID(s string) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.graph.explore.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.graph.explore.go index b466f411211..1d6120608e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.graph.explore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.graph.explore.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newGraphExploreFunc(t Transport) GraphExplore { // GraphExplore - Explore extracted and summarized information about the documents and terms in an index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html. +// type GraphExplore func(index []string, o ...func(*GraphExploreRequest)) (*Response, error) // GraphExploreRequest configures the Graph Explore API request. +// type GraphExploreRequest struct { Index []string DocumentType []string @@ -66,6 +68,7 @@ type GraphExploreRequest struct { } // Do executes the request and returns response or error. +// func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -142,10 +149,6 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f GraphExplore) WithContext(v context.Context) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f GraphExplore) WithContext(v context.Context) func(*GraphExploreRequest) } // WithBody - Graph Query DSL. +// func (f GraphExplore) WithBody(v io.Reader) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.Body = v @@ -179,6 +184,7 @@ func (f GraphExplore) WithBody(v io.Reader) func(*GraphExploreRequest) { } // WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// func (f GraphExplore) WithDocumentType(v ...string) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.DocumentType = v @@ -186,6 +192,7 @@ func (f GraphExplore) WithDocumentType(v ...string) func(*GraphExploreRequest) { } // WithRouting - specific routing value. +// func (f GraphExplore) WithRouting(v string) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.Routing = v @@ -193,6 +200,7 @@ func (f GraphExplore) WithRouting(v string) func(*GraphExploreRequest) { } // WithTimeout - explicit operation timeout. +// func (f GraphExplore) WithTimeout(v time.Duration) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.Timeout = v @@ -200,6 +208,7 @@ func (f GraphExplore) WithTimeout(v time.Duration) func(*GraphExploreRequest) { } // WithPretty makes the response body pretty-printed. +// func (f GraphExplore) WithPretty() func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.Pretty = true @@ -207,6 +216,7 @@ func (f GraphExplore) WithPretty() func(*GraphExploreRequest) { } // WithHuman makes statistical values human-readable. +// func (f GraphExplore) WithHuman() func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.Human = true @@ -214,6 +224,7 @@ func (f GraphExplore) WithHuman() func(*GraphExploreRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f GraphExplore) WithErrorTrace() func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.ErrorTrace = true @@ -221,6 +232,7 @@ func (f GraphExplore) WithErrorTrace() func(*GraphExploreRequest) { } // WithFilterPath filters the properties of the response body. +// func (f GraphExplore) WithFilterPath(v ...string) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.FilterPath = v @@ -228,6 +240,7 @@ func (f GraphExplore) WithFilterPath(v ...string) func(*GraphExploreRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f GraphExplore) WithHeader(h map[string]string) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { if r.Header == nil { @@ -240,6 +253,7 @@ func (f GraphExplore) WithHeader(h map[string]string) func(*GraphExploreRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f GraphExplore) WithOpaqueID(s string) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.delete_lifecycle.go index 5f9b16116a4..bc0b3704f57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.delete_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { // ILMDeleteLifecycle - Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html. +// type ILMDeleteLifecycle func(policy string, o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) // ILMDeleteLifecycleRequest configures the ILM Delete Lifecycle API request. +// type ILMDeleteLifecycleRequest struct { Policy string @@ -57,6 +59,7 @@ type ILMDeleteLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f ILMDeleteLifecycle) WithContext(v context.Context) func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f ILMDeleteLifecycle) WithContext(v context.Context) func(*ILMDeleteLifecy } // WithPretty makes the response body pretty-printed. +// func (f ILMDeleteLifecycle) WithPretty() func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f ILMDeleteLifecycle) WithPretty() func(*ILMDeleteLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMDeleteLifecycle) WithHuman() func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f ILMDeleteLifecycle) WithHuman() func(*ILMDeleteLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMDeleteLifecycle) WithErrorTrace() func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f ILMDeleteLifecycle) WithErrorTrace() func(*ILMDeleteLifecycleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMDeleteLifecycle) WithFilterPath(v ...string) func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f ILMDeleteLifecycle) WithFilterPath(v ...string) func(*ILMDeleteLifecycle } // WithHeader adds the headers to the HTTP request. +// func (f ILMDeleteLifecycle) WithHeader(h map[string]string) func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f ILMDeleteLifecycle) WithHeader(h map[string]string) func(*ILMDeleteLifec } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMDeleteLifecycle) WithOpaqueID(s string) func(*ILMDeleteLifecycleRequest) { return func(r *ILMDeleteLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.explain_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.explain_lifecycle.go index eae7de98050..6340a425dbf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.explain_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { // ILMExplainLifecycle - Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html. +// type ILMExplainLifecycle func(index string, o ...func(*ILMExplainLifecycleRequest)) (*Response, error) // ILMExplainLifecycleRequest configures the ILM Explain Lifecycle API request. +// type ILMExplainLifecycleRequest struct { Index string @@ -61,6 +63,7 @@ type ILMExplainLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f ILMExplainLifecycle) WithContext(v context.Context) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f ILMExplainLifecycle) WithContext(v context.Context) func(*ILMExplainLife } // WithOnlyErrors - filters the indices included in the response to ones in an ilm error state, implies only_managed. +// func (f ILMExplainLifecycle) WithOnlyErrors(v bool) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.OnlyErrors = &v @@ -162,6 +167,7 @@ func (f ILMExplainLifecycle) WithOnlyErrors(v bool) func(*ILMExplainLifecycleReq } // WithOnlyManaged - filters the indices included in the response to ones managed by ilm. +// func (f ILMExplainLifecycle) WithOnlyManaged(v bool) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.OnlyManaged = &v @@ -169,6 +175,7 @@ func (f ILMExplainLifecycle) WithOnlyManaged(v bool) func(*ILMExplainLifecycleRe } // WithPretty makes the response body pretty-printed. +// func (f ILMExplainLifecycle) WithPretty() func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f ILMExplainLifecycle) WithPretty() func(*ILMExplainLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMExplainLifecycle) WithHuman() func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f ILMExplainLifecycle) WithHuman() func(*ILMExplainLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMExplainLifecycle) WithErrorTrace() func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f ILMExplainLifecycle) WithErrorTrace() func(*ILMExplainLifecycleRequest) } // WithFilterPath filters the properties of the response body. +// func (f ILMExplainLifecycle) WithFilterPath(v ...string) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f ILMExplainLifecycle) WithFilterPath(v ...string) func(*ILMExplainLifecyc } // WithHeader adds the headers to the HTTP request. +// func (f ILMExplainLifecycle) WithHeader(h map[string]string) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f ILMExplainLifecycle) WithHeader(h map[string]string) func(*ILMExplainLif } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMExplainLifecycle) WithOpaqueID(s string) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_lifecycle.go index 61c3be6fff1..b5fabbb599f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMGetLifecycleFunc(t Transport) ILMGetLifecycle { // ILMGetLifecycle - Returns the specified policy definition. Includes the policy version and last modified date. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html. +// type ILMGetLifecycle func(o ...func(*ILMGetLifecycleRequest)) (*Response, error) // ILMGetLifecycleRequest configures the ILM Get Lifecycle API request. +// type ILMGetLifecycleRequest struct { Policy string @@ -57,6 +59,7 @@ type ILMGetLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f ILMGetLifecycle) WithContext(v context.Context) func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f ILMGetLifecycle) WithContext(v context.Context) func(*ILMGetLifecycleReq } // WithPolicy - the name of the index lifecycle policy. +// func (f ILMGetLifecycle) WithPolicy(v string) func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { r.Policy = v @@ -152,6 +157,7 @@ func (f ILMGetLifecycle) WithPolicy(v string) func(*ILMGetLifecycleRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ILMGetLifecycle) WithPretty() func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f ILMGetLifecycle) WithPretty() func(*ILMGetLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMGetLifecycle) WithHuman() func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f ILMGetLifecycle) WithHuman() func(*ILMGetLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMGetLifecycle) WithErrorTrace() func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f ILMGetLifecycle) WithErrorTrace() func(*ILMGetLifecycleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMGetLifecycle) WithFilterPath(v ...string) func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f ILMGetLifecycle) WithFilterPath(v ...string) func(*ILMGetLifecycleReques } // WithHeader adds the headers to the HTTP request. +// func (f ILMGetLifecycle) WithHeader(h map[string]string) func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f ILMGetLifecycle) WithHeader(h map[string]string) func(*ILMGetLifecycleRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMGetLifecycle) WithOpaqueID(s string) func(*ILMGetLifecycleRequest) { return func(r *ILMGetLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_status.go index a8a443de62b..2f6f5861734 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.get_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMGetStatusFunc(t Transport) ILMGetStatus { // ILMGetStatus - Retrieves the current index lifecycle management (ILM) status. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html. +// type ILMGetStatus func(o ...func(*ILMGetStatusRequest)) (*Response, error) // ILMGetStatusRequest configures the ILM Get Status API request. +// type ILMGetStatusRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type ILMGetStatusRequest struct { } // Do executes the request and returns response or error. +// func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f ILMGetStatus) WithContext(v context.Context) func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f ILMGetStatus) WithContext(v context.Context) func(*ILMGetStatusRequest) } // WithPretty makes the response body pretty-printed. +// func (f ILMGetStatus) WithPretty() func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f ILMGetStatus) WithPretty() func(*ILMGetStatusRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMGetStatus) WithHuman() func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f ILMGetStatus) WithHuman() func(*ILMGetStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMGetStatus) WithErrorTrace() func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f ILMGetStatus) WithErrorTrace() func(*ILMGetStatusRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMGetStatus) WithFilterPath(v ...string) func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f ILMGetStatus) WithFilterPath(v ...string) func(*ILMGetStatusRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ILMGetStatus) WithHeader(h map[string]string) func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f ILMGetStatus) WithHeader(h map[string]string) func(*ILMGetStatusRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMGetStatus) WithOpaqueID(s string) func(*ILMGetStatusRequest) { return func(r *ILMGetStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.migrate_to_data_tiers.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.migrate_to_data_tiers.go index 328075f6b7c..0e35d0fe688 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.migrate_to_data_tiers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.migrate_to_data_tiers.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newILMMigrateToDataTiersFunc(t Transport) ILMMigrateToDataTiers { // ILMMigrateToDataTiers - Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html. +// type ILMMigrateToDataTiers func(o ...func(*ILMMigrateToDataTiersRequest)) (*Response, error) // ILMMigrateToDataTiersRequest configures the ILM Migrate To Data Tiers API request. +// type ILMMigrateToDataTiersRequest struct { Body io.Reader @@ -61,6 +63,7 @@ type ILMMigrateToDataTiersRequest struct { } // Do executes the request and returns response or error. +// func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transpor 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 @@ -120,10 +127,6 @@ func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f ILMMigrateToDataTiers) WithContext(v context.Context) func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f ILMMigrateToDataTiers) WithContext(v context.Context) func(*ILMMigrateTo } // WithBody - Optionally specify a legacy index template name to delete and optionally specify a node attribute name used for index shard routing (defaults to "data"). +// func (f ILMMigrateToDataTiers) WithBody(v io.Reader) func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f ILMMigrateToDataTiers) WithBody(v io.Reader) func(*ILMMigrateToDataTiers } // WithDryRun - if set to true it will simulate the migration, providing a way to retrieve the ilm policies and indices that need to be migrated. the default is false. +// func (f ILMMigrateToDataTiers) WithDryRun(v bool) func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.DryRun = &v @@ -164,6 +170,7 @@ func (f ILMMigrateToDataTiers) WithDryRun(v bool) func(*ILMMigrateToDataTiersReq } // WithPretty makes the response body pretty-printed. +// func (f ILMMigrateToDataTiers) WithPretty() func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.Pretty = true @@ -171,6 +178,7 @@ func (f ILMMigrateToDataTiers) WithPretty() func(*ILMMigrateToDataTiersRequest) } // WithHuman makes statistical values human-readable. +// func (f ILMMigrateToDataTiers) WithHuman() func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.Human = true @@ -178,6 +186,7 @@ func (f ILMMigrateToDataTiers) WithHuman() func(*ILMMigrateToDataTiersRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMMigrateToDataTiers) WithErrorTrace() func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.ErrorTrace = true @@ -185,6 +194,7 @@ func (f ILMMigrateToDataTiers) WithErrorTrace() func(*ILMMigrateToDataTiersReque } // WithFilterPath filters the properties of the response body. +// func (f ILMMigrateToDataTiers) WithFilterPath(v ...string) func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { r.FilterPath = v @@ -192,6 +202,7 @@ func (f ILMMigrateToDataTiers) WithFilterPath(v ...string) func(*ILMMigrateToDat } // WithHeader adds the headers to the HTTP request. +// func (f ILMMigrateToDataTiers) WithHeader(h map[string]string) func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { if r.Header == nil { @@ -204,6 +215,7 @@ func (f ILMMigrateToDataTiers) WithHeader(h map[string]string) func(*ILMMigrateT } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMMigrateToDataTiers) WithOpaqueID(s string) func(*ILMMigrateToDataTiersRequest) { return func(r *ILMMigrateToDataTiersRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.move_to_step.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.move_to_step.go index 1ca8b424848..24e759f0334 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.move_to_step.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.move_to_step.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newILMMoveToStepFunc(t Transport) ILMMoveToStep { // ILMMoveToStep - Manually moves an index into the specified step and executes that step. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html. +// type ILMMoveToStep func(index string, o ...func(*ILMMoveToStepRequest)) (*Response, error) // ILMMoveToStepRequest configures the ILM Move To Step API request. +// type ILMMoveToStepRequest struct { Index string @@ -60,6 +62,7 @@ type ILMMoveToStepRequest struct { } // Do executes the request and returns response or error. +// func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -120,10 +127,6 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f ILMMoveToStep) WithContext(v context.Context) func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f ILMMoveToStep) WithContext(v context.Context) func(*ILMMoveToStepRequest } // WithBody - The new lifecycle step to move to. +// func (f ILMMoveToStep) WithBody(v io.Reader) func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f ILMMoveToStep) WithBody(v io.Reader) func(*ILMMoveToStepRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ILMMoveToStep) WithPretty() func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f ILMMoveToStep) WithPretty() func(*ILMMoveToStepRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMMoveToStep) WithHuman() func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f ILMMoveToStep) WithHuman() func(*ILMMoveToStepRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMMoveToStep) WithErrorTrace() func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f ILMMoveToStep) WithErrorTrace() func(*ILMMoveToStepRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMMoveToStep) WithFilterPath(v ...string) func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f ILMMoveToStep) WithFilterPath(v ...string) func(*ILMMoveToStepRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ILMMoveToStep) WithHeader(h map[string]string) func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f ILMMoveToStep) WithHeader(h map[string]string) func(*ILMMoveToStepReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMMoveToStep) WithOpaqueID(s string) func(*ILMMoveToStepRequest) { return func(r *ILMMoveToStepRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.put_lifecycle.go index 5c6c613b25b..e57b877489b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.put_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { // ILMPutLifecycle - Creates a lifecycle policy // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html. +// type ILMPutLifecycle func(policy string, o ...func(*ILMPutLifecycleRequest)) (*Response, error) // ILMPutLifecycleRequest configures the ILM Put Lifecycle API request. +// type ILMPutLifecycleRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type ILMPutLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -120,10 +127,6 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f ILMPutLifecycle) WithContext(v context.Context) func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f ILMPutLifecycle) WithContext(v context.Context) func(*ILMPutLifecycleReq } // WithBody - The lifecycle policy definition to register. +// func (f ILMPutLifecycle) WithBody(v io.Reader) func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f ILMPutLifecycle) WithBody(v io.Reader) func(*ILMPutLifecycleRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ILMPutLifecycle) WithPretty() func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f ILMPutLifecycle) WithPretty() func(*ILMPutLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMPutLifecycle) WithHuman() func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f ILMPutLifecycle) WithHuman() func(*ILMPutLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMPutLifecycle) WithErrorTrace() func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f ILMPutLifecycle) WithErrorTrace() func(*ILMPutLifecycleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMPutLifecycle) WithFilterPath(v ...string) func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f ILMPutLifecycle) WithFilterPath(v ...string) func(*ILMPutLifecycleReques } // WithHeader adds the headers to the HTTP request. +// func (f ILMPutLifecycle) WithHeader(h map[string]string) func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f ILMPutLifecycle) WithHeader(h map[string]string) func(*ILMPutLifecycleRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMPutLifecycle) WithOpaqueID(s string) func(*ILMPutLifecycleRequest) { return func(r *ILMPutLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.remove_policy.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.remove_policy.go index f814dc59f84..037c31f3dd9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.remove_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.remove_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { // ILMRemovePolicy - Removes the assigned lifecycle policy and stops managing the specified index // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html. +// type ILMRemovePolicy func(index string, o ...func(*ILMRemovePolicyRequest)) (*Response, error) // ILMRemovePolicyRequest configures the ILM Remove Policy API request. +// type ILMRemovePolicyRequest struct { Index string @@ -57,6 +59,7 @@ type ILMRemovePolicyRequest struct { } // Do executes the request and returns response or error. +// func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f ILMRemovePolicy) WithContext(v context.Context) func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f ILMRemovePolicy) WithContext(v context.Context) func(*ILMRemovePolicyReq } // WithPretty makes the response body pretty-printed. +// func (f ILMRemovePolicy) WithPretty() func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f ILMRemovePolicy) WithPretty() func(*ILMRemovePolicyRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMRemovePolicy) WithHuman() func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f ILMRemovePolicy) WithHuman() func(*ILMRemovePolicyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMRemovePolicy) WithErrorTrace() func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f ILMRemovePolicy) WithErrorTrace() func(*ILMRemovePolicyRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMRemovePolicy) WithFilterPath(v ...string) func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f ILMRemovePolicy) WithFilterPath(v ...string) func(*ILMRemovePolicyReques } // WithHeader adds the headers to the HTTP request. +// func (f ILMRemovePolicy) WithHeader(h map[string]string) func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f ILMRemovePolicy) WithHeader(h map[string]string) func(*ILMRemovePolicyRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMRemovePolicy) WithOpaqueID(s string) func(*ILMRemovePolicyRequest) { return func(r *ILMRemovePolicyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.retry.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.retry.go index da440da681e..7684a97b1e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.retry.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.retry.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMRetryFunc(t Transport) ILMRetry { // ILMRetry - Retries executing the policy for an index that is in the ERROR step. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html. +// type ILMRetry func(index string, o ...func(*ILMRetryRequest)) (*Response, error) // ILMRetryRequest configures the ILM Retry API request. +// type ILMRetryRequest struct { Index string @@ -57,6 +59,7 @@ type ILMRetryRequest struct { } // Do executes the request and returns response or error. +// func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f ILMRetry) WithContext(v context.Context) func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f ILMRetry) WithContext(v context.Context) func(*ILMRetryRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ILMRetry) WithPretty() func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f ILMRetry) WithPretty() func(*ILMRetryRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMRetry) WithHuman() func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f ILMRetry) WithHuman() func(*ILMRetryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMRetry) WithErrorTrace() func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f ILMRetry) WithErrorTrace() func(*ILMRetryRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMRetry) WithFilterPath(v ...string) func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f ILMRetry) WithFilterPath(v ...string) func(*ILMRetryRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ILMRetry) WithHeader(h map[string]string) func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f ILMRetry) WithHeader(h map[string]string) func(*ILMRetryRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMRetry) WithOpaqueID(s string) func(*ILMRetryRequest) { return func(r *ILMRetryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.start.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.start.go index 08818f8fc7d..6327c2ae57b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.start.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMStartFunc(t Transport) ILMStart { // ILMStart - Start the index lifecycle management (ILM) plugin. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html. +// type ILMStart func(o ...func(*ILMStartRequest)) (*Response, error) // ILMStartRequest configures the ILM Start API request. +// type ILMStartRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type ILMStartRequest struct { } // Do executes the request and returns response or error. +// func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f ILMStart) WithContext(v context.Context) func(*ILMStartRequest) { return func(r *ILMStartRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f ILMStart) WithContext(v context.Context) func(*ILMStartRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ILMStart) WithPretty() func(*ILMStartRequest) { return func(r *ILMStartRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f ILMStart) WithPretty() func(*ILMStartRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMStart) WithHuman() func(*ILMStartRequest) { return func(r *ILMStartRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f ILMStart) WithHuman() func(*ILMStartRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMStart) WithErrorTrace() func(*ILMStartRequest) { return func(r *ILMStartRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f ILMStart) WithErrorTrace() func(*ILMStartRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMStart) WithFilterPath(v ...string) func(*ILMStartRequest) { return func(r *ILMStartRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f ILMStart) WithFilterPath(v ...string) func(*ILMStartRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ILMStart) WithHeader(h map[string]string) func(*ILMStartRequest) { return func(r *ILMStartRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f ILMStart) WithHeader(h map[string]string) func(*ILMStartRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMStart) WithOpaqueID(s string) func(*ILMStartRequest) { return func(r *ILMStartRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.stop.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.stop.go index ec49c3dc426..fe36037710f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ilm.stop.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newILMStopFunc(t Transport) ILMStop { // ILMStop - Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html. +// type ILMStop func(o ...func(*ILMStopRequest)) (*Response, error) // ILMStopRequest configures the ILM Stop API request. +// type ILMStopRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type ILMStopRequest struct { } // Do executes the request and returns response or error. +// func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f ILMStop) WithContext(v context.Context) func(*ILMStopRequest) { return func(r *ILMStopRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f ILMStop) WithContext(v context.Context) func(*ILMStopRequest) { } // WithPretty makes the response body pretty-printed. +// func (f ILMStop) WithPretty() func(*ILMStopRequest) { return func(r *ILMStopRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f ILMStop) WithPretty() func(*ILMStopRequest) { } // WithHuman makes statistical values human-readable. +// func (f ILMStop) WithHuman() func(*ILMStopRequest) { return func(r *ILMStopRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f ILMStop) WithHuman() func(*ILMStopRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f ILMStop) WithErrorTrace() func(*ILMStopRequest) { return func(r *ILMStopRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f ILMStop) WithErrorTrace() func(*ILMStopRequest) { } // WithFilterPath filters the properties of the response body. +// func (f ILMStop) WithFilterPath(v ...string) func(*ILMStopRequest) { return func(r *ILMStopRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f ILMStop) WithFilterPath(v ...string) func(*ILMStopRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f ILMStop) WithHeader(h map[string]string) func(*ILMStopRequest) { return func(r *ILMStopRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f ILMStop) WithHeader(h map[string]string) func(*ILMStopRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f ILMStop) WithOpaqueID(s string) func(*ILMStopRequest) { return func(r *ILMStopRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.create_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.create_data_stream.go index 3c550a0530e..4087b6a7473 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.create_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.create_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIndicesCreateDataStreamFunc(t Transport) IndicesCreateDataStream { // IndicesCreateDataStream - Creates a data stream // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesCreateDataStream func(name string, o ...func(*IndicesCreateDataStreamRequest)) (*Response, error) // IndicesCreateDataStreamRequest configures the Indices Create Data Stream API request. +// type IndicesCreateDataStreamRequest struct { Name string @@ -57,6 +59,7 @@ type IndicesCreateDataStreamRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -134,6 +137,7 @@ func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesCreateDataStream) WithContext(v context.Context) func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { r.ctx = v @@ -141,6 +145,7 @@ func (f IndicesCreateDataStream) WithContext(v context.Context) func(*IndicesCre } // WithPretty makes the response body pretty-printed. +// func (f IndicesCreateDataStream) WithPretty() func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { r.Pretty = true @@ -148,6 +153,7 @@ func (f IndicesCreateDataStream) WithPretty() func(*IndicesCreateDataStreamReque } // WithHuman makes statistical values human-readable. +// func (f IndicesCreateDataStream) WithHuman() func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { r.Human = true @@ -155,6 +161,7 @@ func (f IndicesCreateDataStream) WithHuman() func(*IndicesCreateDataStreamReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesCreateDataStream) WithErrorTrace() func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { r.ErrorTrace = true @@ -162,6 +169,7 @@ func (f IndicesCreateDataStream) WithErrorTrace() func(*IndicesCreateDataStreamR } // WithFilterPath filters the properties of the response body. +// func (f IndicesCreateDataStream) WithFilterPath(v ...string) func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { r.FilterPath = v @@ -169,6 +177,7 @@ func (f IndicesCreateDataStream) WithFilterPath(v ...string) func(*IndicesCreate } // WithHeader adds the headers to the HTTP request. +// func (f IndicesCreateDataStream) WithHeader(h map[string]string) func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { if r.Header == nil { @@ -181,6 +190,7 @@ func (f IndicesCreateDataStream) WithHeader(h map[string]string) func(*IndicesCr } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesCreateDataStream) WithOpaqueID(s string) func(*IndicesCreateDataStreamRequest) { return func(r *IndicesCreateDataStreamRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.data_streams_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.data_streams_stats.go index 3f74c6f8063..f43c4f791fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.data_streams_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.data_streams_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIndicesDataStreamsStatsFunc(t Transport) IndicesDataStreamsStats { // IndicesDataStreamsStats - Provides statistics on operations happening in a data stream. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesDataStreamsStats func(o ...func(*IndicesDataStreamsStatsRequest)) (*Response, error) // IndicesDataStreamsStatsRequest configures the Indices Data Streams Stats API request. +// type IndicesDataStreamsStatsRequest struct { Name []string @@ -57,6 +59,7 @@ type IndicesDataStreamsStatsRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDataStreamsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r IndicesDataStreamsStatsRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesDataStreamsStats) WithContext(v context.Context) func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f IndicesDataStreamsStats) WithContext(v context.Context) func(*IndicesDat } // WithName - a list of data stream names; use _all to perform the operation on all data streams. +// func (f IndicesDataStreamsStats) WithName(v ...string) func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { r.Name = v @@ -152,6 +157,7 @@ func (f IndicesDataStreamsStats) WithName(v ...string) func(*IndicesDataStreamsS } // WithPretty makes the response body pretty-printed. +// func (f IndicesDataStreamsStats) WithPretty() func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f IndicesDataStreamsStats) WithPretty() func(*IndicesDataStreamsStatsReque } // WithHuman makes statistical values human-readable. +// func (f IndicesDataStreamsStats) WithHuman() func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f IndicesDataStreamsStats) WithHuman() func(*IndicesDataStreamsStatsReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDataStreamsStats) WithErrorTrace() func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f IndicesDataStreamsStats) WithErrorTrace() func(*IndicesDataStreamsStatsR } // WithFilterPath filters the properties of the response body. +// func (f IndicesDataStreamsStats) WithFilterPath(v ...string) func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f IndicesDataStreamsStats) WithFilterPath(v ...string) func(*IndicesDataSt } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDataStreamsStats) WithHeader(h map[string]string) func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f IndicesDataStreamsStats) WithHeader(h map[string]string) func(*IndicesDa } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDataStreamsStats) WithOpaqueID(s string) func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.delete_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.delete_data_stream.go index 76dcf5d1b93..977896d9487 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.delete_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.delete_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newIndicesDeleteDataStreamFunc(t Transport) IndicesDeleteDataStream { // IndicesDeleteDataStream - Deletes a data stream. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesDeleteDataStream func(name []string, o ...func(*IndicesDeleteDataStreamRequest)) (*Response, error) // IndicesDeleteDataStreamRequest configures the Indices Delete Data Stream API request. +// type IndicesDeleteDataStreamRequest struct { Name []string @@ -60,6 +62,7 @@ type IndicesDeleteDataStreamRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesDeleteDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -145,6 +148,7 @@ func (r IndicesDeleteDataStreamRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f IndicesDeleteDataStream) WithContext(v context.Context) func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f IndicesDeleteDataStream) WithContext(v context.Context) func(*IndicesDel } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). +// func (f IndicesDeleteDataStream) WithExpandWildcards(v string) func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.ExpandWildcards = v @@ -159,6 +164,7 @@ func (f IndicesDeleteDataStream) WithExpandWildcards(v string) func(*IndicesDele } // WithPretty makes the response body pretty-printed. +// func (f IndicesDeleteDataStream) WithPretty() func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f IndicesDeleteDataStream) WithPretty() func(*IndicesDeleteDataStreamReque } // WithHuman makes statistical values human-readable. +// func (f IndicesDeleteDataStream) WithHuman() func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f IndicesDeleteDataStream) WithHuman() func(*IndicesDeleteDataStreamReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesDeleteDataStream) WithErrorTrace() func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f IndicesDeleteDataStream) WithErrorTrace() func(*IndicesDeleteDataStreamR } // WithFilterPath filters the properties of the response body. +// func (f IndicesDeleteDataStream) WithFilterPath(v ...string) func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f IndicesDeleteDataStream) WithFilterPath(v ...string) func(*IndicesDelete } // WithHeader adds the headers to the HTTP request. +// func (f IndicesDeleteDataStream) WithHeader(h map[string]string) func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f IndicesDeleteDataStream) WithHeader(h map[string]string) func(*IndicesDe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesDeleteDataStream) WithOpaqueID(s string) func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.freeze.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.freeze.go index f2afce62df8..cb6d42df212 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.freeze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.freeze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesFreezeFunc(t Transport) IndicesFreeze { // IndicesFreeze - Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html. +// type IndicesFreeze func(index string, o ...func(*IndicesFreezeRequest)) (*Response, error) // IndicesFreezeRequest configures the Indices Freeze API request. +// type IndicesFreezeRequest struct { Index string @@ -66,6 +68,7 @@ type IndicesFreezeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesFreezeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r IndicesFreezeRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f IndicesFreeze) WithContext(v context.Context) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f IndicesFreeze) WithContext(v context.Context) func(*IndicesFreezeRequest } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesFreeze) WithAllowNoIndices(v bool) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.AllowNoIndices = &v @@ -181,6 +186,7 @@ func (f IndicesFreeze) WithAllowNoIndices(v bool) func(*IndicesFreezeRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesFreeze) WithExpandWildcards(v string) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.ExpandWildcards = v @@ -188,6 +194,7 @@ func (f IndicesFreeze) WithExpandWildcards(v string) func(*IndicesFreezeRequest) } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesFreeze) WithIgnoreUnavailable(v bool) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.IgnoreUnavailable = &v @@ -195,6 +202,7 @@ func (f IndicesFreeze) WithIgnoreUnavailable(v bool) func(*IndicesFreezeRequest) } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesFreeze) WithMasterTimeout(v time.Duration) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.MasterTimeout = v @@ -202,6 +210,7 @@ func (f IndicesFreeze) WithMasterTimeout(v time.Duration) func(*IndicesFreezeReq } // WithTimeout - explicit operation timeout. +// func (f IndicesFreeze) WithTimeout(v time.Duration) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.Timeout = v @@ -209,6 +218,7 @@ func (f IndicesFreeze) WithTimeout(v time.Duration) func(*IndicesFreezeRequest) } // WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns.. +// func (f IndicesFreeze) WithWaitForActiveShards(v string) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.WaitForActiveShards = v @@ -216,6 +226,7 @@ func (f IndicesFreeze) WithWaitForActiveShards(v string) func(*IndicesFreezeRequ } // WithPretty makes the response body pretty-printed. +// func (f IndicesFreeze) WithPretty() func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.Pretty = true @@ -223,6 +234,7 @@ func (f IndicesFreeze) WithPretty() func(*IndicesFreezeRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesFreeze) WithHuman() func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.Human = true @@ -230,6 +242,7 @@ func (f IndicesFreeze) WithHuman() func(*IndicesFreezeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesFreeze) WithErrorTrace() func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.ErrorTrace = true @@ -237,6 +250,7 @@ func (f IndicesFreeze) WithErrorTrace() func(*IndicesFreezeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesFreeze) WithFilterPath(v ...string) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { r.FilterPath = v @@ -244,6 +258,7 @@ func (f IndicesFreeze) WithFilterPath(v ...string) func(*IndicesFreezeRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f IndicesFreeze) WithHeader(h map[string]string) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { if r.Header == nil { @@ -256,6 +271,7 @@ func (f IndicesFreeze) WithHeader(h map[string]string) func(*IndicesFreezeReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesFreeze) WithOpaqueID(s string) func(*IndicesFreezeRequest) { return func(r *IndicesFreezeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.get_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.get_data_stream.go index 8e761b8a314..34da796a40c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.get_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.get_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIndicesGetDataStreamFunc(t Transport) IndicesGetDataStream { // IndicesGetDataStream - Returns data streams. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesGetDataStream func(o ...func(*IndicesGetDataStreamRequest)) (*Response, error) // IndicesGetDataStreamRequest configures the Indices Get Data Stream API request. +// type IndicesGetDataStreamRequest struct { Name []string @@ -59,6 +61,7 @@ type IndicesGetDataStreamRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesGetDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r IndicesGetDataStreamRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f IndicesGetDataStream) WithContext(v context.Context) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f IndicesGetDataStream) WithContext(v context.Context) func(*IndicesGetDat } // WithName - a list of data streams to get; use `*` to get all data streams. +// func (f IndicesGetDataStream) WithName(v ...string) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.Name = v @@ -156,6 +161,7 @@ func (f IndicesGetDataStream) WithName(v ...string) func(*IndicesGetDataStreamRe } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). +// func (f IndicesGetDataStream) WithExpandWildcards(v string) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.ExpandWildcards = v @@ -163,6 +169,7 @@ func (f IndicesGetDataStream) WithExpandWildcards(v string) func(*IndicesGetData } // WithPretty makes the response body pretty-printed. +// func (f IndicesGetDataStream) WithPretty() func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.Pretty = true @@ -170,6 +177,7 @@ func (f IndicesGetDataStream) WithPretty() func(*IndicesGetDataStreamRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesGetDataStream) WithHuman() func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.Human = true @@ -177,6 +185,7 @@ func (f IndicesGetDataStream) WithHuman() func(*IndicesGetDataStreamRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesGetDataStream) WithErrorTrace() func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.ErrorTrace = true @@ -184,6 +193,7 @@ func (f IndicesGetDataStream) WithErrorTrace() func(*IndicesGetDataStreamRequest } // WithFilterPath filters the properties of the response body. +// func (f IndicesGetDataStream) WithFilterPath(v ...string) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.FilterPath = v @@ -191,6 +201,7 @@ func (f IndicesGetDataStream) WithFilterPath(v ...string) func(*IndicesGetDataSt } // WithHeader adds the headers to the HTTP request. +// func (f IndicesGetDataStream) WithHeader(h map[string]string) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { if r.Header == nil { @@ -203,6 +214,7 @@ func (f IndicesGetDataStream) WithHeader(h map[string]string) func(*IndicesGetDa } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesGetDataStream) WithOpaqueID(s string) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.migrate_to_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.migrate_to_data_stream.go index 2d7735d98a2..d3aa41a00e8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.migrate_to_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.migrate_to_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIndicesMigrateToDataStreamFunc(t Transport) IndicesMigrateToDataStream { // IndicesMigrateToDataStream - Migrates an alias to a data stream // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesMigrateToDataStream func(name string, o ...func(*IndicesMigrateToDataStreamRequest)) (*Response, error) // IndicesMigrateToDataStreamRequest configures the Indices Migrate To Data Stream API request. +// type IndicesMigrateToDataStreamRequest struct { Name string @@ -57,6 +59,7 @@ type IndicesMigrateToDataStreamRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesMigrateToDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r IndicesMigrateToDataStreamRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f IndicesMigrateToDataStream) WithContext(v context.Context) func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f IndicesMigrateToDataStream) WithContext(v context.Context) func(*Indices } // WithPretty makes the response body pretty-printed. +// func (f IndicesMigrateToDataStream) WithPretty() func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f IndicesMigrateToDataStream) WithPretty() func(*IndicesMigrateToDataStrea } // WithHuman makes statistical values human-readable. +// func (f IndicesMigrateToDataStream) WithHuman() func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f IndicesMigrateToDataStream) WithHuman() func(*IndicesMigrateToDataStream } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesMigrateToDataStream) WithErrorTrace() func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f IndicesMigrateToDataStream) WithErrorTrace() func(*IndicesMigrateToDataS } // WithFilterPath filters the properties of the response body. +// func (f IndicesMigrateToDataStream) WithFilterPath(v ...string) func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f IndicesMigrateToDataStream) WithFilterPath(v ...string) func(*IndicesMig } // WithHeader adds the headers to the HTTP request. +// func (f IndicesMigrateToDataStream) WithHeader(h map[string]string) func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f IndicesMigrateToDataStream) WithHeader(h map[string]string) func(*Indice } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesMigrateToDataStream) WithOpaqueID(s string) func(*IndicesMigrateToDataStreamRequest) { return func(r *IndicesMigrateToDataStreamRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.promote_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.promote_data_stream.go index 96213595156..d83c09895d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.promote_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.promote_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newIndicesPromoteDataStreamFunc(t Transport) IndicesPromoteDataStream { // IndicesPromoteDataStream - Promotes a data stream from a replicated data stream managed by CCR to a regular data stream // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// type IndicesPromoteDataStream func(name string, o ...func(*IndicesPromoteDataStreamRequest)) (*Response, error) // IndicesPromoteDataStreamRequest configures the Indices Promote Data Stream API request. +// type IndicesPromoteDataStreamRequest struct { Name string @@ -57,6 +59,7 @@ type IndicesPromoteDataStreamRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesPromoteDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r IndicesPromoteDataStreamRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f IndicesPromoteDataStream) WithContext(v context.Context) func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f IndicesPromoteDataStream) WithContext(v context.Context) func(*IndicesPr } // WithPretty makes the response body pretty-printed. +// func (f IndicesPromoteDataStream) WithPretty() func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f IndicesPromoteDataStream) WithPretty() func(*IndicesPromoteDataStreamReq } // WithHuman makes statistical values human-readable. +// func (f IndicesPromoteDataStream) WithHuman() func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f IndicesPromoteDataStream) WithHuman() func(*IndicesPromoteDataStreamRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesPromoteDataStream) WithErrorTrace() func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f IndicesPromoteDataStream) WithErrorTrace() func(*IndicesPromoteDataStrea } // WithFilterPath filters the properties of the response body. +// func (f IndicesPromoteDataStream) WithFilterPath(v ...string) func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f IndicesPromoteDataStream) WithFilterPath(v ...string) func(*IndicesPromo } // WithHeader adds the headers to the HTTP request. +// func (f IndicesPromoteDataStream) WithHeader(h map[string]string) func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f IndicesPromoteDataStream) WithHeader(h map[string]string) func(*IndicesP } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesPromoteDataStream) WithOpaqueID(s string) func(*IndicesPromoteDataStreamRequest) { return func(r *IndicesPromoteDataStreamRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.reload_search_analyzers.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.reload_search_analyzers.go index 61fa3385f6f..9236365d9ff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.reload_search_analyzers.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyze // IndicesReloadSearchAnalyzers - Reloads an index's search analyzers and their resources. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html. +// type IndicesReloadSearchAnalyzers func(index []string, o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) // IndicesReloadSearchAnalyzersRequest configures the Indices Reload Search Analyzers API request. +// type IndicesReloadSearchAnalyzersRequest struct { Index []string @@ -63,6 +65,7 @@ type IndicesReloadSearchAnalyzersRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -156,6 +159,7 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport T } // WithContext sets the request context. +// func (f IndicesReloadSearchAnalyzers) WithContext(v context.Context) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f IndicesReloadSearchAnalyzers) WithContext(v context.Context) func(*Indic } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesReloadSearchAnalyzers) WithAllowNoIndices(v bool) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.AllowNoIndices = &v @@ -170,6 +175,7 @@ func (f IndicesReloadSearchAnalyzers) WithAllowNoIndices(v bool) func(*IndicesRe } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesReloadSearchAnalyzers) WithExpandWildcards(v string) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.ExpandWildcards = v @@ -177,6 +183,7 @@ func (f IndicesReloadSearchAnalyzers) WithExpandWildcards(v string) func(*Indice } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesReloadSearchAnalyzers) WithIgnoreUnavailable(v bool) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.IgnoreUnavailable = &v @@ -184,6 +191,7 @@ func (f IndicesReloadSearchAnalyzers) WithIgnoreUnavailable(v bool) func(*Indice } // WithPretty makes the response body pretty-printed. +// func (f IndicesReloadSearchAnalyzers) WithPretty() func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.Pretty = true @@ -191,6 +199,7 @@ func (f IndicesReloadSearchAnalyzers) WithPretty() func(*IndicesReloadSearchAnal } // WithHuman makes statistical values human-readable. +// func (f IndicesReloadSearchAnalyzers) WithHuman() func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.Human = true @@ -198,6 +207,7 @@ func (f IndicesReloadSearchAnalyzers) WithHuman() func(*IndicesReloadSearchAnaly } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesReloadSearchAnalyzers) WithErrorTrace() func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.ErrorTrace = true @@ -205,6 +215,7 @@ func (f IndicesReloadSearchAnalyzers) WithErrorTrace() func(*IndicesReloadSearch } // WithFilterPath filters the properties of the response body. +// func (f IndicesReloadSearchAnalyzers) WithFilterPath(v ...string) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.FilterPath = v @@ -212,6 +223,7 @@ func (f IndicesReloadSearchAnalyzers) WithFilterPath(v ...string) func(*IndicesR } // WithHeader adds the headers to the HTTP request. +// func (f IndicesReloadSearchAnalyzers) WithHeader(h map[string]string) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { if r.Header == nil { @@ -224,6 +236,7 @@ func (f IndicesReloadSearchAnalyzers) WithHeader(h map[string]string) func(*Indi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesReloadSearchAnalyzers) WithOpaqueID(s string) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.unfreeze.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.unfreeze.go index 81615e5abf7..58beb64d444 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.unfreeze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.indices.unfreeze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newIndicesUnfreezeFunc(t Transport) IndicesUnfreeze { // IndicesUnfreeze - Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html. +// type IndicesUnfreeze func(index string, o ...func(*IndicesUnfreezeRequest)) (*Response, error) // IndicesUnfreezeRequest configures the Indices Unfreeze API request. +// type IndicesUnfreezeRequest struct { Index string @@ -66,6 +68,7 @@ type IndicesUnfreezeRequest struct { } // Do executes the request and returns response or error. +// func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -167,6 +170,7 @@ func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f IndicesUnfreeze) WithContext(v context.Context) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f IndicesUnfreeze) WithContext(v context.Context) func(*IndicesUnfreezeReq } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f IndicesUnfreeze) WithAllowNoIndices(v bool) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.AllowNoIndices = &v @@ -181,6 +186,7 @@ func (f IndicesUnfreeze) WithAllowNoIndices(v bool) func(*IndicesUnfreezeRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f IndicesUnfreeze) WithExpandWildcards(v string) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.ExpandWildcards = v @@ -188,6 +194,7 @@ func (f IndicesUnfreeze) WithExpandWildcards(v string) func(*IndicesUnfreezeRequ } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f IndicesUnfreeze) WithIgnoreUnavailable(v bool) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.IgnoreUnavailable = &v @@ -195,6 +202,7 @@ func (f IndicesUnfreeze) WithIgnoreUnavailable(v bool) func(*IndicesUnfreezeRequ } // WithMasterTimeout - specify timeout for connection to master. +// func (f IndicesUnfreeze) WithMasterTimeout(v time.Duration) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.MasterTimeout = v @@ -202,6 +210,7 @@ func (f IndicesUnfreeze) WithMasterTimeout(v time.Duration) func(*IndicesUnfreez } // WithTimeout - explicit operation timeout. +// func (f IndicesUnfreeze) WithTimeout(v time.Duration) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.Timeout = v @@ -209,6 +218,7 @@ func (f IndicesUnfreeze) WithTimeout(v time.Duration) func(*IndicesUnfreezeReque } // WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns.. +// func (f IndicesUnfreeze) WithWaitForActiveShards(v string) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.WaitForActiveShards = v @@ -216,6 +226,7 @@ func (f IndicesUnfreeze) WithWaitForActiveShards(v string) func(*IndicesUnfreeze } // WithPretty makes the response body pretty-printed. +// func (f IndicesUnfreeze) WithPretty() func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.Pretty = true @@ -223,6 +234,7 @@ func (f IndicesUnfreeze) WithPretty() func(*IndicesUnfreezeRequest) { } // WithHuman makes statistical values human-readable. +// func (f IndicesUnfreeze) WithHuman() func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.Human = true @@ -230,6 +242,7 @@ func (f IndicesUnfreeze) WithHuman() func(*IndicesUnfreezeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f IndicesUnfreeze) WithErrorTrace() func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.ErrorTrace = true @@ -237,6 +250,7 @@ func (f IndicesUnfreeze) WithErrorTrace() func(*IndicesUnfreezeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f IndicesUnfreeze) WithFilterPath(v ...string) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { r.FilterPath = v @@ -244,6 +258,7 @@ func (f IndicesUnfreeze) WithFilterPath(v ...string) func(*IndicesUnfreezeReques } // WithHeader adds the headers to the HTTP request. +// func (f IndicesUnfreeze) WithHeader(h map[string]string) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { if r.Header == nil { @@ -256,6 +271,7 @@ func (f IndicesUnfreeze) WithHeader(h map[string]string) func(*IndicesUnfreezeRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f IndicesUnfreeze) WithOpaqueID(s string) func(*IndicesUnfreezeRequest) { return func(r *IndicesUnfreezeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.delete.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.delete.go index fbf0cd75de5..878649d4207 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newLicenseDeleteFunc(t Transport) LicenseDelete { // LicenseDelete - Deletes licensing information for the cluster // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html. +// type LicenseDelete func(o ...func(*LicenseDeleteRequest)) (*Response, error) // LicenseDeleteRequest configures the License Delete API request. +// type LicenseDeleteRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type LicenseDeleteRequest struct { } // Do executes the request and returns response or error. +// func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f LicenseDelete) WithContext(v context.Context) func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f LicenseDelete) WithContext(v context.Context) func(*LicenseDeleteRequest } // WithPretty makes the response body pretty-printed. +// func (f LicenseDelete) WithPretty() func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f LicenseDelete) WithPretty() func(*LicenseDeleteRequest) { } // WithHuman makes statistical values human-readable. +// func (f LicenseDelete) WithHuman() func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f LicenseDelete) WithHuman() func(*LicenseDeleteRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicenseDelete) WithErrorTrace() func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f LicenseDelete) WithErrorTrace() func(*LicenseDeleteRequest) { } // WithFilterPath filters the properties of the response body. +// func (f LicenseDelete) WithFilterPath(v ...string) func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f LicenseDelete) WithFilterPath(v ...string) func(*LicenseDeleteRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f LicenseDelete) WithHeader(h map[string]string) func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f LicenseDelete) WithHeader(h map[string]string) func(*LicenseDeleteReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicenseDelete) WithOpaqueID(s string) func(*LicenseDeleteRequest) { return func(r *LicenseDeleteRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get.go index bc468ba3edb..471af82875c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newLicenseGetFunc(t Transport) LicenseGet { // LicenseGet - Retrieves licensing information for the cluster // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html. +// type LicenseGet func(o ...func(*LicenseGetRequest)) (*Response, error) // LicenseGetRequest configures the License Get API request. +// type LicenseGetRequest struct { AcceptEnterprise *bool Local *bool @@ -59,6 +61,7 @@ type LicenseGetRequest struct { } // Do executes the request and returns response or error. +// func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f LicenseGet) WithContext(v context.Context) func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f LicenseGet) WithContext(v context.Context) func(*LicenseGetRequest) { } // WithAcceptEnterprise - if the active license is an enterprise license, return type as 'enterprise' (default: false). +// func (f LicenseGet) WithAcceptEnterprise(v bool) func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.AcceptEnterprise = &v @@ -155,6 +160,7 @@ func (f LicenseGet) WithAcceptEnterprise(v bool) func(*LicenseGetRequest) { } // WithLocal - return local information, do not retrieve the state from master node (default: false). +// func (f LicenseGet) WithLocal(v bool) func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.Local = &v @@ -162,6 +168,7 @@ func (f LicenseGet) WithLocal(v bool) func(*LicenseGetRequest) { } // WithPretty makes the response body pretty-printed. +// func (f LicenseGet) WithPretty() func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.Pretty = true @@ -169,6 +176,7 @@ func (f LicenseGet) WithPretty() func(*LicenseGetRequest) { } // WithHuman makes statistical values human-readable. +// func (f LicenseGet) WithHuman() func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.Human = true @@ -176,6 +184,7 @@ func (f LicenseGet) WithHuman() func(*LicenseGetRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicenseGet) WithErrorTrace() func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.ErrorTrace = true @@ -183,6 +192,7 @@ func (f LicenseGet) WithErrorTrace() func(*LicenseGetRequest) { } // WithFilterPath filters the properties of the response body. +// func (f LicenseGet) WithFilterPath(v ...string) func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { r.FilterPath = v @@ -190,6 +200,7 @@ func (f LicenseGet) WithFilterPath(v ...string) func(*LicenseGetRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f LicenseGet) WithHeader(h map[string]string) func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { if r.Header == nil { @@ -202,6 +213,7 @@ func (f LicenseGet) WithHeader(h map[string]string) func(*LicenseGetRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicenseGet) WithOpaqueID(s string) func(*LicenseGetRequest) { return func(r *LicenseGetRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_basic_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_basic_status.go index b644e88b70a..f2557c1b86c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_basic_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_basic_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newLicenseGetBasicStatusFunc(t Transport) LicenseGetBasicStatus { // LicenseGetBasicStatus - Retrieves information about the status of the basic license. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html. +// type LicenseGetBasicStatus func(o ...func(*LicenseGetBasicStatusRequest)) (*Response, error) // LicenseGetBasicStatusRequest configures the License Get Basic Status API request. +// type LicenseGetBasicStatusRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type LicenseGetBasicStatusRequest struct { } // Do executes the request and returns response or error. +// func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f LicenseGetBasicStatus) WithContext(v context.Context) func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f LicenseGetBasicStatus) WithContext(v context.Context) func(*LicenseGetBa } // WithPretty makes the response body pretty-printed. +// func (f LicenseGetBasicStatus) WithPretty() func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f LicenseGetBasicStatus) WithPretty() func(*LicenseGetBasicStatusRequest) } // WithHuman makes statistical values human-readable. +// func (f LicenseGetBasicStatus) WithHuman() func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f LicenseGetBasicStatus) WithHuman() func(*LicenseGetBasicStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicenseGetBasicStatus) WithErrorTrace() func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f LicenseGetBasicStatus) WithErrorTrace() func(*LicenseGetBasicStatusReque } // WithFilterPath filters the properties of the response body. +// func (f LicenseGetBasicStatus) WithFilterPath(v ...string) func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f LicenseGetBasicStatus) WithFilterPath(v ...string) func(*LicenseGetBasic } // WithHeader adds the headers to the HTTP request. +// func (f LicenseGetBasicStatus) WithHeader(h map[string]string) func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f LicenseGetBasicStatus) WithHeader(h map[string]string) func(*LicenseGetB } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicenseGetBasicStatus) WithOpaqueID(s string) func(*LicenseGetBasicStatusRequest) { return func(r *LicenseGetBasicStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_trial_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_trial_status.go index 7eb475a90f5..41a77f2f1d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_trial_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.get_trial_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newLicenseGetTrialStatusFunc(t Transport) LicenseGetTrialStatus { // LicenseGetTrialStatus - Retrieves information about the status of the trial license. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html. +// type LicenseGetTrialStatus func(o ...func(*LicenseGetTrialStatusRequest)) (*Response, error) // LicenseGetTrialStatusRequest configures the License Get Trial Status API request. +// type LicenseGetTrialStatusRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type LicenseGetTrialStatusRequest struct { } // Do executes the request and returns response or error. +// func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f LicenseGetTrialStatus) WithContext(v context.Context) func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f LicenseGetTrialStatus) WithContext(v context.Context) func(*LicenseGetTr } // WithPretty makes the response body pretty-printed. +// func (f LicenseGetTrialStatus) WithPretty() func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f LicenseGetTrialStatus) WithPretty() func(*LicenseGetTrialStatusRequest) } // WithHuman makes statistical values human-readable. +// func (f LicenseGetTrialStatus) WithHuman() func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f LicenseGetTrialStatus) WithHuman() func(*LicenseGetTrialStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicenseGetTrialStatus) WithErrorTrace() func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f LicenseGetTrialStatus) WithErrorTrace() func(*LicenseGetTrialStatusReque } // WithFilterPath filters the properties of the response body. +// func (f LicenseGetTrialStatus) WithFilterPath(v ...string) func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f LicenseGetTrialStatus) WithFilterPath(v ...string) func(*LicenseGetTrial } // WithHeader adds the headers to the HTTP request. +// func (f LicenseGetTrialStatus) WithHeader(h map[string]string) func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f LicenseGetTrialStatus) WithHeader(h map[string]string) func(*LicenseGetT } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicenseGetTrialStatus) WithOpaqueID(s string) func(*LicenseGetTrialStatusRequest) { return func(r *LicenseGetTrialStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post.go index f58f98362fa..2bf25dae325 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newLicensePostFunc(t Transport) LicensePost { // LicensePost - Updates the license for the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html. +// type LicensePost func(o ...func(*LicensePostRequest)) (*Response, error) // LicensePostRequest configures the License Post API request. +// type LicensePostRequest struct { Body io.Reader @@ -61,6 +63,7 @@ type LicensePostRequest struct { } // Do executes the request and returns response or error. +// func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Respo 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 @@ -120,10 +127,6 @@ func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Respo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f LicensePost) WithContext(v context.Context) func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f LicensePost) WithContext(v context.Context) func(*LicensePostRequest) { } // WithBody - licenses to be installed. +// func (f LicensePost) WithBody(v io.Reader) func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f LicensePost) WithBody(v io.Reader) func(*LicensePostRequest) { } // WithAcknowledge - whether the user has acknowledged acknowledge messages (default: false). +// func (f LicensePost) WithAcknowledge(v bool) func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.Acknowledge = &v @@ -164,6 +170,7 @@ func (f LicensePost) WithAcknowledge(v bool) func(*LicensePostRequest) { } // WithPretty makes the response body pretty-printed. +// func (f LicensePost) WithPretty() func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.Pretty = true @@ -171,6 +178,7 @@ func (f LicensePost) WithPretty() func(*LicensePostRequest) { } // WithHuman makes statistical values human-readable. +// func (f LicensePost) WithHuman() func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.Human = true @@ -178,6 +186,7 @@ func (f LicensePost) WithHuman() func(*LicensePostRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicensePost) WithErrorTrace() func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.ErrorTrace = true @@ -185,6 +194,7 @@ func (f LicensePost) WithErrorTrace() func(*LicensePostRequest) { } // WithFilterPath filters the properties of the response body. +// func (f LicensePost) WithFilterPath(v ...string) func(*LicensePostRequest) { return func(r *LicensePostRequest) { r.FilterPath = v @@ -192,6 +202,7 @@ func (f LicensePost) WithFilterPath(v ...string) func(*LicensePostRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f LicensePost) WithHeader(h map[string]string) func(*LicensePostRequest) { return func(r *LicensePostRequest) { if r.Header == nil { @@ -204,6 +215,7 @@ func (f LicensePost) WithHeader(h map[string]string) func(*LicensePostRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicensePost) WithOpaqueID(s string) func(*LicensePostRequest) { return func(r *LicensePostRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_basic.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_basic.go index d79ea850ba4..91eae3c8897 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_basic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_basic.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newLicensePostStartBasicFunc(t Transport) LicensePostStartBasic { // LicensePostStartBasic - Starts an indefinite basic license. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html. +// type LicensePostStartBasic func(o ...func(*LicensePostStartBasicRequest)) (*Response, error) // LicensePostStartBasicRequest configures the License Post Start Basic API request. +// type LicensePostStartBasicRequest struct { Acknowledge *bool @@ -58,6 +60,7 @@ type LicensePostStartBasicRequest struct { } // Do executes the request and returns response or error. +// func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f LicensePostStartBasic) WithContext(v context.Context) func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f LicensePostStartBasic) WithContext(v context.Context) func(*LicensePostS } // WithAcknowledge - whether the user has acknowledged acknowledge messages (default: false). +// func (f LicensePostStartBasic) WithAcknowledge(v bool) func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { r.Acknowledge = &v @@ -150,6 +155,7 @@ func (f LicensePostStartBasic) WithAcknowledge(v bool) func(*LicensePostStartBas } // WithPretty makes the response body pretty-printed. +// func (f LicensePostStartBasic) WithPretty() func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f LicensePostStartBasic) WithPretty() func(*LicensePostStartBasicRequest) } // WithHuman makes statistical values human-readable. +// func (f LicensePostStartBasic) WithHuman() func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f LicensePostStartBasic) WithHuman() func(*LicensePostStartBasicRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicensePostStartBasic) WithErrorTrace() func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f LicensePostStartBasic) WithErrorTrace() func(*LicensePostStartBasicReque } // WithFilterPath filters the properties of the response body. +// func (f LicensePostStartBasic) WithFilterPath(v ...string) func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f LicensePostStartBasic) WithFilterPath(v ...string) func(*LicensePostStar } // WithHeader adds the headers to the HTTP request. +// func (f LicensePostStartBasic) WithHeader(h map[string]string) func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f LicensePostStartBasic) WithHeader(h map[string]string) func(*LicensePost } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicensePostStartBasic) WithOpaqueID(s string) func(*LicensePostStartBasicRequest) { return func(r *LicensePostStartBasicRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_trial.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_trial.go index 3d4a8543c08..8ed93ccc321 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_trial.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.license.post_start_trial.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newLicensePostStartTrialFunc(t Transport) LicensePostStartTrial { // LicensePostStartTrial - starts a limited time trial license. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html. +// type LicensePostStartTrial func(o ...func(*LicensePostStartTrialRequest)) (*Response, error) // LicensePostStartTrialRequest configures the License Post Start Trial API request. +// type LicensePostStartTrialRequest struct { Acknowledge *bool DocumentType string @@ -59,6 +61,7 @@ type LicensePostStartTrialRequest struct { } // Do executes the request and returns response or error. +// func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f LicensePostStartTrial) WithContext(v context.Context) func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f LicensePostStartTrial) WithContext(v context.Context) func(*LicensePostS } // WithAcknowledge - whether the user has acknowledged acknowledge messages (default: false). +// func (f LicensePostStartTrial) WithAcknowledge(v bool) func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.Acknowledge = &v @@ -155,6 +160,7 @@ func (f LicensePostStartTrial) WithAcknowledge(v bool) func(*LicensePostStartTri } // WithDocumentType - the type of trial license to generate (default: "trial"). +// func (f LicensePostStartTrial) WithDocumentType(v string) func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.DocumentType = v @@ -162,6 +168,7 @@ func (f LicensePostStartTrial) WithDocumentType(v string) func(*LicensePostStart } // WithPretty makes the response body pretty-printed. +// func (f LicensePostStartTrial) WithPretty() func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.Pretty = true @@ -169,6 +176,7 @@ func (f LicensePostStartTrial) WithPretty() func(*LicensePostStartTrialRequest) } // WithHuman makes statistical values human-readable. +// func (f LicensePostStartTrial) WithHuman() func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.Human = true @@ -176,6 +184,7 @@ func (f LicensePostStartTrial) WithHuman() func(*LicensePostStartTrialRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LicensePostStartTrial) WithErrorTrace() func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.ErrorTrace = true @@ -183,6 +192,7 @@ func (f LicensePostStartTrial) WithErrorTrace() func(*LicensePostStartTrialReque } // WithFilterPath filters the properties of the response body. +// func (f LicensePostStartTrial) WithFilterPath(v ...string) func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { r.FilterPath = v @@ -190,6 +200,7 @@ func (f LicensePostStartTrial) WithFilterPath(v ...string) func(*LicensePostStar } // WithHeader adds the headers to the HTTP request. +// func (f LicensePostStartTrial) WithHeader(h map[string]string) func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { if r.Header == nil { @@ -202,6 +213,7 @@ func (f LicensePostStartTrial) WithHeader(h map[string]string) func(*LicensePost } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LicensePostStartTrial) WithOpaqueID(s string) func(*LicensePostStartTrialRequest) { return func(r *LicensePostStartTrialRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.delete_pipeline.go index 9243287b6b1..74f8bcd1607 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.delete_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newLogstashDeletePipelineFunc(t Transport) LogstashDeletePipeline { // LogstashDeletePipeline - Deletes Logstash Pipelines used by Central Management // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html. +// type LogstashDeletePipeline func(id string, o ...func(*LogstashDeletePipelineRequest)) (*Response, error) // LogstashDeletePipelineRequest configures the Logstash Delete Pipeline API request. +// type LogstashDeletePipelineRequest struct { DocumentID string @@ -57,6 +59,7 @@ type LogstashDeletePipelineRequest struct { } // Do executes the request and returns response or error. +// func (r LogstashDeletePipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r LogstashDeletePipelineRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f LogstashDeletePipeline) WithContext(v context.Context) func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f LogstashDeletePipeline) WithContext(v context.Context) func(*LogstashDel } // WithPretty makes the response body pretty-printed. +// func (f LogstashDeletePipeline) WithPretty() func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f LogstashDeletePipeline) WithPretty() func(*LogstashDeletePipelineRequest } // WithHuman makes statistical values human-readable. +// func (f LogstashDeletePipeline) WithHuman() func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f LogstashDeletePipeline) WithHuman() func(*LogstashDeletePipelineRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LogstashDeletePipeline) WithErrorTrace() func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f LogstashDeletePipeline) WithErrorTrace() func(*LogstashDeletePipelineReq } // WithFilterPath filters the properties of the response body. +// func (f LogstashDeletePipeline) WithFilterPath(v ...string) func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f LogstashDeletePipeline) WithFilterPath(v ...string) func(*LogstashDelete } // WithHeader adds the headers to the HTTP request. +// func (f LogstashDeletePipeline) WithHeader(h map[string]string) func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f LogstashDeletePipeline) WithHeader(h map[string]string) func(*LogstashDe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LogstashDeletePipeline) WithOpaqueID(s string) func(*LogstashDeletePipelineRequest) { return func(r *LogstashDeletePipelineRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.get_pipeline.go index 9a2f1f8f34e..1dd2ef5262b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.get_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newLogstashGetPipelineFunc(t Transport) LogstashGetPipeline { // LogstashGetPipeline - Retrieves Logstash Pipelines used by Central Management // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html. +// type LogstashGetPipeline func(id string, o ...func(*LogstashGetPipelineRequest)) (*Response, error) // LogstashGetPipelineRequest configures the Logstash Get Pipeline API request. +// type LogstashGetPipelineRequest struct { DocumentID string @@ -57,6 +59,7 @@ type LogstashGetPipelineRequest struct { } // Do executes the request and returns response or error. +// func (r LogstashGetPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r LogstashGetPipelineRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f LogstashGetPipeline) WithContext(v context.Context) func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f LogstashGetPipeline) WithContext(v context.Context) func(*LogstashGetPip } // WithPretty makes the response body pretty-printed. +// func (f LogstashGetPipeline) WithPretty() func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f LogstashGetPipeline) WithPretty() func(*LogstashGetPipelineRequest) { } // WithHuman makes statistical values human-readable. +// func (f LogstashGetPipeline) WithHuman() func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f LogstashGetPipeline) WithHuman() func(*LogstashGetPipelineRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LogstashGetPipeline) WithErrorTrace() func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f LogstashGetPipeline) WithErrorTrace() func(*LogstashGetPipelineRequest) } // WithFilterPath filters the properties of the response body. +// func (f LogstashGetPipeline) WithFilterPath(v ...string) func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f LogstashGetPipeline) WithFilterPath(v ...string) func(*LogstashGetPipeli } // WithHeader adds the headers to the HTTP request. +// func (f LogstashGetPipeline) WithHeader(h map[string]string) func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f LogstashGetPipeline) WithHeader(h map[string]string) func(*LogstashGetPi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LogstashGetPipeline) WithOpaqueID(s string) func(*LogstashGetPipelineRequest) { return func(r *LogstashGetPipelineRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.put_pipeline.go index bad9f96c5db..585b400f960 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.logstash.put_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newLogstashPutPipelineFunc(t Transport) LogstashPutPipeline { // LogstashPutPipeline - Adds and updates Logstash Pipelines used for Central Management // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html. +// type LogstashPutPipeline func(id string, body io.Reader, o ...func(*LogstashPutPipelineRequest)) (*Response, error) // LogstashPutPipelineRequest configures the Logstash Put Pipeline API request. +// type LogstashPutPipelineRequest struct { DocumentID string @@ -60,6 +62,7 @@ type LogstashPutPipelineRequest struct { } // Do executes the request and returns response or error. +// func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) 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 @@ -120,10 +127,6 @@ func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f LogstashPutPipeline) WithContext(v context.Context) func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f LogstashPutPipeline) WithContext(v context.Context) func(*LogstashPutPip } // WithPretty makes the response body pretty-printed. +// func (f LogstashPutPipeline) WithPretty() func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f LogstashPutPipeline) WithPretty() func(*LogstashPutPipelineRequest) { } // WithHuman makes statistical values human-readable. +// func (f LogstashPutPipeline) WithHuman() func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f LogstashPutPipeline) WithHuman() func(*LogstashPutPipelineRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f LogstashPutPipeline) WithErrorTrace() func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f LogstashPutPipeline) WithErrorTrace() func(*LogstashPutPipelineRequest) } // WithFilterPath filters the properties of the response body. +// func (f LogstashPutPipeline) WithFilterPath(v ...string) func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f LogstashPutPipeline) WithFilterPath(v ...string) func(*LogstashPutPipeli } // WithHeader adds the headers to the HTTP request. +// func (f LogstashPutPipeline) WithHeader(h map[string]string) func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f LogstashPutPipeline) WithHeader(h map[string]string) func(*LogstashPutPi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f LogstashPutPipeline) WithOpaqueID(s string) func(*LogstashPutPipelineRequest) { return func(r *LogstashPutPipelineRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.deprecations.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.deprecations.go index 00dfdfe05b2..a541a79455c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.deprecations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.deprecations.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMigrationDeprecationsFunc(t Transport) MigrationDeprecations { // MigrationDeprecations - Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html. +// type MigrationDeprecations func(o ...func(*MigrationDeprecationsRequest)) (*Response, error) // MigrationDeprecationsRequest configures the Migration Deprecations API request. +// type MigrationDeprecationsRequest struct { Index string @@ -57,6 +59,7 @@ type MigrationDeprecationsRequest struct { } // Do executes the request and returns response or error. +// func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f MigrationDeprecations) WithContext(v context.Context) func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f MigrationDeprecations) WithContext(v context.Context) func(*MigrationDep } // WithIndex - index pattern. +// func (f MigrationDeprecations) WithIndex(v string) func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { r.Index = v @@ -152,6 +157,7 @@ func (f MigrationDeprecations) WithIndex(v string) func(*MigrationDeprecationsRe } // WithPretty makes the response body pretty-printed. +// func (f MigrationDeprecations) WithPretty() func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f MigrationDeprecations) WithPretty() func(*MigrationDeprecationsRequest) } // WithHuman makes statistical values human-readable. +// func (f MigrationDeprecations) WithHuman() func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f MigrationDeprecations) WithHuman() func(*MigrationDeprecationsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MigrationDeprecations) WithErrorTrace() func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f MigrationDeprecations) WithErrorTrace() func(*MigrationDeprecationsReque } // WithFilterPath filters the properties of the response body. +// func (f MigrationDeprecations) WithFilterPath(v ...string) func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f MigrationDeprecations) WithFilterPath(v ...string) func(*MigrationDeprec } // WithHeader adds the headers to the HTTP request. +// func (f MigrationDeprecations) WithHeader(h map[string]string) func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f MigrationDeprecations) WithHeader(h map[string]string) func(*MigrationDe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MigrationDeprecations) WithOpaqueID(s string) func(*MigrationDeprecationsRequest) { return func(r *MigrationDeprecationsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.get_feature_upgrade_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.get_feature_upgrade_status.go index a9113384e09..d362170a946 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.get_feature_upgrade_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.get_feature_upgrade_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMigrationGetFeatureUpgradeStatusFunc(t Transport) MigrationGetFeatureUpg // MigrationGetFeatureUpgradeStatus - Find out whether system features need to be upgraded or not // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html. +// type MigrationGetFeatureUpgradeStatus func(o ...func(*MigrationGetFeatureUpgradeStatusRequest)) (*Response, error) // MigrationGetFeatureUpgradeStatusRequest configures the Migration Get Feature Upgrade Status API request. +// type MigrationGetFeatureUpgradeStatusRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type MigrationGetFeatureUpgradeStatusRequest struct { } // Do executes the request and returns response or error. +// func (r MigrationGetFeatureUpgradeStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r MigrationGetFeatureUpgradeStatusRequest) Do(ctx context.Context, transpo } // WithContext sets the request context. +// func (f MigrationGetFeatureUpgradeStatus) WithContext(v context.Context) func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f MigrationGetFeatureUpgradeStatus) WithContext(v context.Context) func(*M } // WithPretty makes the response body pretty-printed. +// func (f MigrationGetFeatureUpgradeStatus) WithPretty() func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f MigrationGetFeatureUpgradeStatus) WithPretty() func(*MigrationGetFeature } // WithHuman makes statistical values human-readable. +// func (f MigrationGetFeatureUpgradeStatus) WithHuman() func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f MigrationGetFeatureUpgradeStatus) WithHuman() func(*MigrationGetFeatureU } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MigrationGetFeatureUpgradeStatus) WithErrorTrace() func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f MigrationGetFeatureUpgradeStatus) WithErrorTrace() func(*MigrationGetFea } // WithFilterPath filters the properties of the response body. +// func (f MigrationGetFeatureUpgradeStatus) WithFilterPath(v ...string) func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f MigrationGetFeatureUpgradeStatus) WithFilterPath(v ...string) func(*Migr } // WithHeader adds the headers to the HTTP request. +// func (f MigrationGetFeatureUpgradeStatus) WithHeader(h map[string]string) func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f MigrationGetFeatureUpgradeStatus) WithHeader(h map[string]string) func(* } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MigrationGetFeatureUpgradeStatus) WithOpaqueID(s string) func(*MigrationGetFeatureUpgradeStatusRequest) { return func(r *MigrationGetFeatureUpgradeStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.post_feature_upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.post_feature_upgrade.go index 4b91df92dae..85d13a372e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.post_feature_upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.migration.post_feature_upgrade.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMigrationPostFeatureUpgradeFunc(t Transport) MigrationPostFeatureUpgrade // MigrationPostFeatureUpgrade - Begin upgrades for system features // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html. +// type MigrationPostFeatureUpgrade func(o ...func(*MigrationPostFeatureUpgradeRequest)) (*Response, error) // MigrationPostFeatureUpgradeRequest configures the Migration Post Feature Upgrade API request. +// type MigrationPostFeatureUpgradeRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type MigrationPostFeatureUpgradeRequest struct { } // Do executes the request and returns response or error. +// func (r MigrationPostFeatureUpgradeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r MigrationPostFeatureUpgradeRequest) Do(ctx context.Context, transport Tr } // WithContext sets the request context. +// func (f MigrationPostFeatureUpgrade) WithContext(v context.Context) func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f MigrationPostFeatureUpgrade) WithContext(v context.Context) func(*Migrat } // WithPretty makes the response body pretty-printed. +// func (f MigrationPostFeatureUpgrade) WithPretty() func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f MigrationPostFeatureUpgrade) WithPretty() func(*MigrationPostFeatureUpgr } // WithHuman makes statistical values human-readable. +// func (f MigrationPostFeatureUpgrade) WithHuman() func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f MigrationPostFeatureUpgrade) WithHuman() func(*MigrationPostFeatureUpgra } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MigrationPostFeatureUpgrade) WithErrorTrace() func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f MigrationPostFeatureUpgrade) WithErrorTrace() func(*MigrationPostFeature } // WithFilterPath filters the properties of the response body. +// func (f MigrationPostFeatureUpgrade) WithFilterPath(v ...string) func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f MigrationPostFeatureUpgrade) WithFilterPath(v ...string) func(*Migration } // WithHeader adds the headers to the HTTP request. +// func (f MigrationPostFeatureUpgrade) WithHeader(h map[string]string) func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f MigrationPostFeatureUpgrade) WithHeader(h map[string]string) func(*Migra } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MigrationPostFeatureUpgrade) WithOpaqueID(s string) func(*MigrationPostFeatureUpgradeRequest) { return func(r *MigrationPostFeatureUpgradeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.close_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.close_job.go index b48628825be..e0373de2a0b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.close_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.close_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLCloseJobFunc(t Transport) MLCloseJob { // MLCloseJob - Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html. +// type MLCloseJob func(job_id string, o ...func(*MLCloseJobRequest)) (*Response, error) // MLCloseJobRequest configures the ML Close Job API request. +// type MLCloseJobRequest struct { Body io.Reader @@ -67,6 +69,7 @@ type MLCloseJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -133,6 +136,10 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon 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 @@ -145,10 +152,6 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -168,6 +171,7 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f MLCloseJob) WithContext(v context.Context) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.ctx = v @@ -175,6 +179,7 @@ func (f MLCloseJob) WithContext(v context.Context) func(*MLCloseJobRequest) { } // WithBody - The URL params optionally sent in the body. +// func (f MLCloseJob) WithBody(v io.Reader) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.Body = v @@ -182,6 +187,7 @@ func (f MLCloseJob) WithBody(v io.Reader) func(*MLCloseJobRequest) { } // WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLCloseJob) WithAllowNoJobs(v bool) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.AllowNoJobs = &v @@ -189,6 +195,7 @@ func (f MLCloseJob) WithAllowNoJobs(v bool) func(*MLCloseJobRequest) { } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLCloseJob) WithAllowNoMatch(v bool) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.AllowNoMatch = &v @@ -196,6 +203,7 @@ func (f MLCloseJob) WithAllowNoMatch(v bool) func(*MLCloseJobRequest) { } // WithForce - true if the job should be forcefully closed. +// func (f MLCloseJob) WithForce(v bool) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.Force = &v @@ -203,6 +211,7 @@ func (f MLCloseJob) WithForce(v bool) func(*MLCloseJobRequest) { } // WithTimeout - controls the time to wait until a job has closed. default to 30 minutes. +// func (f MLCloseJob) WithTimeout(v time.Duration) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.Timeout = v @@ -210,6 +219,7 @@ func (f MLCloseJob) WithTimeout(v time.Duration) func(*MLCloseJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLCloseJob) WithPretty() func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.Pretty = true @@ -217,6 +227,7 @@ func (f MLCloseJob) WithPretty() func(*MLCloseJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLCloseJob) WithHuman() func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.Human = true @@ -224,6 +235,7 @@ func (f MLCloseJob) WithHuman() func(*MLCloseJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLCloseJob) WithErrorTrace() func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.ErrorTrace = true @@ -231,6 +243,7 @@ func (f MLCloseJob) WithErrorTrace() func(*MLCloseJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLCloseJob) WithFilterPath(v ...string) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { r.FilterPath = v @@ -238,6 +251,7 @@ func (f MLCloseJob) WithFilterPath(v ...string) func(*MLCloseJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLCloseJob) WithHeader(h map[string]string) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { if r.Header == nil { @@ -250,6 +264,7 @@ func (f MLCloseJob) WithHeader(h map[string]string) func(*MLCloseJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLCloseJob) WithOpaqueID(s string) func(*MLCloseJobRequest) { return func(r *MLCloseJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar.go index 0cfb9ed7108..df4dc8712c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteCalendarFunc(t Transport) MLDeleteCalendar { // MLDeleteCalendar - Deletes a calendar. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html. +// type MLDeleteCalendar func(calendar_id string, o ...func(*MLDeleteCalendarRequest)) (*Response, error) // MLDeleteCalendarRequest configures the ML Delete Calendar API request. +// type MLDeleteCalendarRequest struct { CalendarID string @@ -57,6 +59,7 @@ type MLDeleteCalendarRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLDeleteCalendar) WithContext(v context.Context) func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLDeleteCalendar) WithContext(v context.Context) func(*MLDeleteCalendarR } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteCalendar) WithPretty() func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLDeleteCalendar) WithPretty() func(*MLDeleteCalendarRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteCalendar) WithHuman() func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLDeleteCalendar) WithHuman() func(*MLDeleteCalendarRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteCalendar) WithErrorTrace() func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLDeleteCalendar) WithErrorTrace() func(*MLDeleteCalendarRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteCalendar) WithFilterPath(v ...string) func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLDeleteCalendar) WithFilterPath(v ...string) func(*MLDeleteCalendarRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteCalendar) WithHeader(h map[string]string) func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLDeleteCalendar) WithHeader(h map[string]string) func(*MLDeleteCalendar } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteCalendar) WithOpaqueID(s string) func(*MLDeleteCalendarRequest) { return func(r *MLDeleteCalendarRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_event.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_event.go index 74d88610765..c961ad6b9d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_event.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_event.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteCalendarEventFunc(t Transport) MLDeleteCalendarEvent { // MLDeleteCalendarEvent - Deletes scheduled events from a calendar. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html. +// type MLDeleteCalendarEvent func(calendar_id string, event_id string, o ...func(*MLDeleteCalendarEventRequest)) (*Response, error) // MLDeleteCalendarEventRequest configures the ML Delete Calendar Event API request. +// type MLDeleteCalendarEventRequest struct { CalendarID string EventID string @@ -58,6 +60,7 @@ type MLDeleteCalendarEventRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f MLDeleteCalendarEvent) WithContext(v context.Context) func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f MLDeleteCalendarEvent) WithContext(v context.Context) func(*MLDeleteCale } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteCalendarEvent) WithPretty() func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f MLDeleteCalendarEvent) WithPretty() func(*MLDeleteCalendarEventRequest) } // WithHuman makes statistical values human-readable. +// func (f MLDeleteCalendarEvent) WithHuman() func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f MLDeleteCalendarEvent) WithHuman() func(*MLDeleteCalendarEventRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteCalendarEvent) WithErrorTrace() func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f MLDeleteCalendarEvent) WithErrorTrace() func(*MLDeleteCalendarEventReque } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteCalendarEvent) WithFilterPath(v ...string) func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f MLDeleteCalendarEvent) WithFilterPath(v ...string) func(*MLDeleteCalenda } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteCalendarEvent) WithHeader(h map[string]string) func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f MLDeleteCalendarEvent) WithHeader(h map[string]string) func(*MLDeleteCal } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteCalendarEvent) WithOpaqueID(s string) func(*MLDeleteCalendarEventRequest) { return func(r *MLDeleteCalendarEventRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_job.go index 5bb488b6dbe..8c93216343c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_calendar_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteCalendarJobFunc(t Transport) MLDeleteCalendarJob { // MLDeleteCalendarJob - Deletes anomaly detection jobs from a calendar. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html. +// type MLDeleteCalendarJob func(calendar_id string, job_id string, o ...func(*MLDeleteCalendarJobRequest)) (*Response, error) // MLDeleteCalendarJobRequest configures the ML Delete Calendar Job API request. +// type MLDeleteCalendarJobRequest struct { CalendarID string JobID string @@ -58,6 +60,7 @@ type MLDeleteCalendarJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLDeleteCalendarJob) WithContext(v context.Context) func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f MLDeleteCalendarJob) WithContext(v context.Context) func(*MLDeleteCalend } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteCalendarJob) WithPretty() func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f MLDeleteCalendarJob) WithPretty() func(*MLDeleteCalendarJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteCalendarJob) WithHuman() func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f MLDeleteCalendarJob) WithHuman() func(*MLDeleteCalendarJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteCalendarJob) WithErrorTrace() func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f MLDeleteCalendarJob) WithErrorTrace() func(*MLDeleteCalendarJobRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteCalendarJob) WithFilterPath(v ...string) func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f MLDeleteCalendarJob) WithFilterPath(v ...string) func(*MLDeleteCalendarJ } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteCalendarJob) WithHeader(h map[string]string) func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f MLDeleteCalendarJob) WithHeader(h map[string]string) func(*MLDeleteCalen } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteCalendarJob) WithOpaqueID(s string) func(*MLDeleteCalendarJobRequest) { return func(r *MLDeleteCalendarJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_data_frame_analytics.go index 614b405e2e6..bc9aa36e7eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { // MLDeleteDataFrameAnalytics - Deletes an existing data frame analytics job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html. +// type MLDeleteDataFrameAnalytics func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) // MLDeleteDataFrameAnalyticsRequest configures the ML Delete Data Frame Analytics API request. +// type MLDeleteDataFrameAnalyticsRequest struct { ID string @@ -62,6 +64,7 @@ type MLDeleteDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -151,6 +154,7 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f MLDeleteDataFrameAnalytics) WithContext(v context.Context) func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.ctx = v @@ -158,6 +162,7 @@ func (f MLDeleteDataFrameAnalytics) WithContext(v context.Context) func(*MLDelet } // WithForce - true if the job should be forcefully deleted. +// func (f MLDeleteDataFrameAnalytics) WithForce(v bool) func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.Force = &v @@ -165,6 +170,7 @@ func (f MLDeleteDataFrameAnalytics) WithForce(v bool) func(*MLDeleteDataFrameAna } // WithTimeout - controls the time to wait until a job is deleted. defaults to 1 minute. +// func (f MLDeleteDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.Timeout = v @@ -172,6 +178,7 @@ func (f MLDeleteDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLDeleteD } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteDataFrameAnalytics) WithPretty() func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.Pretty = true @@ -179,6 +186,7 @@ func (f MLDeleteDataFrameAnalytics) WithPretty() func(*MLDeleteDataFrameAnalytic } // WithHuman makes statistical values human-readable. +// func (f MLDeleteDataFrameAnalytics) WithHuman() func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.Human = true @@ -186,6 +194,7 @@ func (f MLDeleteDataFrameAnalytics) WithHuman() func(*MLDeleteDataFrameAnalytics } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteDataFrameAnalytics) WithErrorTrace() func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -193,6 +202,7 @@ func (f MLDeleteDataFrameAnalytics) WithErrorTrace() func(*MLDeleteDataFrameAnal } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteDataFrameAnalytics) WithFilterPath(v ...string) func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { r.FilterPath = v @@ -200,6 +210,7 @@ func (f MLDeleteDataFrameAnalytics) WithFilterPath(v ...string) func(*MLDeleteDa } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteDataFrameAnalytics) WithHeader(h map[string]string) func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { if r.Header == nil { @@ -212,6 +223,7 @@ func (f MLDeleteDataFrameAnalytics) WithHeader(h map[string]string) func(*MLDele } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteDataFrameAnalytics) WithOpaqueID(s string) func(*MLDeleteDataFrameAnalyticsRequest) { return func(r *MLDeleteDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_datafeed.go index bf1e24e3d1a..cee8ccab833 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLDeleteDatafeedFunc(t Transport) MLDeleteDatafeed { // MLDeleteDatafeed - Deletes an existing datafeed. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html. +// type MLDeleteDatafeed func(datafeed_id string, o ...func(*MLDeleteDatafeedRequest)) (*Response, error) // MLDeleteDatafeedRequest configures the ML Delete Datafeed API request. +// type MLDeleteDatafeedRequest struct { DatafeedID string @@ -60,6 +62,7 @@ type MLDeleteDatafeedRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLDeleteDatafeed) WithContext(v context.Context) func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f MLDeleteDatafeed) WithContext(v context.Context) func(*MLDeleteDatafeedR } // WithForce - true if the datafeed should be forcefully deleted. +// func (f MLDeleteDatafeed) WithForce(v bool) func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { r.Force = &v @@ -157,6 +162,7 @@ func (f MLDeleteDatafeed) WithForce(v bool) func(*MLDeleteDatafeedRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteDatafeed) WithPretty() func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f MLDeleteDatafeed) WithPretty() func(*MLDeleteDatafeedRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteDatafeed) WithHuman() func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f MLDeleteDatafeed) WithHuman() func(*MLDeleteDatafeedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteDatafeed) WithErrorTrace() func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f MLDeleteDatafeed) WithErrorTrace() func(*MLDeleteDatafeedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteDatafeed) WithFilterPath(v ...string) func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f MLDeleteDatafeed) WithFilterPath(v ...string) func(*MLDeleteDatafeedRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteDatafeed) WithHeader(h map[string]string) func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f MLDeleteDatafeed) WithHeader(h map[string]string) func(*MLDeleteDatafeed } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteDatafeed) WithOpaqueID(s string) func(*MLDeleteDatafeedRequest) { return func(r *MLDeleteDatafeedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_expired_data.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_expired_data.go index 047208de728..4e5d3c55c8b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_expired_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_expired_data.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLDeleteExpiredDataFunc(t Transport) MLDeleteExpiredData { // MLDeleteExpiredData - Deletes expired and unused machine learning data. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html. +// type MLDeleteExpiredData func(o ...func(*MLDeleteExpiredDataRequest)) (*Response, error) // MLDeleteExpiredDataRequest configures the ML Delete Expired Data API request. +// type MLDeleteExpiredDataRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type MLDeleteExpiredDataRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -123,6 +126,10 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) 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 @@ -135,10 +142,6 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -158,6 +161,7 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLDeleteExpiredData) WithContext(v context.Context) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f MLDeleteExpiredData) WithContext(v context.Context) func(*MLDeleteExpire } // WithBody - deleting expired data parameters. +// func (f MLDeleteExpiredData) WithBody(v io.Reader) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.Body = v @@ -172,6 +177,7 @@ func (f MLDeleteExpiredData) WithBody(v io.Reader) func(*MLDeleteExpiredDataRequ } // WithJobID - the ID of the job(s) to perform expired data hygiene for. +// func (f MLDeleteExpiredData) WithJobID(v string) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.JobID = v @@ -179,6 +185,7 @@ func (f MLDeleteExpiredData) WithJobID(v string) func(*MLDeleteExpiredDataReques } // WithRequestsPerSecond - the desired requests per second for the deletion processes.. +// func (f MLDeleteExpiredData) WithRequestsPerSecond(v int) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.RequestsPerSecond = &v @@ -186,6 +193,7 @@ func (f MLDeleteExpiredData) WithRequestsPerSecond(v int) func(*MLDeleteExpiredD } // WithTimeout - how long can the underlying delete processes run until they are canceled. +// func (f MLDeleteExpiredData) WithTimeout(v time.Duration) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.Timeout = v @@ -193,6 +201,7 @@ func (f MLDeleteExpiredData) WithTimeout(v time.Duration) func(*MLDeleteExpiredD } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteExpiredData) WithPretty() func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.Pretty = true @@ -200,6 +209,7 @@ func (f MLDeleteExpiredData) WithPretty() func(*MLDeleteExpiredDataRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteExpiredData) WithHuman() func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.Human = true @@ -207,6 +217,7 @@ func (f MLDeleteExpiredData) WithHuman() func(*MLDeleteExpiredDataRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteExpiredData) WithErrorTrace() func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.ErrorTrace = true @@ -214,6 +225,7 @@ func (f MLDeleteExpiredData) WithErrorTrace() func(*MLDeleteExpiredDataRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteExpiredData) WithFilterPath(v ...string) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { r.FilterPath = v @@ -221,6 +233,7 @@ func (f MLDeleteExpiredData) WithFilterPath(v ...string) func(*MLDeleteExpiredDa } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteExpiredData) WithHeader(h map[string]string) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { if r.Header == nil { @@ -233,6 +246,7 @@ func (f MLDeleteExpiredData) WithHeader(h map[string]string) func(*MLDeleteExpir } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteExpiredData) WithOpaqueID(s string) func(*MLDeleteExpiredDataRequest) { return func(r *MLDeleteExpiredDataRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_filter.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_filter.go index 9acd632a726..f4356d8360d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_filter.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteFilterFunc(t Transport) MLDeleteFilter { // MLDeleteFilter - Deletes a filter. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html. +// type MLDeleteFilter func(filter_id string, o ...func(*MLDeleteFilterRequest)) (*Response, error) // MLDeleteFilterRequest configures the ML Delete Filter API request. +// type MLDeleteFilterRequest struct { FilterID string @@ -57,6 +59,7 @@ type MLDeleteFilterRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f MLDeleteFilter) WithContext(v context.Context) func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLDeleteFilter) WithContext(v context.Context) func(*MLDeleteFilterReque } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteFilter) WithPretty() func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLDeleteFilter) WithPretty() func(*MLDeleteFilterRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteFilter) WithHuman() func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLDeleteFilter) WithHuman() func(*MLDeleteFilterRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteFilter) WithErrorTrace() func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLDeleteFilter) WithErrorTrace() func(*MLDeleteFilterRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteFilter) WithFilterPath(v ...string) func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLDeleteFilter) WithFilterPath(v ...string) func(*MLDeleteFilterRequest) } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteFilter) WithHeader(h map[string]string) func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLDeleteFilter) WithHeader(h map[string]string) func(*MLDeleteFilterRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteFilter) WithOpaqueID(s string) func(*MLDeleteFilterRequest) { return func(r *MLDeleteFilterRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_forecast.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_forecast.go index 3f78353ebc3..8995ab49010 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_forecast.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLDeleteForecastFunc(t Transport) MLDeleteForecast { // MLDeleteForecast - Deletes forecasts from a machine learning job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html. +// type MLDeleteForecast func(job_id string, o ...func(*MLDeleteForecastRequest)) (*Response, error) // MLDeleteForecastRequest configures the ML Delete Forecast API request. +// type MLDeleteForecastRequest struct { ForecastID string JobID string @@ -63,6 +65,7 @@ type MLDeleteForecastRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -156,6 +159,7 @@ func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLDeleteForecast) WithContext(v context.Context) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f MLDeleteForecast) WithContext(v context.Context) func(*MLDeleteForecastR } // WithForecastID - the ID of the forecast to delete, can be comma delimited list. leaving blank implies `_all`. +// func (f MLDeleteForecast) WithForecastID(v string) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.ForecastID = v @@ -170,6 +175,7 @@ func (f MLDeleteForecast) WithForecastID(v string) func(*MLDeleteForecastRequest } // WithAllowNoForecasts - whether to ignore if `_all` matches no forecasts. +// func (f MLDeleteForecast) WithAllowNoForecasts(v bool) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.AllowNoForecasts = &v @@ -177,6 +183,7 @@ func (f MLDeleteForecast) WithAllowNoForecasts(v bool) func(*MLDeleteForecastReq } // WithTimeout - controls the time to wait until the forecast(s) are deleted. default to 30 seconds. +// func (f MLDeleteForecast) WithTimeout(v time.Duration) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.Timeout = v @@ -184,6 +191,7 @@ func (f MLDeleteForecast) WithTimeout(v time.Duration) func(*MLDeleteForecastReq } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteForecast) WithPretty() func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.Pretty = true @@ -191,6 +199,7 @@ func (f MLDeleteForecast) WithPretty() func(*MLDeleteForecastRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteForecast) WithHuman() func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.Human = true @@ -198,6 +207,7 @@ func (f MLDeleteForecast) WithHuman() func(*MLDeleteForecastRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteForecast) WithErrorTrace() func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.ErrorTrace = true @@ -205,6 +215,7 @@ func (f MLDeleteForecast) WithErrorTrace() func(*MLDeleteForecastRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteForecast) WithFilterPath(v ...string) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { r.FilterPath = v @@ -212,6 +223,7 @@ func (f MLDeleteForecast) WithFilterPath(v ...string) func(*MLDeleteForecastRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteForecast) WithHeader(h map[string]string) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { if r.Header == nil { @@ -224,6 +236,7 @@ func (f MLDeleteForecast) WithHeader(h map[string]string) func(*MLDeleteForecast } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteForecast) WithOpaqueID(s string) func(*MLDeleteForecastRequest) { return func(r *MLDeleteForecastRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_job.go index 92b3ebae7cf..22f1ca238a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLDeleteJobFunc(t Transport) MLDeleteJob { // MLDeleteJob - Deletes an existing anomaly detection job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html. +// type MLDeleteJob func(job_id string, o ...func(*MLDeleteJobRequest)) (*Response, error) // MLDeleteJobRequest configures the ML Delete Job API request. +// type MLDeleteJobRequest struct { JobID string @@ -61,6 +63,7 @@ type MLDeleteJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f MLDeleteJob) WithContext(v context.Context) func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f MLDeleteJob) WithContext(v context.Context) func(*MLDeleteJobRequest) { } // WithForce - true if the job should be forcefully deleted. +// func (f MLDeleteJob) WithForce(v bool) func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.Force = &v @@ -162,6 +167,7 @@ func (f MLDeleteJob) WithForce(v bool) func(*MLDeleteJobRequest) { } // WithWaitForCompletion - should this request wait until the operation has completed before returning. +// func (f MLDeleteJob) WithWaitForCompletion(v bool) func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.WaitForCompletion = &v @@ -169,6 +175,7 @@ func (f MLDeleteJob) WithWaitForCompletion(v bool) func(*MLDeleteJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteJob) WithPretty() func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.Pretty = true @@ -176,6 +183,7 @@ func (f MLDeleteJob) WithPretty() func(*MLDeleteJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteJob) WithHuman() func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.Human = true @@ -183,6 +191,7 @@ func (f MLDeleteJob) WithHuman() func(*MLDeleteJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteJob) WithErrorTrace() func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.ErrorTrace = true @@ -190,6 +199,7 @@ func (f MLDeleteJob) WithErrorTrace() func(*MLDeleteJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteJob) WithFilterPath(v ...string) func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { r.FilterPath = v @@ -197,6 +207,7 @@ func (f MLDeleteJob) WithFilterPath(v ...string) func(*MLDeleteJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteJob) WithHeader(h map[string]string) func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { if r.Header == nil { @@ -209,6 +220,7 @@ func (f MLDeleteJob) WithHeader(h map[string]string) func(*MLDeleteJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteJob) WithOpaqueID(s string) func(*MLDeleteJobRequest) { return func(r *MLDeleteJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_model_snapshot.go index 9a30415451d..c8b2c84cc58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_model_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteModelSnapshotFunc(t Transport) MLDeleteModelSnapshot { // MLDeleteModelSnapshot - Deletes an existing model snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html. +// type MLDeleteModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLDeleteModelSnapshotRequest)) (*Response, error) // MLDeleteModelSnapshotRequest configures the ML Delete Model Snapshot API request. +// type MLDeleteModelSnapshotRequest struct { JobID string SnapshotID string @@ -58,6 +60,7 @@ type MLDeleteModelSnapshotRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f MLDeleteModelSnapshot) WithContext(v context.Context) func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f MLDeleteModelSnapshot) WithContext(v context.Context) func(*MLDeleteMode } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteModelSnapshot) WithPretty() func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f MLDeleteModelSnapshot) WithPretty() func(*MLDeleteModelSnapshotRequest) } // WithHuman makes statistical values human-readable. +// func (f MLDeleteModelSnapshot) WithHuman() func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f MLDeleteModelSnapshot) WithHuman() func(*MLDeleteModelSnapshotRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteModelSnapshot) WithErrorTrace() func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f MLDeleteModelSnapshot) WithErrorTrace() func(*MLDeleteModelSnapshotReque } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteModelSnapshot) WithFilterPath(v ...string) func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f MLDeleteModelSnapshot) WithFilterPath(v ...string) func(*MLDeleteModelSn } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteModelSnapshot) WithHeader(h map[string]string) func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f MLDeleteModelSnapshot) WithHeader(h map[string]string) func(*MLDeleteMod } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteModelSnapshot) WithOpaqueID(s string) func(*MLDeleteModelSnapshotRequest) { return func(r *MLDeleteModelSnapshotRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model.go index 40187b4bc64..8ba00bc7acb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteTrainedModelFunc(t Transport) MLDeleteTrainedModel { // MLDeleteTrainedModel - Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html. +// type MLDeleteTrainedModel func(model_id string, o ...func(*MLDeleteTrainedModelRequest)) (*Response, error) // MLDeleteTrainedModelRequest configures the ML Delete Trained Model API request. +// type MLDeleteTrainedModelRequest struct { ModelID string @@ -57,6 +59,7 @@ type MLDeleteTrainedModelRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteTrainedModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r MLDeleteTrainedModelRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f MLDeleteTrainedModel) WithContext(v context.Context) func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLDeleteTrainedModel) WithContext(v context.Context) func(*MLDeleteTrain } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteTrainedModel) WithPretty() func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLDeleteTrainedModel) WithPretty() func(*MLDeleteTrainedModelRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLDeleteTrainedModel) WithHuman() func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLDeleteTrainedModel) WithHuman() func(*MLDeleteTrainedModelRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteTrainedModel) WithErrorTrace() func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLDeleteTrainedModel) WithErrorTrace() func(*MLDeleteTrainedModelRequest } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteTrainedModel) WithFilterPath(v ...string) func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLDeleteTrainedModel) WithFilterPath(v ...string) func(*MLDeleteTrainedM } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteTrainedModel) WithHeader(h map[string]string) func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLDeleteTrainedModel) WithHeader(h map[string]string) func(*MLDeleteTrai } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteTrainedModel) WithOpaqueID(s string) func(*MLDeleteTrainedModelRequest) { return func(r *MLDeleteTrainedModelRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model_alias.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model_alias.go index 712bd037c79..8e201651179 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.delete_trained_model_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLDeleteTrainedModelAliasFunc(t Transport) MLDeleteTrainedModelAlias { // MLDeleteTrainedModelAlias - Deletes a model alias that refers to the trained model // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html. +// type MLDeleteTrainedModelAlias func(model_alias string, model_id string, o ...func(*MLDeleteTrainedModelAliasRequest)) (*Response, error) // MLDeleteTrainedModelAliasRequest configures the ML Delete Trained Model Alias API request. +// type MLDeleteTrainedModelAliasRequest struct { ModelAlias string ModelID string @@ -58,6 +60,7 @@ type MLDeleteTrainedModelAliasRequest struct { } // Do executes the request and returns response or error. +// func (r MLDeleteTrainedModelAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r MLDeleteTrainedModelAliasRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f MLDeleteTrainedModelAlias) WithContext(v context.Context) func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f MLDeleteTrainedModelAlias) WithContext(v context.Context) func(*MLDelete } // WithPretty makes the response body pretty-printed. +// func (f MLDeleteTrainedModelAlias) WithPretty() func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f MLDeleteTrainedModelAlias) WithPretty() func(*MLDeleteTrainedModelAliasR } // WithHuman makes statistical values human-readable. +// func (f MLDeleteTrainedModelAlias) WithHuman() func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f MLDeleteTrainedModelAlias) WithHuman() func(*MLDeleteTrainedModelAliasRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLDeleteTrainedModelAlias) WithErrorTrace() func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f MLDeleteTrainedModelAlias) WithErrorTrace() func(*MLDeleteTrainedModelAl } // WithFilterPath filters the properties of the response body. +// func (f MLDeleteTrainedModelAlias) WithFilterPath(v ...string) func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f MLDeleteTrainedModelAlias) WithFilterPath(v ...string) func(*MLDeleteTra } // WithHeader adds the headers to the HTTP request. +// func (f MLDeleteTrainedModelAlias) WithHeader(h map[string]string) func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f MLDeleteTrainedModelAlias) WithHeader(h map[string]string) func(*MLDelet } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLDeleteTrainedModelAlias) WithOpaqueID(s string) func(*MLDeleteTrainedModelAliasRequest) { return func(r *MLDeleteTrainedModelAliasRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.estimate_model_memory.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.estimate_model_memory.go index 8d5df195856..25a2d5a1cfd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.estimate_model_memory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.estimate_model_memory.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLEstimateModelMemoryFunc(t Transport) MLEstimateModelMemory { // MLEstimateModelMemory - Estimates the model memory // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html. +// type MLEstimateModelMemory func(body io.Reader, o ...func(*MLEstimateModelMemoryRequest)) (*Response, error) // MLEstimateModelMemoryRequest configures the ML Estimate Model Memory API request. +// type MLEstimateModelMemoryRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type MLEstimateModelMemoryRequest struct { } // Do executes the request and returns response or error. +// func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transpor 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 @@ -113,10 +120,6 @@ func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f MLEstimateModelMemory) WithContext(v context.Context) func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLEstimateModelMemory) WithContext(v context.Context) func(*MLEstimateMo } // WithPretty makes the response body pretty-printed. +// func (f MLEstimateModelMemory) WithPretty() func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLEstimateModelMemory) WithPretty() func(*MLEstimateModelMemoryRequest) } // WithHuman makes statistical values human-readable. +// func (f MLEstimateModelMemory) WithHuman() func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLEstimateModelMemory) WithHuman() func(*MLEstimateModelMemoryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLEstimateModelMemory) WithErrorTrace() func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLEstimateModelMemory) WithErrorTrace() func(*MLEstimateModelMemoryReque } // WithFilterPath filters the properties of the response body. +// func (f MLEstimateModelMemory) WithFilterPath(v ...string) func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLEstimateModelMemory) WithFilterPath(v ...string) func(*MLEstimateModel } // WithHeader adds the headers to the HTTP request. +// func (f MLEstimateModelMemory) WithHeader(h map[string]string) func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLEstimateModelMemory) WithHeader(h map[string]string) func(*MLEstimateM } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLEstimateModelMemory) WithOpaqueID(s string) func(*MLEstimateModelMemoryRequest) { return func(r *MLEstimateModelMemoryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.evaluate_data_frame.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.evaluate_data_frame.go index 900c51ed602..b0deba68d93 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.evaluate_data_frame.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLEvaluateDataFrameFunc(t Transport) MLEvaluateDataFrame { // MLEvaluateDataFrame - Evaluates the data frame analytics for an annotated index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html. +// type MLEvaluateDataFrame func(body io.Reader, o ...func(*MLEvaluateDataFrameRequest)) (*Response, error) // MLEvaluateDataFrameRequest configures the ML Evaluate Data Frame API request. +// type MLEvaluateDataFrameRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type MLEvaluateDataFrameRequest struct { } // Do executes the request and returns response or error. +// func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) 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 @@ -113,10 +120,6 @@ func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLEvaluateDataFrame) WithContext(v context.Context) func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLEvaluateDataFrame) WithContext(v context.Context) func(*MLEvaluateData } // WithPretty makes the response body pretty-printed. +// func (f MLEvaluateDataFrame) WithPretty() func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLEvaluateDataFrame) WithPretty() func(*MLEvaluateDataFrameRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLEvaluateDataFrame) WithHuman() func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLEvaluateDataFrame) WithHuman() func(*MLEvaluateDataFrameRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLEvaluateDataFrame) WithErrorTrace() func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLEvaluateDataFrame) WithErrorTrace() func(*MLEvaluateDataFrameRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLEvaluateDataFrame) WithFilterPath(v ...string) func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLEvaluateDataFrame) WithFilterPath(v ...string) func(*MLEvaluateDataFra } // WithHeader adds the headers to the HTTP request. +// func (f MLEvaluateDataFrame) WithHeader(h map[string]string) func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLEvaluateDataFrame) WithHeader(h map[string]string) func(*MLEvaluateDat } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLEvaluateDataFrame) WithOpaqueID(s string) func(*MLEvaluateDataFrameRequest) { return func(r *MLEvaluateDataFrameRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.explain_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.explain_data_frame_analytics.go index 5ad3734bffb..caced1a2218 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.explain_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.explain_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLExplainDataFrameAnalyticsFunc(t Transport) MLExplainDataFrameAnalytics // MLExplainDataFrameAnalytics - Explains a data frame analytics config. // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html. +// type MLExplainDataFrameAnalytics func(o ...func(*MLExplainDataFrameAnalyticsRequest)) (*Response, error) // MLExplainDataFrameAnalyticsRequest configures the ML Explain Data Frame Analytics API request. +// type MLExplainDataFrameAnalyticsRequest struct { DocumentID string @@ -60,6 +62,7 @@ type MLExplainDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -114,6 +117,10 @@ func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr 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 @@ -126,10 +133,6 @@ func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -149,6 +152,7 @@ func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr } // WithContext sets the request context. +// func (f MLExplainDataFrameAnalytics) WithContext(v context.Context) func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f MLExplainDataFrameAnalytics) WithContext(v context.Context) func(*MLExpl } // WithBody - The data frame analytics config to explain. +// func (f MLExplainDataFrameAnalytics) WithBody(v io.Reader) func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.Body = v @@ -163,6 +168,7 @@ func (f MLExplainDataFrameAnalytics) WithBody(v io.Reader) func(*MLExplainDataFr } // WithDocumentID - the ID of the data frame analytics to explain. +// func (f MLExplainDataFrameAnalytics) WithDocumentID(v string) func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.DocumentID = v @@ -170,6 +176,7 @@ func (f MLExplainDataFrameAnalytics) WithDocumentID(v string) func(*MLExplainDat } // WithPretty makes the response body pretty-printed. +// func (f MLExplainDataFrameAnalytics) WithPretty() func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.Pretty = true @@ -177,6 +184,7 @@ func (f MLExplainDataFrameAnalytics) WithPretty() func(*MLExplainDataFrameAnalyt } // WithHuman makes statistical values human-readable. +// func (f MLExplainDataFrameAnalytics) WithHuman() func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.Human = true @@ -184,6 +192,7 @@ func (f MLExplainDataFrameAnalytics) WithHuman() func(*MLExplainDataFrameAnalyti } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLExplainDataFrameAnalytics) WithErrorTrace() func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -191,6 +200,7 @@ func (f MLExplainDataFrameAnalytics) WithErrorTrace() func(*MLExplainDataFrameAn } // WithFilterPath filters the properties of the response body. +// func (f MLExplainDataFrameAnalytics) WithFilterPath(v ...string) func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { r.FilterPath = v @@ -198,6 +208,7 @@ func (f MLExplainDataFrameAnalytics) WithFilterPath(v ...string) func(*MLExplain } // WithHeader adds the headers to the HTTP request. +// func (f MLExplainDataFrameAnalytics) WithHeader(h map[string]string) func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { if r.Header == nil { @@ -210,6 +221,7 @@ func (f MLExplainDataFrameAnalytics) WithHeader(h map[string]string) func(*MLExp } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLExplainDataFrameAnalytics) WithOpaqueID(s string) func(*MLExplainDataFrameAnalyticsRequest) { return func(r *MLExplainDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.find_file_structure.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.find_file_structure.go index 800262a8ed1..bca5a9888db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.find_file_structure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.find_file_structure.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -45,9 +45,11 @@ func newMLFindFileStructureFunc(t Transport) MLFindFileStructure { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html. +// type MLFindFileStructure func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error) // MLFindFileStructureRequest configures the ML Find File Structure API request. +// type MLFindFileStructureRequest struct { Body io.Reader @@ -77,6 +79,7 @@ type MLFindFileStructureRequest struct { } // Do executes the request and returns response or error. +// func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -176,6 +179,10 @@ func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) 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 @@ -188,10 +195,6 @@ func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -211,6 +214,7 @@ func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLFindFileStructure) WithContext(v context.Context) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.ctx = v @@ -218,6 +222,7 @@ func (f MLFindFileStructure) WithContext(v context.Context) func(*MLFindFileStru } // WithCharset - optional parameter to specify the character set of the file. +// func (f MLFindFileStructure) WithCharset(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Charset = v @@ -225,6 +230,7 @@ func (f MLFindFileStructure) WithCharset(v string) func(*MLFindFileStructureRequ } // WithColumnNames - optional parameter containing a comma separated list of the column names for a delimited file. +// func (f MLFindFileStructure) WithColumnNames(v ...string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.ColumnNames = v @@ -232,6 +238,7 @@ func (f MLFindFileStructure) WithColumnNames(v ...string) func(*MLFindFileStruct } // WithDelimiter - optional parameter to specify the delimiter character for a delimited file - must be a single character. +// func (f MLFindFileStructure) WithDelimiter(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Delimiter = v @@ -239,6 +246,7 @@ func (f MLFindFileStructure) WithDelimiter(v string) func(*MLFindFileStructureRe } // WithExplain - whether to include a commentary on how the structure was derived. +// func (f MLFindFileStructure) WithExplain(v bool) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Explain = &v @@ -246,6 +254,7 @@ func (f MLFindFileStructure) WithExplain(v bool) func(*MLFindFileStructureReques } // WithFormat - optional parameter to specify the high level file format. +// func (f MLFindFileStructure) WithFormat(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Format = v @@ -253,6 +262,7 @@ func (f MLFindFileStructure) WithFormat(v string) func(*MLFindFileStructureReque } // WithGrokPattern - optional parameter to specify the grok pattern that should be used to extract fields from messages in a semi-structured text file. +// func (f MLFindFileStructure) WithGrokPattern(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.GrokPattern = v @@ -260,6 +270,7 @@ func (f MLFindFileStructure) WithGrokPattern(v string) func(*MLFindFileStructure } // WithHasHeaderRow - optional parameter to specify whether a delimited file includes the column names in its first row. +// func (f MLFindFileStructure) WithHasHeaderRow(v bool) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.HasHeaderRow = &v @@ -267,6 +278,7 @@ func (f MLFindFileStructure) WithHasHeaderRow(v bool) func(*MLFindFileStructureR } // WithLineMergeSizeLimit - maximum number of characters permitted in a single message when lines are merged to create messages.. +// func (f MLFindFileStructure) WithLineMergeSizeLimit(v int) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.LineMergeSizeLimit = &v @@ -274,6 +286,7 @@ func (f MLFindFileStructure) WithLineMergeSizeLimit(v int) func(*MLFindFileStruc } // WithLinesToSample - how many lines of the file should be included in the analysis. +// func (f MLFindFileStructure) WithLinesToSample(v int) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.LinesToSample = &v @@ -281,6 +294,7 @@ func (f MLFindFileStructure) WithLinesToSample(v int) func(*MLFindFileStructureR } // WithQuote - optional parameter to specify the quote character for a delimited file - must be a single character. +// func (f MLFindFileStructure) WithQuote(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Quote = v @@ -288,6 +302,7 @@ func (f MLFindFileStructure) WithQuote(v string) func(*MLFindFileStructureReques } // WithShouldTrimFields - optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them. +// func (f MLFindFileStructure) WithShouldTrimFields(v bool) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.ShouldTrimFields = &v @@ -295,6 +310,7 @@ func (f MLFindFileStructure) WithShouldTrimFields(v bool) func(*MLFindFileStruct } // WithTimeout - timeout after which the analysis will be aborted. +// func (f MLFindFileStructure) WithTimeout(v time.Duration) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Timeout = v @@ -302,6 +318,7 @@ func (f MLFindFileStructure) WithTimeout(v time.Duration) func(*MLFindFileStruct } // WithTimestampField - optional parameter to specify the timestamp field in the file. +// func (f MLFindFileStructure) WithTimestampField(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.TimestampField = v @@ -309,6 +326,7 @@ func (f MLFindFileStructure) WithTimestampField(v string) func(*MLFindFileStruct } // WithTimestampFormat - optional parameter to specify the timestamp format in the file - may be either a joda or java time format. +// func (f MLFindFileStructure) WithTimestampFormat(v string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.TimestampFormat = v @@ -316,6 +334,7 @@ func (f MLFindFileStructure) WithTimestampFormat(v string) func(*MLFindFileStruc } // WithPretty makes the response body pretty-printed. +// func (f MLFindFileStructure) WithPretty() func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Pretty = true @@ -323,6 +342,7 @@ func (f MLFindFileStructure) WithPretty() func(*MLFindFileStructureRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLFindFileStructure) WithHuman() func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.Human = true @@ -330,6 +350,7 @@ func (f MLFindFileStructure) WithHuman() func(*MLFindFileStructureRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLFindFileStructure) WithErrorTrace() func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.ErrorTrace = true @@ -337,6 +358,7 @@ func (f MLFindFileStructure) WithErrorTrace() func(*MLFindFileStructureRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLFindFileStructure) WithFilterPath(v ...string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { r.FilterPath = v @@ -344,6 +366,7 @@ func (f MLFindFileStructure) WithFilterPath(v ...string) func(*MLFindFileStructu } // WithHeader adds the headers to the HTTP request. +// func (f MLFindFileStructure) WithHeader(h map[string]string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { if r.Header == nil { @@ -356,6 +379,7 @@ func (f MLFindFileStructure) WithHeader(h map[string]string) func(*MLFindFileStr } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLFindFileStructure) WithOpaqueID(s string) func(*MLFindFileStructureRequest) { return func(r *MLFindFileStructureRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.flush_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.flush_job.go index c64589801ff..0ee7f2423f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.flush_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.flush_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLFlushJobFunc(t Transport) MLFlushJob { // MLFlushJob - Forces any buffered data to be processed by the job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html. +// type MLFlushJob func(job_id string, o ...func(*MLFlushJobRequest)) (*Response, error) // MLFlushJobRequest configures the ML Flush Job API request. +// type MLFlushJobRequest struct { Body io.Reader @@ -67,6 +69,7 @@ type MLFlushJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -137,6 +140,10 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon 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 @@ -149,10 +156,6 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -172,6 +175,7 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f MLFlushJob) WithContext(v context.Context) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.ctx = v @@ -179,6 +183,7 @@ func (f MLFlushJob) WithContext(v context.Context) func(*MLFlushJobRequest) { } // WithBody - Flush parameters. +// func (f MLFlushJob) WithBody(v io.Reader) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.Body = v @@ -186,6 +191,7 @@ func (f MLFlushJob) WithBody(v io.Reader) func(*MLFlushJobRequest) { } // WithAdvanceTime - advances time to the given value generating results and updating the model for the advanced interval. +// func (f MLFlushJob) WithAdvanceTime(v string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.AdvanceTime = v @@ -193,6 +199,7 @@ func (f MLFlushJob) WithAdvanceTime(v string) func(*MLFlushJobRequest) { } // WithCalcInterim - calculates interim results for the most recent bucket or all buckets within the latency period. +// func (f MLFlushJob) WithCalcInterim(v bool) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.CalcInterim = &v @@ -200,6 +207,7 @@ func (f MLFlushJob) WithCalcInterim(v bool) func(*MLFlushJobRequest) { } // WithEnd - when used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results. +// func (f MLFlushJob) WithEnd(v string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.End = v @@ -207,6 +215,7 @@ func (f MLFlushJob) WithEnd(v string) func(*MLFlushJobRequest) { } // WithSkipTime - skips time to the given value without generating results or updating the model for the skipped interval. +// func (f MLFlushJob) WithSkipTime(v string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.SkipTime = v @@ -214,6 +223,7 @@ func (f MLFlushJob) WithSkipTime(v string) func(*MLFlushJobRequest) { } // WithStart - when used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results. +// func (f MLFlushJob) WithStart(v string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.Start = v @@ -221,6 +231,7 @@ func (f MLFlushJob) WithStart(v string) func(*MLFlushJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLFlushJob) WithPretty() func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.Pretty = true @@ -228,6 +239,7 @@ func (f MLFlushJob) WithPretty() func(*MLFlushJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLFlushJob) WithHuman() func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.Human = true @@ -235,6 +247,7 @@ func (f MLFlushJob) WithHuman() func(*MLFlushJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLFlushJob) WithErrorTrace() func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.ErrorTrace = true @@ -242,6 +255,7 @@ func (f MLFlushJob) WithErrorTrace() func(*MLFlushJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLFlushJob) WithFilterPath(v ...string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.FilterPath = v @@ -249,6 +263,7 @@ func (f MLFlushJob) WithFilterPath(v ...string) func(*MLFlushJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLFlushJob) WithHeader(h map[string]string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { if r.Header == nil { @@ -261,6 +276,7 @@ func (f MLFlushJob) WithHeader(h map[string]string) func(*MLFlushJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLFlushJob) WithOpaqueID(s string) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.forecast.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.forecast.go index 181a150d3cb..add35f50933 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.forecast.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLForecastFunc(t Transport) MLForecast { // MLForecast - Predicts the future behavior of a time series by using its historical behavior. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html. +// type MLForecast func(job_id string, o ...func(*MLForecastRequest)) (*Response, error) // MLForecastRequest configures the ML Forecast API request. +// type MLForecastRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type MLForecastRequest struct { } // Do executes the request and returns response or error. +// func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -127,6 +130,10 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon 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 @@ -139,10 +146,6 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -162,6 +165,7 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f MLForecast) WithContext(v context.Context) func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f MLForecast) WithContext(v context.Context) func(*MLForecastRequest) { } // WithBody - Query parameters can be specified in the body. +// func (f MLForecast) WithBody(v io.Reader) func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.Body = v @@ -176,6 +181,7 @@ func (f MLForecast) WithBody(v io.Reader) func(*MLForecastRequest) { } // WithDuration - the duration of the forecast. +// func (f MLForecast) WithDuration(v time.Duration) func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.Duration = v @@ -183,6 +189,7 @@ func (f MLForecast) WithDuration(v time.Duration) func(*MLForecastRequest) { } // WithExpiresIn - the time interval after which the forecast expires. expired forecasts will be deleted at the first opportunity.. +// func (f MLForecast) WithExpiresIn(v time.Duration) func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.ExpiresIn = v @@ -190,6 +197,7 @@ func (f MLForecast) WithExpiresIn(v time.Duration) func(*MLForecastRequest) { } // WithMaxModelMemory - the max memory able to be used by the forecast. default is 20mb.. +// func (f MLForecast) WithMaxModelMemory(v string) func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.MaxModelMemory = v @@ -197,6 +205,7 @@ func (f MLForecast) WithMaxModelMemory(v string) func(*MLForecastRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLForecast) WithPretty() func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.Pretty = true @@ -204,6 +213,7 @@ func (f MLForecast) WithPretty() func(*MLForecastRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLForecast) WithHuman() func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.Human = true @@ -211,6 +221,7 @@ func (f MLForecast) WithHuman() func(*MLForecastRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLForecast) WithErrorTrace() func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.ErrorTrace = true @@ -218,6 +229,7 @@ func (f MLForecast) WithErrorTrace() func(*MLForecastRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLForecast) WithFilterPath(v ...string) func(*MLForecastRequest) { return func(r *MLForecastRequest) { r.FilterPath = v @@ -225,6 +237,7 @@ func (f MLForecast) WithFilterPath(v ...string) func(*MLForecastRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLForecast) WithHeader(h map[string]string) func(*MLForecastRequest) { return func(r *MLForecastRequest) { if r.Header == nil { @@ -237,6 +250,7 @@ func (f MLForecast) WithHeader(h map[string]string) func(*MLForecastRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLForecast) WithOpaqueID(s string) func(*MLForecastRequest) { return func(r *MLForecastRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_buckets.go index 7ba6a92c70d..22662025331 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_buckets.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLGetBucketsFunc(t Transport) MLGetBuckets { // MLGetBuckets - Retrieves anomaly detection job results for one or more buckets. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html. +// type MLGetBuckets func(job_id string, o ...func(*MLGetBucketsRequest)) (*Response, error) // MLGetBucketsRequest configures the ML Get Buckets API request. +// type MLGetBucketsRequest struct { Body io.Reader @@ -73,6 +75,7 @@ type MLGetBucketsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -165,6 +168,10 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -177,10 +184,6 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -200,6 +203,7 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f MLGetBuckets) WithContext(v context.Context) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.ctx = v @@ -207,6 +211,7 @@ func (f MLGetBuckets) WithContext(v context.Context) func(*MLGetBucketsRequest) } // WithBody - Bucket selection details if not provided in URI. +// func (f MLGetBuckets) WithBody(v io.Reader) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Body = v @@ -214,6 +219,7 @@ func (f MLGetBuckets) WithBody(v io.Reader) func(*MLGetBucketsRequest) { } // WithTimestamp - the timestamp of the desired single bucket result. +// func (f MLGetBuckets) WithTimestamp(v string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Timestamp = v @@ -221,6 +227,7 @@ func (f MLGetBuckets) WithTimestamp(v string) func(*MLGetBucketsRequest) { } // WithAnomalyScore - filter for the most anomalous buckets. +// func (f MLGetBuckets) WithAnomalyScore(v interface{}) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.AnomalyScore = v @@ -228,6 +235,7 @@ func (f MLGetBuckets) WithAnomalyScore(v interface{}) func(*MLGetBucketsRequest) } // WithDesc - set the sort direction. +// func (f MLGetBuckets) WithDesc(v bool) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Desc = &v @@ -235,6 +243,7 @@ func (f MLGetBuckets) WithDesc(v bool) func(*MLGetBucketsRequest) { } // WithEnd - end time filter for buckets. +// func (f MLGetBuckets) WithEnd(v string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.End = v @@ -242,6 +251,7 @@ func (f MLGetBuckets) WithEnd(v string) func(*MLGetBucketsRequest) { } // WithExcludeInterim - exclude interim results. +// func (f MLGetBuckets) WithExcludeInterim(v bool) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.ExcludeInterim = &v @@ -249,6 +259,7 @@ func (f MLGetBuckets) WithExcludeInterim(v bool) func(*MLGetBucketsRequest) { } // WithExpand - include anomaly records. +// func (f MLGetBuckets) WithExpand(v bool) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Expand = &v @@ -256,6 +267,7 @@ func (f MLGetBuckets) WithExpand(v bool) func(*MLGetBucketsRequest) { } // WithFrom - skips a number of buckets. +// func (f MLGetBuckets) WithFrom(v int) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.From = &v @@ -263,6 +275,7 @@ func (f MLGetBuckets) WithFrom(v int) func(*MLGetBucketsRequest) { } // WithSize - specifies a max number of buckets to get. +// func (f MLGetBuckets) WithSize(v int) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Size = &v @@ -270,6 +283,7 @@ func (f MLGetBuckets) WithSize(v int) func(*MLGetBucketsRequest) { } // WithSort - sort buckets by a particular field. +// func (f MLGetBuckets) WithSort(v string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Sort = v @@ -277,6 +291,7 @@ func (f MLGetBuckets) WithSort(v string) func(*MLGetBucketsRequest) { } // WithStart - start time filter for buckets. +// func (f MLGetBuckets) WithStart(v string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Start = v @@ -284,6 +299,7 @@ func (f MLGetBuckets) WithStart(v string) func(*MLGetBucketsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetBuckets) WithPretty() func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Pretty = true @@ -291,6 +307,7 @@ func (f MLGetBuckets) WithPretty() func(*MLGetBucketsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetBuckets) WithHuman() func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Human = true @@ -298,6 +315,7 @@ func (f MLGetBuckets) WithHuman() func(*MLGetBucketsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetBuckets) WithErrorTrace() func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.ErrorTrace = true @@ -305,6 +323,7 @@ func (f MLGetBuckets) WithErrorTrace() func(*MLGetBucketsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetBuckets) WithFilterPath(v ...string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.FilterPath = v @@ -312,6 +331,7 @@ func (f MLGetBuckets) WithFilterPath(v ...string) func(*MLGetBucketsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLGetBuckets) WithHeader(h map[string]string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { if r.Header == nil { @@ -324,6 +344,7 @@ func (f MLGetBuckets) WithHeader(h map[string]string) func(*MLGetBucketsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetBuckets) WithOpaqueID(s string) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendar_events.go index a07dc7f7fe5..d93220d0786 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendar_events.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLGetCalendarEventsFunc(t Transport) MLGetCalendarEvents { // MLGetCalendarEvents - Retrieves information about the scheduled events in calendars. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html. +// type MLGetCalendarEvents func(calendar_id string, o ...func(*MLGetCalendarEventsRequest)) (*Response, error) // MLGetCalendarEventsRequest configures the ML Get Calendar Events API request. +// type MLGetCalendarEventsRequest struct { CalendarID string @@ -65,6 +67,7 @@ type MLGetCalendarEventsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -166,6 +169,7 @@ func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLGetCalendarEvents) WithContext(v context.Context) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.ctx = v @@ -173,6 +177,7 @@ func (f MLGetCalendarEvents) WithContext(v context.Context) func(*MLGetCalendarE } // WithEnd - get events before this time. +// func (f MLGetCalendarEvents) WithEnd(v interface{}) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.End = v @@ -180,6 +185,7 @@ func (f MLGetCalendarEvents) WithEnd(v interface{}) func(*MLGetCalendarEventsReq } // WithFrom - skips a number of events. +// func (f MLGetCalendarEvents) WithFrom(v int) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.From = &v @@ -187,6 +193,7 @@ func (f MLGetCalendarEvents) WithFrom(v int) func(*MLGetCalendarEventsRequest) { } // WithJobID - get events for the job. when this option is used calendar_id must be '_all'. +// func (f MLGetCalendarEvents) WithJobID(v string) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.JobID = v @@ -194,6 +201,7 @@ func (f MLGetCalendarEvents) WithJobID(v string) func(*MLGetCalendarEventsReques } // WithSize - specifies a max number of events to get. +// func (f MLGetCalendarEvents) WithSize(v int) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.Size = &v @@ -201,6 +209,7 @@ func (f MLGetCalendarEvents) WithSize(v int) func(*MLGetCalendarEventsRequest) { } // WithStart - get events after this time. +// func (f MLGetCalendarEvents) WithStart(v string) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.Start = v @@ -208,6 +217,7 @@ func (f MLGetCalendarEvents) WithStart(v string) func(*MLGetCalendarEventsReques } // WithPretty makes the response body pretty-printed. +// func (f MLGetCalendarEvents) WithPretty() func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.Pretty = true @@ -215,6 +225,7 @@ func (f MLGetCalendarEvents) WithPretty() func(*MLGetCalendarEventsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetCalendarEvents) WithHuman() func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.Human = true @@ -222,6 +233,7 @@ func (f MLGetCalendarEvents) WithHuman() func(*MLGetCalendarEventsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetCalendarEvents) WithErrorTrace() func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.ErrorTrace = true @@ -229,6 +241,7 @@ func (f MLGetCalendarEvents) WithErrorTrace() func(*MLGetCalendarEventsRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLGetCalendarEvents) WithFilterPath(v ...string) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.FilterPath = v @@ -236,6 +249,7 @@ func (f MLGetCalendarEvents) WithFilterPath(v ...string) func(*MLGetCalendarEven } // WithHeader adds the headers to the HTTP request. +// func (f MLGetCalendarEvents) WithHeader(h map[string]string) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { if r.Header == nil { @@ -248,6 +262,7 @@ func (f MLGetCalendarEvents) WithHeader(h map[string]string) func(*MLGetCalendar } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetCalendarEvents) WithOpaqueID(s string) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendars.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendars.go index 2ec501c176b..d02ff4ea4e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendars.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_calendars.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLGetCalendarsFunc(t Transport) MLGetCalendars { // MLGetCalendars - Retrieves configuration information for calendars. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html. +// type MLGetCalendars func(o ...func(*MLGetCalendarsRequest)) (*Response, error) // MLGetCalendarsRequest configures the ML Get Calendars API request. +// type MLGetCalendarsRequest struct { Body io.Reader @@ -64,6 +66,7 @@ type MLGetCalendarsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -122,6 +125,10 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -134,10 +141,6 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -157,6 +160,7 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f MLGetCalendars) WithContext(v context.Context) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.ctx = v @@ -164,6 +168,7 @@ func (f MLGetCalendars) WithContext(v context.Context) func(*MLGetCalendarsReque } // WithBody - The from and size parameters optionally sent in the body. +// func (f MLGetCalendars) WithBody(v io.Reader) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.Body = v @@ -171,6 +176,7 @@ func (f MLGetCalendars) WithBody(v io.Reader) func(*MLGetCalendarsRequest) { } // WithCalendarID - the ID of the calendar to fetch. +// func (f MLGetCalendars) WithCalendarID(v string) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.CalendarID = v @@ -178,6 +184,7 @@ func (f MLGetCalendars) WithCalendarID(v string) func(*MLGetCalendarsRequest) { } // WithFrom - skips a number of calendars. +// func (f MLGetCalendars) WithFrom(v int) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.From = &v @@ -185,6 +192,7 @@ func (f MLGetCalendars) WithFrom(v int) func(*MLGetCalendarsRequest) { } // WithSize - specifies a max number of calendars to get. +// func (f MLGetCalendars) WithSize(v int) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.Size = &v @@ -192,6 +200,7 @@ func (f MLGetCalendars) WithSize(v int) func(*MLGetCalendarsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetCalendars) WithPretty() func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.Pretty = true @@ -199,6 +208,7 @@ func (f MLGetCalendars) WithPretty() func(*MLGetCalendarsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetCalendars) WithHuman() func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.Human = true @@ -206,6 +216,7 @@ func (f MLGetCalendars) WithHuman() func(*MLGetCalendarsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetCalendars) WithErrorTrace() func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.ErrorTrace = true @@ -213,6 +224,7 @@ func (f MLGetCalendars) WithErrorTrace() func(*MLGetCalendarsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetCalendars) WithFilterPath(v ...string) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { r.FilterPath = v @@ -220,6 +232,7 @@ func (f MLGetCalendars) WithFilterPath(v ...string) func(*MLGetCalendarsRequest) } // WithHeader adds the headers to the HTTP request. +// func (f MLGetCalendars) WithHeader(h map[string]string) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { if r.Header == nil { @@ -232,6 +245,7 @@ func (f MLGetCalendars) WithHeader(h map[string]string) func(*MLGetCalendarsRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetCalendars) WithOpaqueID(s string) func(*MLGetCalendarsRequest) { return func(r *MLGetCalendarsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_categories.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_categories.go index 7277c963f06..48dbd6df63d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_categories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_categories.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLGetCategoriesFunc(t Transport) MLGetCategories { // MLGetCategories - Retrieves anomaly detection job results for one or more categories. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html. +// type MLGetCategories func(job_id string, o ...func(*MLGetCategoriesRequest)) (*Response, error) // MLGetCategoriesRequest configures the ML Get Categories API request. +// type MLGetCategoriesRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type MLGetCategoriesRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,10 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -148,10 +155,6 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -171,6 +174,7 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f MLGetCategories) WithContext(v context.Context) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.ctx = v @@ -178,6 +182,7 @@ func (f MLGetCategories) WithContext(v context.Context) func(*MLGetCategoriesReq } // WithBody - Category selection details if not provided in URI. +// func (f MLGetCategories) WithBody(v io.Reader) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.Body = v @@ -185,6 +190,7 @@ func (f MLGetCategories) WithBody(v io.Reader) func(*MLGetCategoriesRequest) { } // WithCategoryID - the identifier of the category definition of interest. +// func (f MLGetCategories) WithCategoryID(v int) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.CategoryID = &v @@ -192,6 +198,7 @@ func (f MLGetCategories) WithCategoryID(v int) func(*MLGetCategoriesRequest) { } // WithFrom - skips a number of categories. +// func (f MLGetCategories) WithFrom(v int) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.From = &v @@ -199,6 +206,7 @@ func (f MLGetCategories) WithFrom(v int) func(*MLGetCategoriesRequest) { } // WithPartitionFieldValue - specifies the partition to retrieve categories for. this is optional, and should never be used for jobs where per-partition categorization is disabled.. +// func (f MLGetCategories) WithPartitionFieldValue(v string) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.PartitionFieldValue = v @@ -206,6 +214,7 @@ func (f MLGetCategories) WithPartitionFieldValue(v string) func(*MLGetCategories } // WithSize - specifies a max number of categories to get. +// func (f MLGetCategories) WithSize(v int) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.Size = &v @@ -213,6 +222,7 @@ func (f MLGetCategories) WithSize(v int) func(*MLGetCategoriesRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetCategories) WithPretty() func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.Pretty = true @@ -220,6 +230,7 @@ func (f MLGetCategories) WithPretty() func(*MLGetCategoriesRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetCategories) WithHuman() func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.Human = true @@ -227,6 +238,7 @@ func (f MLGetCategories) WithHuman() func(*MLGetCategoriesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetCategories) WithErrorTrace() func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.ErrorTrace = true @@ -234,6 +246,7 @@ func (f MLGetCategories) WithErrorTrace() func(*MLGetCategoriesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetCategories) WithFilterPath(v ...string) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { r.FilterPath = v @@ -241,6 +254,7 @@ func (f MLGetCategories) WithFilterPath(v ...string) func(*MLGetCategoriesReques } // WithHeader adds the headers to the HTTP request. +// func (f MLGetCategories) WithHeader(h map[string]string) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { if r.Header == nil { @@ -253,6 +267,7 @@ func (f MLGetCategories) WithHeader(h map[string]string) func(*MLGetCategoriesRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetCategories) WithOpaqueID(s string) func(*MLGetCategoriesRequest) { return func(r *MLGetCategoriesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics.go index f32c46e83bf..7f969c753e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetDataFrameAnalyticsFunc(t Transport) MLGetDataFrameAnalytics { // MLGetDataFrameAnalytics - Retrieves configuration information for data frame analytics jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html. +// type MLGetDataFrameAnalytics func(o ...func(*MLGetDataFrameAnalyticsRequest)) (*Response, error) // MLGetDataFrameAnalyticsRequest configures the ML Get Data Frame Analytics API request. +// type MLGetDataFrameAnalyticsRequest struct { ID string @@ -63,6 +65,7 @@ type MLGetDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -162,6 +165,7 @@ func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f MLGetDataFrameAnalytics) WithContext(v context.Context) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f MLGetDataFrameAnalytics) WithContext(v context.Context) func(*MLGetDataF } // WithID - the ID of the data frame analytics to fetch. +// func (f MLGetDataFrameAnalytics) WithID(v string) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.ID = v @@ -176,6 +181,7 @@ func (f MLGetDataFrameAnalytics) WithID(v string) func(*MLGetDataFrameAnalyticsR } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame analytics. (this includes `_all` string or when no data frame analytics have been specified). +// func (f MLGetDataFrameAnalytics) WithAllowNoMatch(v bool) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.AllowNoMatch = &v @@ -183,6 +189,7 @@ func (f MLGetDataFrameAnalytics) WithAllowNoMatch(v bool) func(*MLGetDataFrameAn } // WithExcludeGenerated - omits fields that are illegal to set on data frame analytics put. +// func (f MLGetDataFrameAnalytics) WithExcludeGenerated(v bool) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.ExcludeGenerated = &v @@ -190,6 +197,7 @@ func (f MLGetDataFrameAnalytics) WithExcludeGenerated(v bool) func(*MLGetDataFra } // WithFrom - skips a number of analytics. +// func (f MLGetDataFrameAnalytics) WithFrom(v int) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.From = &v @@ -197,6 +205,7 @@ func (f MLGetDataFrameAnalytics) WithFrom(v int) func(*MLGetDataFrameAnalyticsRe } // WithSize - specifies a max number of analytics to get. +// func (f MLGetDataFrameAnalytics) WithSize(v int) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.Size = &v @@ -204,6 +213,7 @@ func (f MLGetDataFrameAnalytics) WithSize(v int) func(*MLGetDataFrameAnalyticsRe } // WithPretty makes the response body pretty-printed. +// func (f MLGetDataFrameAnalytics) WithPretty() func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.Pretty = true @@ -211,6 +221,7 @@ func (f MLGetDataFrameAnalytics) WithPretty() func(*MLGetDataFrameAnalyticsReque } // WithHuman makes statistical values human-readable. +// func (f MLGetDataFrameAnalytics) WithHuman() func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.Human = true @@ -218,6 +229,7 @@ func (f MLGetDataFrameAnalytics) WithHuman() func(*MLGetDataFrameAnalyticsReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetDataFrameAnalytics) WithErrorTrace() func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -225,6 +237,7 @@ func (f MLGetDataFrameAnalytics) WithErrorTrace() func(*MLGetDataFrameAnalyticsR } // WithFilterPath filters the properties of the response body. +// func (f MLGetDataFrameAnalytics) WithFilterPath(v ...string) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { r.FilterPath = v @@ -232,6 +245,7 @@ func (f MLGetDataFrameAnalytics) WithFilterPath(v ...string) func(*MLGetDataFram } // WithHeader adds the headers to the HTTP request. +// func (f MLGetDataFrameAnalytics) WithHeader(h map[string]string) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { if r.Header == nil { @@ -244,6 +258,7 @@ func (f MLGetDataFrameAnalytics) WithHeader(h map[string]string) func(*MLGetData } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetDataFrameAnalytics) WithOpaqueID(s string) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index 88fad205dc5..13a40997eec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetDataFrameAnalyticsStatsFunc(t Transport) MLGetDataFrameAnalyticsSta // MLGetDataFrameAnalyticsStats - Retrieves usage information for data frame analytics jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html. +// type MLGetDataFrameAnalyticsStats func(o ...func(*MLGetDataFrameAnalyticsStatsRequest)) (*Response, error) // MLGetDataFrameAnalyticsStatsRequest configures the ML Get Data Frame Analytics Stats API request. +// type MLGetDataFrameAnalyticsStatsRequest struct { ID string @@ -63,6 +65,7 @@ type MLGetDataFrameAnalyticsStatsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -164,6 +167,7 @@ func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport T } // WithContext sets the request context. +// func (f MLGetDataFrameAnalyticsStats) WithContext(v context.Context) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.ctx = v @@ -171,6 +175,7 @@ func (f MLGetDataFrameAnalyticsStats) WithContext(v context.Context) func(*MLGet } // WithID - the ID of the data frame analytics stats to fetch. +// func (f MLGetDataFrameAnalyticsStats) WithID(v string) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.ID = v @@ -178,6 +183,7 @@ func (f MLGetDataFrameAnalyticsStats) WithID(v string) func(*MLGetDataFrameAnaly } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame analytics. (this includes `_all` string or when no data frame analytics have been specified). +// func (f MLGetDataFrameAnalyticsStats) WithAllowNoMatch(v bool) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.AllowNoMatch = &v @@ -185,6 +191,7 @@ func (f MLGetDataFrameAnalyticsStats) WithAllowNoMatch(v bool) func(*MLGetDataFr } // WithFrom - skips a number of analytics. +// func (f MLGetDataFrameAnalyticsStats) WithFrom(v int) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.From = &v @@ -192,6 +199,7 @@ func (f MLGetDataFrameAnalyticsStats) WithFrom(v int) func(*MLGetDataFrameAnalyt } // WithSize - specifies a max number of analytics to get. +// func (f MLGetDataFrameAnalyticsStats) WithSize(v int) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.Size = &v @@ -199,6 +207,7 @@ func (f MLGetDataFrameAnalyticsStats) WithSize(v int) func(*MLGetDataFrameAnalyt } // WithVerbose - whether the stats response should be verbose. +// func (f MLGetDataFrameAnalyticsStats) WithVerbose(v bool) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.Verbose = &v @@ -206,6 +215,7 @@ func (f MLGetDataFrameAnalyticsStats) WithVerbose(v bool) func(*MLGetDataFrameAn } // WithPretty makes the response body pretty-printed. +// func (f MLGetDataFrameAnalyticsStats) WithPretty() func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.Pretty = true @@ -213,6 +223,7 @@ func (f MLGetDataFrameAnalyticsStats) WithPretty() func(*MLGetDataFrameAnalytics } // WithHuman makes statistical values human-readable. +// func (f MLGetDataFrameAnalyticsStats) WithHuman() func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.Human = true @@ -220,6 +231,7 @@ func (f MLGetDataFrameAnalyticsStats) WithHuman() func(*MLGetDataFrameAnalyticsS } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetDataFrameAnalyticsStats) WithErrorTrace() func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.ErrorTrace = true @@ -227,6 +239,7 @@ func (f MLGetDataFrameAnalyticsStats) WithErrorTrace() func(*MLGetDataFrameAnaly } // WithFilterPath filters the properties of the response body. +// func (f MLGetDataFrameAnalyticsStats) WithFilterPath(v ...string) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { r.FilterPath = v @@ -234,6 +247,7 @@ func (f MLGetDataFrameAnalyticsStats) WithFilterPath(v ...string) func(*MLGetDat } // WithHeader adds the headers to the HTTP request. +// func (f MLGetDataFrameAnalyticsStats) WithHeader(h map[string]string) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { if r.Header == nil { @@ -246,6 +260,7 @@ func (f MLGetDataFrameAnalyticsStats) WithHeader(h map[string]string) func(*MLGe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetDataFrameAnalyticsStats) WithOpaqueID(s string) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeed_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeed_stats.go index 3715f0bd46b..bfcb4090cc8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeed_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetDatafeedStatsFunc(t Transport) MLGetDatafeedStats { // MLGetDatafeedStats - Retrieves usage information for datafeeds. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html. +// type MLGetDatafeedStats func(o ...func(*MLGetDatafeedStatsRequest)) (*Response, error) // MLGetDatafeedStatsRequest configures the ML Get Datafeed Stats API request. +// type MLGetDatafeedStatsRequest struct { DatafeedID string @@ -61,6 +63,7 @@ type MLGetDatafeedStatsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLGetDatafeedStats) WithContext(v context.Context) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f MLGetDatafeedStats) WithContext(v context.Context) func(*MLGetDatafeedSt } // WithDatafeedID - the ID of the datafeeds stats to fetch. +// func (f MLGetDatafeedStats) WithDatafeedID(v string) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.DatafeedID = v @@ -166,6 +171,7 @@ func (f MLGetDatafeedStats) WithDatafeedID(v string) func(*MLGetDatafeedStatsReq } // WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f MLGetDatafeedStats) WithAllowNoDatafeeds(v bool) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.AllowNoDatafeeds = &v @@ -173,6 +179,7 @@ func (f MLGetDatafeedStats) WithAllowNoDatafeeds(v bool) func(*MLGetDatafeedStat } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f MLGetDatafeedStats) WithAllowNoMatch(v bool) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.AllowNoMatch = &v @@ -180,6 +187,7 @@ func (f MLGetDatafeedStats) WithAllowNoMatch(v bool) func(*MLGetDatafeedStatsReq } // WithPretty makes the response body pretty-printed. +// func (f MLGetDatafeedStats) WithPretty() func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f MLGetDatafeedStats) WithPretty() func(*MLGetDatafeedStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetDatafeedStats) WithHuman() func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f MLGetDatafeedStats) WithHuman() func(*MLGetDatafeedStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetDatafeedStats) WithErrorTrace() func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f MLGetDatafeedStats) WithErrorTrace() func(*MLGetDatafeedStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetDatafeedStats) WithFilterPath(v ...string) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f MLGetDatafeedStats) WithFilterPath(v ...string) func(*MLGetDatafeedStats } // WithHeader adds the headers to the HTTP request. +// func (f MLGetDatafeedStats) WithHeader(h map[string]string) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f MLGetDatafeedStats) WithHeader(h map[string]string) func(*MLGetDatafeedS } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetDatafeedStats) WithOpaqueID(s string) func(*MLGetDatafeedStatsRequest) { return func(r *MLGetDatafeedStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeeds.go index a1c45ae51cc..78ac5ad8975 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_datafeeds.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetDatafeedsFunc(t Transport) MLGetDatafeeds { // MLGetDatafeeds - Retrieves configuration information for datafeeds. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html. +// type MLGetDatafeeds func(o ...func(*MLGetDatafeedsRequest)) (*Response, error) // MLGetDatafeedsRequest configures the ML Get Datafeeds API request. +// type MLGetDatafeedsRequest struct { DatafeedID string @@ -62,6 +64,7 @@ type MLGetDatafeedsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,7 @@ func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f MLGetDatafeeds) WithContext(v context.Context) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.ctx = v @@ -162,6 +166,7 @@ func (f MLGetDatafeeds) WithContext(v context.Context) func(*MLGetDatafeedsReque } // WithDatafeedID - the ID of the datafeeds to fetch. +// func (f MLGetDatafeeds) WithDatafeedID(v string) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.DatafeedID = v @@ -169,6 +174,7 @@ func (f MLGetDatafeeds) WithDatafeedID(v string) func(*MLGetDatafeedsRequest) { } // WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f MLGetDatafeeds) WithAllowNoDatafeeds(v bool) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.AllowNoDatafeeds = &v @@ -176,6 +182,7 @@ func (f MLGetDatafeeds) WithAllowNoDatafeeds(v bool) func(*MLGetDatafeedsRequest } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f MLGetDatafeeds) WithAllowNoMatch(v bool) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.AllowNoMatch = &v @@ -183,6 +190,7 @@ func (f MLGetDatafeeds) WithAllowNoMatch(v bool) func(*MLGetDatafeedsRequest) { } // WithExcludeGenerated - omits fields that are illegal to set on datafeed put. +// func (f MLGetDatafeeds) WithExcludeGenerated(v bool) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.ExcludeGenerated = &v @@ -190,6 +198,7 @@ func (f MLGetDatafeeds) WithExcludeGenerated(v bool) func(*MLGetDatafeedsRequest } // WithPretty makes the response body pretty-printed. +// func (f MLGetDatafeeds) WithPretty() func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.Pretty = true @@ -197,6 +206,7 @@ func (f MLGetDatafeeds) WithPretty() func(*MLGetDatafeedsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetDatafeeds) WithHuman() func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.Human = true @@ -204,6 +214,7 @@ func (f MLGetDatafeeds) WithHuman() func(*MLGetDatafeedsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetDatafeeds) WithErrorTrace() func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.ErrorTrace = true @@ -211,6 +222,7 @@ func (f MLGetDatafeeds) WithErrorTrace() func(*MLGetDatafeedsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetDatafeeds) WithFilterPath(v ...string) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { r.FilterPath = v @@ -218,6 +230,7 @@ func (f MLGetDatafeeds) WithFilterPath(v ...string) func(*MLGetDatafeedsRequest) } // WithHeader adds the headers to the HTTP request. +// func (f MLGetDatafeeds) WithHeader(h map[string]string) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { if r.Header == nil { @@ -230,6 +243,7 @@ func (f MLGetDatafeeds) WithHeader(h map[string]string) func(*MLGetDatafeedsRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetDatafeeds) WithOpaqueID(s string) func(*MLGetDatafeedsRequest) { return func(r *MLGetDatafeedsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_filters.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_filters.go index 50b45655b51..b830226c75b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_filters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_filters.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetFiltersFunc(t Transport) MLGetFilters { // MLGetFilters - Retrieves filters. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html. +// type MLGetFilters func(o ...func(*MLGetFiltersRequest)) (*Response, error) // MLGetFiltersRequest configures the ML Get Filters API request. +// type MLGetFiltersRequest struct { FilterID string @@ -61,6 +63,7 @@ type MLGetFiltersRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -150,6 +153,7 @@ func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f MLGetFilters) WithContext(v context.Context) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.ctx = v @@ -157,6 +161,7 @@ func (f MLGetFilters) WithContext(v context.Context) func(*MLGetFiltersRequest) } // WithFilterID - the ID of the filter to fetch. +// func (f MLGetFilters) WithFilterID(v string) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.FilterID = v @@ -164,6 +169,7 @@ func (f MLGetFilters) WithFilterID(v string) func(*MLGetFiltersRequest) { } // WithFrom - skips a number of filters. +// func (f MLGetFilters) WithFrom(v int) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.From = &v @@ -171,6 +177,7 @@ func (f MLGetFilters) WithFrom(v int) func(*MLGetFiltersRequest) { } // WithSize - specifies a max number of filters to get. +// func (f MLGetFilters) WithSize(v int) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.Size = &v @@ -178,6 +185,7 @@ func (f MLGetFilters) WithSize(v int) func(*MLGetFiltersRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetFilters) WithPretty() func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.Pretty = true @@ -185,6 +193,7 @@ func (f MLGetFilters) WithPretty() func(*MLGetFiltersRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetFilters) WithHuman() func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.Human = true @@ -192,6 +201,7 @@ func (f MLGetFilters) WithHuman() func(*MLGetFiltersRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetFilters) WithErrorTrace() func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.ErrorTrace = true @@ -199,6 +209,7 @@ func (f MLGetFilters) WithErrorTrace() func(*MLGetFiltersRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetFilters) WithFilterPath(v ...string) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { r.FilterPath = v @@ -206,6 +217,7 @@ func (f MLGetFilters) WithFilterPath(v ...string) func(*MLGetFiltersRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLGetFilters) WithHeader(h map[string]string) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { if r.Header == nil { @@ -218,6 +230,7 @@ func (f MLGetFilters) WithHeader(h map[string]string) func(*MLGetFiltersRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetFilters) WithOpaqueID(s string) func(*MLGetFiltersRequest) { return func(r *MLGetFiltersRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_influencers.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_influencers.go index 8e09018f069..5a43c37056b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_influencers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_influencers.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLGetInfluencersFunc(t Transport) MLGetInfluencers { // MLGetInfluencers - Retrieves anomaly detection job results for one or more influencers. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html. +// type MLGetInfluencers func(job_id string, o ...func(*MLGetInfluencersRequest)) (*Response, error) // MLGetInfluencersRequest configures the ML Get Influencers API request. +// type MLGetInfluencersRequest struct { Body io.Reader @@ -71,6 +73,7 @@ type MLGetInfluencersRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,10 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* 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 @@ -167,10 +174,6 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -190,6 +193,7 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLGetInfluencers) WithContext(v context.Context) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.ctx = v @@ -197,6 +201,7 @@ func (f MLGetInfluencers) WithContext(v context.Context) func(*MLGetInfluencersR } // WithBody - Influencer selection criteria. +// func (f MLGetInfluencers) WithBody(v io.Reader) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Body = v @@ -204,6 +209,7 @@ func (f MLGetInfluencers) WithBody(v io.Reader) func(*MLGetInfluencersRequest) { } // WithDesc - whether the results should be sorted in decending order. +// func (f MLGetInfluencers) WithDesc(v bool) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Desc = &v @@ -211,6 +217,7 @@ func (f MLGetInfluencers) WithDesc(v bool) func(*MLGetInfluencersRequest) { } // WithEnd - end timestamp for the requested influencers. +// func (f MLGetInfluencers) WithEnd(v string) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.End = v @@ -218,6 +225,7 @@ func (f MLGetInfluencers) WithEnd(v string) func(*MLGetInfluencersRequest) { } // WithExcludeInterim - exclude interim results. +// func (f MLGetInfluencers) WithExcludeInterim(v bool) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.ExcludeInterim = &v @@ -225,6 +233,7 @@ func (f MLGetInfluencers) WithExcludeInterim(v bool) func(*MLGetInfluencersReque } // WithFrom - skips a number of influencers. +// func (f MLGetInfluencers) WithFrom(v int) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.From = &v @@ -232,6 +241,7 @@ func (f MLGetInfluencers) WithFrom(v int) func(*MLGetInfluencersRequest) { } // WithInfluencerScore - influencer score threshold for the requested influencers. +// func (f MLGetInfluencers) WithInfluencerScore(v interface{}) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.InfluencerScore = v @@ -239,6 +249,7 @@ func (f MLGetInfluencers) WithInfluencerScore(v interface{}) func(*MLGetInfluenc } // WithSize - specifies a max number of influencers to get. +// func (f MLGetInfluencers) WithSize(v int) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Size = &v @@ -246,6 +257,7 @@ func (f MLGetInfluencers) WithSize(v int) func(*MLGetInfluencersRequest) { } // WithSort - sort field for the requested influencers. +// func (f MLGetInfluencers) WithSort(v string) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Sort = v @@ -253,6 +265,7 @@ func (f MLGetInfluencers) WithSort(v string) func(*MLGetInfluencersRequest) { } // WithStart - start timestamp for the requested influencers. +// func (f MLGetInfluencers) WithStart(v string) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Start = v @@ -260,6 +273,7 @@ func (f MLGetInfluencers) WithStart(v string) func(*MLGetInfluencersRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetInfluencers) WithPretty() func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Pretty = true @@ -267,6 +281,7 @@ func (f MLGetInfluencers) WithPretty() func(*MLGetInfluencersRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetInfluencers) WithHuman() func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Human = true @@ -274,6 +289,7 @@ func (f MLGetInfluencers) WithHuman() func(*MLGetInfluencersRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetInfluencers) WithErrorTrace() func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.ErrorTrace = true @@ -281,6 +297,7 @@ func (f MLGetInfluencers) WithErrorTrace() func(*MLGetInfluencersRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetInfluencers) WithFilterPath(v ...string) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.FilterPath = v @@ -288,6 +305,7 @@ func (f MLGetInfluencers) WithFilterPath(v ...string) func(*MLGetInfluencersRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLGetInfluencers) WithHeader(h map[string]string) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { if r.Header == nil { @@ -300,6 +318,7 @@ func (f MLGetInfluencers) WithHeader(h map[string]string) func(*MLGetInfluencers } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetInfluencers) WithOpaqueID(s string) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_job_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_job_stats.go index 2de3ee5e534..4c81c3a2352 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_job_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_job_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetJobStatsFunc(t Transport) MLGetJobStats { // MLGetJobStats - Retrieves usage information for anomaly detection jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html. +// type MLGetJobStats func(o ...func(*MLGetJobStatsRequest)) (*Response, error) // MLGetJobStatsRequest configures the ML Get Job Stats API request. +// type MLGetJobStatsRequest struct { JobID string @@ -61,6 +63,7 @@ type MLGetJobStatsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f MLGetJobStats) WithContext(v context.Context) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f MLGetJobStats) WithContext(v context.Context) func(*MLGetJobStatsRequest } // WithJobID - the ID of the jobs stats to fetch. +// func (f MLGetJobStats) WithJobID(v string) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.JobID = v @@ -166,6 +171,7 @@ func (f MLGetJobStats) WithJobID(v string) func(*MLGetJobStatsRequest) { } // WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLGetJobStats) WithAllowNoJobs(v bool) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.AllowNoJobs = &v @@ -173,6 +179,7 @@ func (f MLGetJobStats) WithAllowNoJobs(v bool) func(*MLGetJobStatsRequest) { } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLGetJobStats) WithAllowNoMatch(v bool) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.AllowNoMatch = &v @@ -180,6 +187,7 @@ func (f MLGetJobStats) WithAllowNoMatch(v bool) func(*MLGetJobStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetJobStats) WithPretty() func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f MLGetJobStats) WithPretty() func(*MLGetJobStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetJobStats) WithHuman() func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f MLGetJobStats) WithHuman() func(*MLGetJobStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetJobStats) WithErrorTrace() func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f MLGetJobStats) WithErrorTrace() func(*MLGetJobStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetJobStats) WithFilterPath(v ...string) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f MLGetJobStats) WithFilterPath(v ...string) func(*MLGetJobStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLGetJobStats) WithHeader(h map[string]string) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f MLGetJobStats) WithHeader(h map[string]string) func(*MLGetJobStatsReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetJobStats) WithOpaqueID(s string) func(*MLGetJobStatsRequest) { return func(r *MLGetJobStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_jobs.go index 92691413b61..72e6b5e3e14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_jobs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetJobsFunc(t Transport) MLGetJobs { // MLGetJobs - Retrieves configuration information for anomaly detection jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html. +// type MLGetJobs func(o ...func(*MLGetJobsRequest)) (*Response, error) // MLGetJobsRequest configures the ML Get Jobs API request. +// type MLGetJobsRequest struct { JobID string @@ -62,6 +64,7 @@ type MLGetJobsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,7 @@ func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f MLGetJobs) WithContext(v context.Context) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.ctx = v @@ -162,6 +166,7 @@ func (f MLGetJobs) WithContext(v context.Context) func(*MLGetJobsRequest) { } // WithJobID - the ID of the jobs to fetch. +// func (f MLGetJobs) WithJobID(v string) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.JobID = v @@ -169,6 +174,7 @@ func (f MLGetJobs) WithJobID(v string) func(*MLGetJobsRequest) { } // WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLGetJobs) WithAllowNoJobs(v bool) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.AllowNoJobs = &v @@ -176,6 +182,7 @@ func (f MLGetJobs) WithAllowNoJobs(v bool) func(*MLGetJobsRequest) { } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLGetJobs) WithAllowNoMatch(v bool) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.AllowNoMatch = &v @@ -183,6 +190,7 @@ func (f MLGetJobs) WithAllowNoMatch(v bool) func(*MLGetJobsRequest) { } // WithExcludeGenerated - omits fields that are illegal to set on job put. +// func (f MLGetJobs) WithExcludeGenerated(v bool) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.ExcludeGenerated = &v @@ -190,6 +198,7 @@ func (f MLGetJobs) WithExcludeGenerated(v bool) func(*MLGetJobsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetJobs) WithPretty() func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.Pretty = true @@ -197,6 +206,7 @@ func (f MLGetJobs) WithPretty() func(*MLGetJobsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetJobs) WithHuman() func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.Human = true @@ -204,6 +214,7 @@ func (f MLGetJobs) WithHuman() func(*MLGetJobsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetJobs) WithErrorTrace() func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.ErrorTrace = true @@ -211,6 +222,7 @@ func (f MLGetJobs) WithErrorTrace() func(*MLGetJobsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetJobs) WithFilterPath(v ...string) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { r.FilterPath = v @@ -218,6 +230,7 @@ func (f MLGetJobs) WithFilterPath(v ...string) func(*MLGetJobsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLGetJobs) WithHeader(h map[string]string) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { if r.Header == nil { @@ -230,6 +243,7 @@ func (f MLGetJobs) WithHeader(h map[string]string) func(*MLGetJobsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetJobs) WithOpaqueID(s string) func(*MLGetJobsRequest) { return func(r *MLGetJobsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go index 0142b3fd7c7..3bfab8ef98b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetModelSnapshotUpgradeStatsFunc(t Transport) MLGetModelSnapshotUpgrad // MLGetModelSnapshotUpgradeStats - Gets stats for anomaly detection job model snapshot upgrades that are in progress. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html. +// type MLGetModelSnapshotUpgradeStats func(snapshot_id string, job_id string, o ...func(*MLGetModelSnapshotUpgradeStatsRequest)) (*Response, error) // MLGetModelSnapshotUpgradeStatsRequest configures the ML Get Model Snapshot Upgrade Stats API request. +// type MLGetModelSnapshotUpgradeStatsRequest struct { JobID string SnapshotID string @@ -61,6 +63,7 @@ type MLGetModelSnapshotUpgradeStatsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetModelSnapshotUpgradeStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r MLGetModelSnapshotUpgradeStatsRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f MLGetModelSnapshotUpgradeStats) WithContext(v context.Context) func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithContext(v context.Context) func(*MLG } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no jobs or no snapshots. (this includes the `_all` string.). +// func (f MLGetModelSnapshotUpgradeStats) WithAllowNoMatch(v bool) func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { r.AllowNoMatch = &v @@ -166,6 +171,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithAllowNoMatch(v bool) func(*MLGetMode } // WithPretty makes the response body pretty-printed. +// func (f MLGetModelSnapshotUpgradeStats) WithPretty() func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { r.Pretty = true @@ -173,6 +179,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithPretty() func(*MLGetModelSnapshotUpg } // WithHuman makes statistical values human-readable. +// func (f MLGetModelSnapshotUpgradeStats) WithHuman() func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { r.Human = true @@ -180,6 +187,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithHuman() func(*MLGetModelSnapshotUpgr } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetModelSnapshotUpgradeStats) WithErrorTrace() func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { r.ErrorTrace = true @@ -187,6 +195,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithErrorTrace() func(*MLGetModelSnapsho } // WithFilterPath filters the properties of the response body. +// func (f MLGetModelSnapshotUpgradeStats) WithFilterPath(v ...string) func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { r.FilterPath = v @@ -194,6 +203,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithFilterPath(v ...string) func(*MLGetM } // WithHeader adds the headers to the HTTP request. +// func (f MLGetModelSnapshotUpgradeStats) WithHeader(h map[string]string) func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { if r.Header == nil { @@ -206,6 +216,7 @@ func (f MLGetModelSnapshotUpgradeStats) WithHeader(h map[string]string) func(*ML } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetModelSnapshotUpgradeStats) WithOpaqueID(s string) func(*MLGetModelSnapshotUpgradeStatsRequest) { return func(r *MLGetModelSnapshotUpgradeStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshots.go index c9835daebc3..8e0feaae240 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_model_snapshots.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLGetModelSnapshotsFunc(t Transport) MLGetModelSnapshots { // MLGetModelSnapshots - Retrieves information about model snapshots. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html. +// type MLGetModelSnapshots func(job_id string, o ...func(*MLGetModelSnapshotsRequest)) (*Response, error) // MLGetModelSnapshotsRequest configures the ML Get Model Snapshots API request. +// type MLGetModelSnapshotsRequest struct { Body io.Reader @@ -70,6 +72,7 @@ type MLGetModelSnapshotsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,10 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) 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 @@ -160,10 +167,6 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -183,6 +186,7 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLGetModelSnapshots) WithContext(v context.Context) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.ctx = v @@ -190,6 +194,7 @@ func (f MLGetModelSnapshots) WithContext(v context.Context) func(*MLGetModelSnap } // WithBody - Model snapshot selection criteria. +// func (f MLGetModelSnapshots) WithBody(v io.Reader) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Body = v @@ -197,6 +202,7 @@ func (f MLGetModelSnapshots) WithBody(v io.Reader) func(*MLGetModelSnapshotsRequ } // WithSnapshotID - the ID of the snapshot to fetch. +// func (f MLGetModelSnapshots) WithSnapshotID(v string) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.SnapshotID = v @@ -204,6 +210,7 @@ func (f MLGetModelSnapshots) WithSnapshotID(v string) func(*MLGetModelSnapshotsR } // WithDesc - true if the results should be sorted in descending order. +// func (f MLGetModelSnapshots) WithDesc(v bool) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Desc = &v @@ -211,6 +218,7 @@ func (f MLGetModelSnapshots) WithDesc(v bool) func(*MLGetModelSnapshotsRequest) } // WithEnd - the filter 'end' query parameter. +// func (f MLGetModelSnapshots) WithEnd(v interface{}) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.End = v @@ -218,6 +226,7 @@ func (f MLGetModelSnapshots) WithEnd(v interface{}) func(*MLGetModelSnapshotsReq } // WithFrom - skips a number of documents. +// func (f MLGetModelSnapshots) WithFrom(v int) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.From = &v @@ -225,6 +234,7 @@ func (f MLGetModelSnapshots) WithFrom(v int) func(*MLGetModelSnapshotsRequest) { } // WithSize - the default number of documents returned in queries as a string.. +// func (f MLGetModelSnapshots) WithSize(v int) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Size = &v @@ -232,6 +242,7 @@ func (f MLGetModelSnapshots) WithSize(v int) func(*MLGetModelSnapshotsRequest) { } // WithSort - name of the field to sort on. +// func (f MLGetModelSnapshots) WithSort(v string) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Sort = v @@ -239,6 +250,7 @@ func (f MLGetModelSnapshots) WithSort(v string) func(*MLGetModelSnapshotsRequest } // WithStart - the filter 'start' query parameter. +// func (f MLGetModelSnapshots) WithStart(v interface{}) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Start = v @@ -246,6 +258,7 @@ func (f MLGetModelSnapshots) WithStart(v interface{}) func(*MLGetModelSnapshotsR } // WithPretty makes the response body pretty-printed. +// func (f MLGetModelSnapshots) WithPretty() func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Pretty = true @@ -253,6 +266,7 @@ func (f MLGetModelSnapshots) WithPretty() func(*MLGetModelSnapshotsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetModelSnapshots) WithHuman() func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.Human = true @@ -260,6 +274,7 @@ func (f MLGetModelSnapshots) WithHuman() func(*MLGetModelSnapshotsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetModelSnapshots) WithErrorTrace() func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.ErrorTrace = true @@ -267,6 +282,7 @@ func (f MLGetModelSnapshots) WithErrorTrace() func(*MLGetModelSnapshotsRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLGetModelSnapshots) WithFilterPath(v ...string) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { r.FilterPath = v @@ -274,6 +290,7 @@ func (f MLGetModelSnapshots) WithFilterPath(v ...string) func(*MLGetModelSnapsho } // WithHeader adds the headers to the HTTP request. +// func (f MLGetModelSnapshots) WithHeader(h map[string]string) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { if r.Header == nil { @@ -286,6 +303,7 @@ func (f MLGetModelSnapshots) WithHeader(h map[string]string) func(*MLGetModelSna } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetModelSnapshots) WithOpaqueID(s string) func(*MLGetModelSnapshotsRequest) { return func(r *MLGetModelSnapshotsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_overall_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_overall_buckets.go index ad0b82ff4af..2636f8421f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_overall_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_overall_buckets.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLGetOverallBucketsFunc(t Transport) MLGetOverallBuckets { // MLGetOverallBuckets - Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html. +// type MLGetOverallBuckets func(job_id string, o ...func(*MLGetOverallBucketsRequest)) (*Response, error) // MLGetOverallBucketsRequest configures the ML Get Overall Buckets API request. +// type MLGetOverallBucketsRequest struct { Body io.Reader @@ -71,6 +73,7 @@ type MLGetOverallBucketsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,10 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) 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 @@ -167,10 +174,6 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -190,6 +193,7 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLGetOverallBuckets) WithContext(v context.Context) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.ctx = v @@ -197,6 +201,7 @@ func (f MLGetOverallBuckets) WithContext(v context.Context) func(*MLGetOverallBu } // WithBody - Overall bucket selection details if not provided in URI. +// func (f MLGetOverallBuckets) WithBody(v io.Reader) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.Body = v @@ -204,6 +209,7 @@ func (f MLGetOverallBuckets) WithBody(v io.Reader) func(*MLGetOverallBucketsRequ } // WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLGetOverallBuckets) WithAllowNoJobs(v bool) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.AllowNoJobs = &v @@ -211,6 +217,7 @@ func (f MLGetOverallBuckets) WithAllowNoJobs(v bool) func(*MLGetOverallBucketsRe } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// func (f MLGetOverallBuckets) WithAllowNoMatch(v bool) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.AllowNoMatch = &v @@ -218,6 +225,7 @@ func (f MLGetOverallBuckets) WithAllowNoMatch(v bool) func(*MLGetOverallBucketsR } // WithBucketSpan - the span of the overall buckets. defaults to the longest job bucket_span. +// func (f MLGetOverallBuckets) WithBucketSpan(v string) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.BucketSpan = v @@ -225,6 +233,7 @@ func (f MLGetOverallBuckets) WithBucketSpan(v string) func(*MLGetOverallBucketsR } // WithEnd - returns overall buckets with timestamps earlier than this time. +// func (f MLGetOverallBuckets) WithEnd(v string) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.End = v @@ -232,6 +241,7 @@ func (f MLGetOverallBuckets) WithEnd(v string) func(*MLGetOverallBucketsRequest) } // WithExcludeInterim - if true overall buckets that include interim buckets will be excluded. +// func (f MLGetOverallBuckets) WithExcludeInterim(v bool) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.ExcludeInterim = &v @@ -239,6 +249,7 @@ func (f MLGetOverallBuckets) WithExcludeInterim(v bool) func(*MLGetOverallBucket } // WithOverallScore - returns overall buckets with overall scores higher than this value. +// func (f MLGetOverallBuckets) WithOverallScore(v interface{}) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.OverallScore = v @@ -246,6 +257,7 @@ func (f MLGetOverallBuckets) WithOverallScore(v interface{}) func(*MLGetOverallB } // WithStart - returns overall buckets with timestamps after this time. +// func (f MLGetOverallBuckets) WithStart(v string) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.Start = v @@ -253,6 +265,7 @@ func (f MLGetOverallBuckets) WithStart(v string) func(*MLGetOverallBucketsReques } // WithTopN - the number of top job bucket scores to be used in the overall_score calculation. +// func (f MLGetOverallBuckets) WithTopN(v int) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.TopN = &v @@ -260,6 +273,7 @@ func (f MLGetOverallBuckets) WithTopN(v int) func(*MLGetOverallBucketsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetOverallBuckets) WithPretty() func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.Pretty = true @@ -267,6 +281,7 @@ func (f MLGetOverallBuckets) WithPretty() func(*MLGetOverallBucketsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetOverallBuckets) WithHuman() func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.Human = true @@ -274,6 +289,7 @@ func (f MLGetOverallBuckets) WithHuman() func(*MLGetOverallBucketsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetOverallBuckets) WithErrorTrace() func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.ErrorTrace = true @@ -281,6 +297,7 @@ func (f MLGetOverallBuckets) WithErrorTrace() func(*MLGetOverallBucketsRequest) } // WithFilterPath filters the properties of the response body. +// func (f MLGetOverallBuckets) WithFilterPath(v ...string) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.FilterPath = v @@ -288,6 +305,7 @@ func (f MLGetOverallBuckets) WithFilterPath(v ...string) func(*MLGetOverallBucke } // WithHeader adds the headers to the HTTP request. +// func (f MLGetOverallBuckets) WithHeader(h map[string]string) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { if r.Header == nil { @@ -300,6 +318,7 @@ func (f MLGetOverallBuckets) WithHeader(h map[string]string) func(*MLGetOverallB } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetOverallBuckets) WithOpaqueID(s string) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_records.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_records.go index 2f74ccc7122..8a459282383 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_records.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_records.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLGetRecordsFunc(t Transport) MLGetRecords { // MLGetRecords - Retrieves anomaly records for an anomaly detection job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html. +// type MLGetRecords func(job_id string, o ...func(*MLGetRecordsRequest)) (*Response, error) // MLGetRecordsRequest configures the ML Get Records API request. +// type MLGetRecordsRequest struct { Body io.Reader @@ -71,6 +73,7 @@ type MLGetRecordsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -155,6 +158,10 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -167,10 +174,6 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -190,6 +193,7 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f MLGetRecords) WithContext(v context.Context) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.ctx = v @@ -197,6 +201,7 @@ func (f MLGetRecords) WithContext(v context.Context) func(*MLGetRecordsRequest) } // WithBody - Record selection criteria. +// func (f MLGetRecords) WithBody(v io.Reader) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Body = v @@ -204,6 +209,7 @@ func (f MLGetRecords) WithBody(v io.Reader) func(*MLGetRecordsRequest) { } // WithDesc - set the sort direction. +// func (f MLGetRecords) WithDesc(v bool) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Desc = &v @@ -211,6 +217,7 @@ func (f MLGetRecords) WithDesc(v bool) func(*MLGetRecordsRequest) { } // WithEnd - end time filter for records. +// func (f MLGetRecords) WithEnd(v string) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.End = v @@ -218,6 +225,7 @@ func (f MLGetRecords) WithEnd(v string) func(*MLGetRecordsRequest) { } // WithExcludeInterim - exclude interim results. +// func (f MLGetRecords) WithExcludeInterim(v bool) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.ExcludeInterim = &v @@ -225,6 +233,7 @@ func (f MLGetRecords) WithExcludeInterim(v bool) func(*MLGetRecordsRequest) { } // WithFrom - skips a number of records. +// func (f MLGetRecords) WithFrom(v int) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.From = &v @@ -232,6 +241,7 @@ func (f MLGetRecords) WithFrom(v int) func(*MLGetRecordsRequest) { } // WithRecordScore - returns records with anomaly scores greater or equal than this value. +// func (f MLGetRecords) WithRecordScore(v interface{}) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.RecordScore = v @@ -239,6 +249,7 @@ func (f MLGetRecords) WithRecordScore(v interface{}) func(*MLGetRecordsRequest) } // WithSize - specifies a max number of records to get. +// func (f MLGetRecords) WithSize(v int) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Size = &v @@ -246,6 +257,7 @@ func (f MLGetRecords) WithSize(v int) func(*MLGetRecordsRequest) { } // WithSort - sort records by a particular field. +// func (f MLGetRecords) WithSort(v string) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Sort = v @@ -253,6 +265,7 @@ func (f MLGetRecords) WithSort(v string) func(*MLGetRecordsRequest) { } // WithStart - start time filter for records. +// func (f MLGetRecords) WithStart(v string) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Start = v @@ -260,6 +273,7 @@ func (f MLGetRecords) WithStart(v string) func(*MLGetRecordsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLGetRecords) WithPretty() func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Pretty = true @@ -267,6 +281,7 @@ func (f MLGetRecords) WithPretty() func(*MLGetRecordsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetRecords) WithHuman() func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Human = true @@ -274,6 +289,7 @@ func (f MLGetRecords) WithHuman() func(*MLGetRecordsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetRecords) WithErrorTrace() func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.ErrorTrace = true @@ -281,6 +297,7 @@ func (f MLGetRecords) WithErrorTrace() func(*MLGetRecordsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetRecords) WithFilterPath(v ...string) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.FilterPath = v @@ -288,6 +305,7 @@ func (f MLGetRecords) WithFilterPath(v ...string) func(*MLGetRecordsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLGetRecords) WithHeader(h map[string]string) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { if r.Header == nil { @@ -300,6 +318,7 @@ func (f MLGetRecords) WithHeader(h map[string]string) func(*MLGetRecordsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetRecords) WithOpaqueID(s string) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models.go index 2cf362abf8d..fbc1879a678 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetTrainedModelsFunc(t Transport) MLGetTrainedModels { // MLGetTrainedModels - Retrieves configuration information for a trained inference model. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html. +// type MLGetTrainedModels func(o ...func(*MLGetTrainedModelsRequest)) (*Response, error) // MLGetTrainedModelsRequest configures the ML Get Trained Models API request. +// type MLGetTrainedModelsRequest struct { ModelID string @@ -67,6 +69,7 @@ type MLGetTrainedModelsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetTrainedModelsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -180,6 +183,7 @@ func (r MLGetTrainedModelsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLGetTrainedModels) WithContext(v context.Context) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.ctx = v @@ -187,6 +191,7 @@ func (f MLGetTrainedModels) WithContext(v context.Context) func(*MLGetTrainedMod } // WithModelID - the ID of the trained models to fetch. +// func (f MLGetTrainedModels) WithModelID(v string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.ModelID = v @@ -194,6 +199,7 @@ func (f MLGetTrainedModels) WithModelID(v string) func(*MLGetTrainedModelsReques } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no trained models. (this includes `_all` string or when no trained models have been specified). +// func (f MLGetTrainedModels) WithAllowNoMatch(v bool) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.AllowNoMatch = &v @@ -201,6 +207,7 @@ func (f MLGetTrainedModels) WithAllowNoMatch(v bool) func(*MLGetTrainedModelsReq } // WithDecompressDefinition - should the model definition be decompressed into valid json or returned in a custom compressed format. defaults to true.. +// func (f MLGetTrainedModels) WithDecompressDefinition(v bool) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.DecompressDefinition = &v @@ -208,6 +215,7 @@ func (f MLGetTrainedModels) WithDecompressDefinition(v bool) func(*MLGetTrainedM } // WithExcludeGenerated - omits fields that are illegal to set on model put. +// func (f MLGetTrainedModels) WithExcludeGenerated(v bool) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.ExcludeGenerated = &v @@ -215,6 +223,7 @@ func (f MLGetTrainedModels) WithExcludeGenerated(v bool) func(*MLGetTrainedModel } // WithFrom - skips a number of trained models. +// func (f MLGetTrainedModels) WithFrom(v int) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.From = &v @@ -222,6 +231,7 @@ func (f MLGetTrainedModels) WithFrom(v int) func(*MLGetTrainedModelsRequest) { } // WithInclude - a comma-separate list of fields to optionally include. valid options are 'definition' and 'total_feature_importance'. default is none.. +// func (f MLGetTrainedModels) WithInclude(v string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.Include = v @@ -229,6 +239,7 @@ func (f MLGetTrainedModels) WithInclude(v string) func(*MLGetTrainedModelsReques } // WithIncludeModelDefinition - should the full model definition be included in the results. these definitions can be large. so be cautious when including them. defaults to false.. +// func (f MLGetTrainedModels) WithIncludeModelDefinition(v bool) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.IncludeModelDefinition = &v @@ -236,6 +247,7 @@ func (f MLGetTrainedModels) WithIncludeModelDefinition(v bool) func(*MLGetTraine } // WithSize - specifies a max number of trained models to get. +// func (f MLGetTrainedModels) WithSize(v int) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.Size = &v @@ -243,6 +255,7 @@ func (f MLGetTrainedModels) WithSize(v int) func(*MLGetTrainedModelsRequest) { } // WithTags - a list of tags that the model must have.. +// func (f MLGetTrainedModels) WithTags(v ...string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.Tags = v @@ -250,6 +263,7 @@ func (f MLGetTrainedModels) WithTags(v ...string) func(*MLGetTrainedModelsReques } // WithPretty makes the response body pretty-printed. +// func (f MLGetTrainedModels) WithPretty() func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.Pretty = true @@ -257,6 +271,7 @@ func (f MLGetTrainedModels) WithPretty() func(*MLGetTrainedModelsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLGetTrainedModels) WithHuman() func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.Human = true @@ -264,6 +279,7 @@ func (f MLGetTrainedModels) WithHuman() func(*MLGetTrainedModelsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetTrainedModels) WithErrorTrace() func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.ErrorTrace = true @@ -271,6 +287,7 @@ func (f MLGetTrainedModels) WithErrorTrace() func(*MLGetTrainedModelsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLGetTrainedModels) WithFilterPath(v ...string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.FilterPath = v @@ -278,6 +295,7 @@ func (f MLGetTrainedModels) WithFilterPath(v ...string) func(*MLGetTrainedModels } // WithHeader adds the headers to the HTTP request. +// func (f MLGetTrainedModels) WithHeader(h map[string]string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { if r.Header == nil { @@ -290,6 +308,7 @@ func (f MLGetTrainedModels) WithHeader(h map[string]string) func(*MLGetTrainedMo } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetTrainedModels) WithOpaqueID(s string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models_stats.go index 398a5134fde..d2785052187 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.get_trained_models_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLGetTrainedModelsStatsFunc(t Transport) MLGetTrainedModelsStats { // MLGetTrainedModelsStats - Retrieves usage information for trained inference models. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html. +// type MLGetTrainedModelsStats func(o ...func(*MLGetTrainedModelsStatsRequest)) (*Response, error) // MLGetTrainedModelsStatsRequest configures the ML Get Trained Models Stats API request. +// type MLGetTrainedModelsStatsRequest struct { ModelID string @@ -62,6 +64,7 @@ type MLGetTrainedModelsStatsRequest struct { } // Do executes the request and returns response or error. +// func (r MLGetTrainedModelsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -157,6 +160,7 @@ func (r MLGetTrainedModelsStatsRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f MLGetTrainedModelsStats) WithContext(v context.Context) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.ctx = v @@ -164,6 +168,7 @@ func (f MLGetTrainedModelsStats) WithContext(v context.Context) func(*MLGetTrain } // WithModelID - the ID of the trained models stats to fetch. +// func (f MLGetTrainedModelsStats) WithModelID(v string) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.ModelID = v @@ -171,6 +176,7 @@ func (f MLGetTrainedModelsStats) WithModelID(v string) func(*MLGetTrainedModelsS } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no trained models. (this includes `_all` string or when no trained models have been specified). +// func (f MLGetTrainedModelsStats) WithAllowNoMatch(v bool) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.AllowNoMatch = &v @@ -178,6 +184,7 @@ func (f MLGetTrainedModelsStats) WithAllowNoMatch(v bool) func(*MLGetTrainedMode } // WithFrom - skips a number of trained models. +// func (f MLGetTrainedModelsStats) WithFrom(v int) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.From = &v @@ -185,6 +192,7 @@ func (f MLGetTrainedModelsStats) WithFrom(v int) func(*MLGetTrainedModelsStatsRe } // WithSize - specifies a max number of trained models to get. +// func (f MLGetTrainedModelsStats) WithSize(v int) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.Size = &v @@ -192,6 +200,7 @@ func (f MLGetTrainedModelsStats) WithSize(v int) func(*MLGetTrainedModelsStatsRe } // WithPretty makes the response body pretty-printed. +// func (f MLGetTrainedModelsStats) WithPretty() func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.Pretty = true @@ -199,6 +208,7 @@ func (f MLGetTrainedModelsStats) WithPretty() func(*MLGetTrainedModelsStatsReque } // WithHuman makes statistical values human-readable. +// func (f MLGetTrainedModelsStats) WithHuman() func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.Human = true @@ -206,6 +216,7 @@ func (f MLGetTrainedModelsStats) WithHuman() func(*MLGetTrainedModelsStatsReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLGetTrainedModelsStats) WithErrorTrace() func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.ErrorTrace = true @@ -213,6 +224,7 @@ func (f MLGetTrainedModelsStats) WithErrorTrace() func(*MLGetTrainedModelsStatsR } // WithFilterPath filters the properties of the response body. +// func (f MLGetTrainedModelsStats) WithFilterPath(v ...string) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { r.FilterPath = v @@ -220,6 +232,7 @@ func (f MLGetTrainedModelsStats) WithFilterPath(v ...string) func(*MLGetTrainedM } // WithHeader adds the headers to the HTTP request. +// func (f MLGetTrainedModelsStats) WithHeader(h map[string]string) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { if r.Header == nil { @@ -232,6 +245,7 @@ func (f MLGetTrainedModelsStats) WithHeader(h map[string]string) func(*MLGetTrai } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLGetTrainedModelsStats) WithOpaqueID(s string) func(*MLGetTrainedModelsStatsRequest) { return func(r *MLGetTrainedModelsStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.info.go index 8986dc04aa2..a5b7e4522e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLInfoFunc(t Transport) MLInfo { // MLInfo - Returns defaults and limits used by machine learning. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html. +// type MLInfo func(o ...func(*MLInfoRequest)) (*Response, error) // MLInfoRequest configures the ML Info API request. +// type MLInfoRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type MLInfoRequest struct { } // Do executes the request and returns response or error. +// func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f MLInfo) WithContext(v context.Context) func(*MLInfoRequest) { return func(r *MLInfoRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f MLInfo) WithContext(v context.Context) func(*MLInfoRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLInfo) WithPretty() func(*MLInfoRequest) { return func(r *MLInfoRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f MLInfo) WithPretty() func(*MLInfoRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLInfo) WithHuman() func(*MLInfoRequest) { return func(r *MLInfoRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f MLInfo) WithHuman() func(*MLInfoRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLInfo) WithErrorTrace() func(*MLInfoRequest) { return func(r *MLInfoRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f MLInfo) WithErrorTrace() func(*MLInfoRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLInfo) WithFilterPath(v ...string) func(*MLInfoRequest) { return func(r *MLInfoRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f MLInfo) WithFilterPath(v ...string) func(*MLInfoRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLInfo) WithHeader(h map[string]string) func(*MLInfoRequest) { return func(r *MLInfoRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f MLInfo) WithHeader(h map[string]string) func(*MLInfoRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLInfo) WithOpaqueID(s string) func(*MLInfoRequest) { return func(r *MLInfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.open_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.open_job.go index 6f56a949405..09e6e087a04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.open_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.open_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLOpenJobFunc(t Transport) MLOpenJob { // MLOpenJob - Opens one or more anomaly detection jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html. +// type MLOpenJob func(job_id string, o ...func(*MLOpenJobRequest)) (*Response, error) // MLOpenJobRequest configures the ML Open Job API request. +// type MLOpenJobRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLOpenJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons 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 @@ -122,10 +129,6 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f MLOpenJob) WithContext(v context.Context) func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f MLOpenJob) WithContext(v context.Context) func(*MLOpenJobRequest) { } // WithBody - Query parameters can be specified in the body. +// func (f MLOpenJob) WithBody(v io.Reader) func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { r.Body = v @@ -159,6 +164,7 @@ func (f MLOpenJob) WithBody(v io.Reader) func(*MLOpenJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLOpenJob) WithPretty() func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f MLOpenJob) WithPretty() func(*MLOpenJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLOpenJob) WithHuman() func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f MLOpenJob) WithHuman() func(*MLOpenJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLOpenJob) WithErrorTrace() func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f MLOpenJob) WithErrorTrace() func(*MLOpenJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLOpenJob) WithFilterPath(v ...string) func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f MLOpenJob) WithFilterPath(v ...string) func(*MLOpenJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLOpenJob) WithHeader(h map[string]string) func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f MLOpenJob) WithHeader(h map[string]string) func(*MLOpenJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLOpenJob) WithOpaqueID(s string) func(*MLOpenJobRequest) { return func(r *MLOpenJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_calendar_events.go index 22c4d577438..2be85c1bdd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_calendar_events.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPostCalendarEventsFunc(t Transport) MLPostCalendarEvents { // MLPostCalendarEvents - Posts scheduled events in a calendar. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html. +// type MLPostCalendarEvents func(calendar_id string, body io.Reader, o ...func(*MLPostCalendarEventsRequest)) (*Response, error) // MLPostCalendarEventsRequest configures the ML Post Calendar Events API request. +// type MLPostCalendarEventsRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLPostCalendarEventsRequest struct { } // Do executes the request and returns response or error. +// func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport 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 @@ -122,10 +129,6 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f MLPostCalendarEvents) WithContext(v context.Context) func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f MLPostCalendarEvents) WithContext(v context.Context) func(*MLPostCalenda } // WithPretty makes the response body pretty-printed. +// func (f MLPostCalendarEvents) WithPretty() func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { r.Pretty = true @@ -159,6 +164,7 @@ func (f MLPostCalendarEvents) WithPretty() func(*MLPostCalendarEventsRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPostCalendarEvents) WithHuman() func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { r.Human = true @@ -166,6 +172,7 @@ func (f MLPostCalendarEvents) WithHuman() func(*MLPostCalendarEventsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPostCalendarEvents) WithErrorTrace() func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { r.ErrorTrace = true @@ -173,6 +180,7 @@ func (f MLPostCalendarEvents) WithErrorTrace() func(*MLPostCalendarEventsRequest } // WithFilterPath filters the properties of the response body. +// func (f MLPostCalendarEvents) WithFilterPath(v ...string) func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { r.FilterPath = v @@ -180,6 +188,7 @@ func (f MLPostCalendarEvents) WithFilterPath(v ...string) func(*MLPostCalendarEv } // WithHeader adds the headers to the HTTP request. +// func (f MLPostCalendarEvents) WithHeader(h map[string]string) func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { if r.Header == nil { @@ -192,6 +201,7 @@ func (f MLPostCalendarEvents) WithHeader(h map[string]string) func(*MLPostCalend } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPostCalendarEvents) WithOpaqueID(s string) func(*MLPostCalendarEventsRequest) { return func(r *MLPostCalendarEventsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_data.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_data.go index d7f11b3fe13..969b45077c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.post_data.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPostDataFunc(t Transport) MLPostData { // MLPostData - Sends data to an anomaly detection job for analysis. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html. +// type MLPostData func(job_id string, body io.Reader, o ...func(*MLPostDataRequest)) (*Response, error) // MLPostDataRequest configures the ML Post Data API request. +// type MLPostDataRequest struct { Body io.Reader @@ -63,6 +65,7 @@ type MLPostDataRequest struct { } // Do executes the request and returns response or error. +// func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -121,6 +124,10 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon 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 @@ -133,10 +140,6 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -156,6 +159,7 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f MLPostData) WithContext(v context.Context) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f MLPostData) WithContext(v context.Context) func(*MLPostDataRequest) { } // WithResetEnd - optional parameter to specify the end of the bucket resetting range. +// func (f MLPostData) WithResetEnd(v string) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.ResetEnd = v @@ -170,6 +175,7 @@ func (f MLPostData) WithResetEnd(v string) func(*MLPostDataRequest) { } // WithResetStart - optional parameter to specify the start of the bucket resetting range. +// func (f MLPostData) WithResetStart(v string) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.ResetStart = v @@ -177,6 +183,7 @@ func (f MLPostData) WithResetStart(v string) func(*MLPostDataRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLPostData) WithPretty() func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.Pretty = true @@ -184,6 +191,7 @@ func (f MLPostData) WithPretty() func(*MLPostDataRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPostData) WithHuman() func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.Human = true @@ -191,6 +199,7 @@ func (f MLPostData) WithHuman() func(*MLPostDataRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPostData) WithErrorTrace() func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.ErrorTrace = true @@ -198,6 +207,7 @@ func (f MLPostData) WithErrorTrace() func(*MLPostDataRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPostData) WithFilterPath(v ...string) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.FilterPath = v @@ -205,6 +215,7 @@ func (f MLPostData) WithFilterPath(v ...string) func(*MLPostDataRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLPostData) WithHeader(h map[string]string) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { if r.Header == nil { @@ -217,6 +228,7 @@ func (f MLPostData) WithHeader(h map[string]string) func(*MLPostDataRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPostData) WithOpaqueID(s string) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_data_frame_analytics.go index 55143cf5300..76725ce2fad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPreviewDataFrameAnalyticsFunc(t Transport) MLPreviewDataFrameAnalytics // MLPreviewDataFrameAnalytics - Previews that will be analyzed given a data frame analytics config. // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html. +// type MLPreviewDataFrameAnalytics func(o ...func(*MLPreviewDataFrameAnalyticsRequest)) (*Response, error) // MLPreviewDataFrameAnalyticsRequest configures the ML Preview Data Frame Analytics API request. +// type MLPreviewDataFrameAnalyticsRequest struct { DocumentID string @@ -60,6 +62,7 @@ type MLPreviewDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -114,6 +117,10 @@ func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr 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 @@ -126,10 +133,6 @@ func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -149,6 +152,7 @@ func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr } // WithContext sets the request context. +// func (f MLPreviewDataFrameAnalytics) WithContext(v context.Context) func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f MLPreviewDataFrameAnalytics) WithContext(v context.Context) func(*MLPrev } // WithBody - The data frame analytics config to preview. +// func (f MLPreviewDataFrameAnalytics) WithBody(v io.Reader) func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.Body = v @@ -163,6 +168,7 @@ func (f MLPreviewDataFrameAnalytics) WithBody(v io.Reader) func(*MLPreviewDataFr } // WithDocumentID - the ID of the data frame analytics to preview. +// func (f MLPreviewDataFrameAnalytics) WithDocumentID(v string) func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.DocumentID = v @@ -170,6 +176,7 @@ func (f MLPreviewDataFrameAnalytics) WithDocumentID(v string) func(*MLPreviewDat } // WithPretty makes the response body pretty-printed. +// func (f MLPreviewDataFrameAnalytics) WithPretty() func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.Pretty = true @@ -177,6 +184,7 @@ func (f MLPreviewDataFrameAnalytics) WithPretty() func(*MLPreviewDataFrameAnalyt } // WithHuman makes statistical values human-readable. +// func (f MLPreviewDataFrameAnalytics) WithHuman() func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.Human = true @@ -184,6 +192,7 @@ func (f MLPreviewDataFrameAnalytics) WithHuman() func(*MLPreviewDataFrameAnalyti } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPreviewDataFrameAnalytics) WithErrorTrace() func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -191,6 +200,7 @@ func (f MLPreviewDataFrameAnalytics) WithErrorTrace() func(*MLPreviewDataFrameAn } // WithFilterPath filters the properties of the response body. +// func (f MLPreviewDataFrameAnalytics) WithFilterPath(v ...string) func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { r.FilterPath = v @@ -198,6 +208,7 @@ func (f MLPreviewDataFrameAnalytics) WithFilterPath(v ...string) func(*MLPreview } // WithHeader adds the headers to the HTTP request. +// func (f MLPreviewDataFrameAnalytics) WithHeader(h map[string]string) func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { if r.Header == nil { @@ -210,6 +221,7 @@ func (f MLPreviewDataFrameAnalytics) WithHeader(h map[string]string) func(*MLPre } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPreviewDataFrameAnalytics) WithOpaqueID(s string) func(*MLPreviewDataFrameAnalyticsRequest) { return func(r *MLPreviewDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_datafeed.go index 95e31caf11e..9d814240734 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.preview_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPreviewDatafeedFunc(t Transport) MLPreviewDatafeed { // MLPreviewDatafeed - Previews a datafeed. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html. +// type MLPreviewDatafeed func(o ...func(*MLPreviewDatafeedRequest)) (*Response, error) // MLPreviewDatafeedRequest configures the ML Preview Datafeed API request. +// type MLPreviewDatafeedRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLPreviewDatafeedRequest struct { } // Do executes the request and returns response or error. +// func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -112,6 +115,10 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( 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 @@ -124,10 +131,6 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -147,6 +150,7 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f MLPreviewDatafeed) WithContext(v context.Context) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f MLPreviewDatafeed) WithContext(v context.Context) func(*MLPreviewDatafee } // WithBody - The datafeed config and job config with which to execute the preview. +// func (f MLPreviewDatafeed) WithBody(v io.Reader) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.Body = v @@ -161,6 +166,7 @@ func (f MLPreviewDatafeed) WithBody(v io.Reader) func(*MLPreviewDatafeedRequest) } // WithDatafeedID - the ID of the datafeed to preview. +// func (f MLPreviewDatafeed) WithDatafeedID(v string) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.DatafeedID = v @@ -168,6 +174,7 @@ func (f MLPreviewDatafeed) WithDatafeedID(v string) func(*MLPreviewDatafeedReque } // WithPretty makes the response body pretty-printed. +// func (f MLPreviewDatafeed) WithPretty() func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.Pretty = true @@ -175,6 +182,7 @@ func (f MLPreviewDatafeed) WithPretty() func(*MLPreviewDatafeedRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPreviewDatafeed) WithHuman() func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.Human = true @@ -182,6 +190,7 @@ func (f MLPreviewDatafeed) WithHuman() func(*MLPreviewDatafeedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPreviewDatafeed) WithErrorTrace() func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.ErrorTrace = true @@ -189,6 +198,7 @@ func (f MLPreviewDatafeed) WithErrorTrace() func(*MLPreviewDatafeedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPreviewDatafeed) WithFilterPath(v ...string) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.FilterPath = v @@ -196,6 +206,7 @@ func (f MLPreviewDatafeed) WithFilterPath(v ...string) func(*MLPreviewDatafeedRe } // WithHeader adds the headers to the HTTP request. +// func (f MLPreviewDatafeed) WithHeader(h map[string]string) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { if r.Header == nil { @@ -208,6 +219,7 @@ func (f MLPreviewDatafeed) WithHeader(h map[string]string) func(*MLPreviewDatafe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPreviewDatafeed) WithOpaqueID(s string) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar.go index 624b619cae9..1e4074ed174 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPutCalendarFunc(t Transport) MLPutCalendar { // MLPutCalendar - Instantiates a calendar. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html. +// type MLPutCalendar func(calendar_id string, o ...func(*MLPutCalendarRequest)) (*Response, error) // MLPutCalendarRequest configures the ML Put Calendar API request. +// type MLPutCalendarRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLPutCalendarRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -120,10 +127,6 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f MLPutCalendar) WithContext(v context.Context) func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f MLPutCalendar) WithContext(v context.Context) func(*MLPutCalendarRequest } // WithBody - The calendar details. +// func (f MLPutCalendar) WithBody(v io.Reader) func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f MLPutCalendar) WithBody(v io.Reader) func(*MLPutCalendarRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLPutCalendar) WithPretty() func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f MLPutCalendar) WithPretty() func(*MLPutCalendarRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPutCalendar) WithHuman() func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f MLPutCalendar) WithHuman() func(*MLPutCalendarRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutCalendar) WithErrorTrace() func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f MLPutCalendar) WithErrorTrace() func(*MLPutCalendarRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPutCalendar) WithFilterPath(v ...string) func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f MLPutCalendar) WithFilterPath(v ...string) func(*MLPutCalendarRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLPutCalendar) WithHeader(h map[string]string) func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f MLPutCalendar) WithHeader(h map[string]string) func(*MLPutCalendarReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutCalendar) WithOpaqueID(s string) func(*MLPutCalendarRequest) { return func(r *MLPutCalendarRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar_job.go index 4586ca4992f..71b94009ede 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_calendar_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newMLPutCalendarJobFunc(t Transport) MLPutCalendarJob { // MLPutCalendarJob - Adds an anomaly detection job to a calendar. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html. +// type MLPutCalendarJob func(calendar_id string, job_id string, o ...func(*MLPutCalendarJobRequest)) (*Response, error) // MLPutCalendarJobRequest configures the ML Put Calendar Job API request. +// type MLPutCalendarJobRequest struct { CalendarID string JobID string @@ -58,6 +60,7 @@ type MLPutCalendarJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLPutCalendarJob) WithContext(v context.Context) func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f MLPutCalendarJob) WithContext(v context.Context) func(*MLPutCalendarJobR } // WithPretty makes the response body pretty-printed. +// func (f MLPutCalendarJob) WithPretty() func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f MLPutCalendarJob) WithPretty() func(*MLPutCalendarJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPutCalendarJob) WithHuman() func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f MLPutCalendarJob) WithHuman() func(*MLPutCalendarJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutCalendarJob) WithErrorTrace() func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f MLPutCalendarJob) WithErrorTrace() func(*MLPutCalendarJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPutCalendarJob) WithFilterPath(v ...string) func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f MLPutCalendarJob) WithFilterPath(v ...string) func(*MLPutCalendarJobRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLPutCalendarJob) WithHeader(h map[string]string) func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f MLPutCalendarJob) WithHeader(h map[string]string) func(*MLPutCalendarJob } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutCalendarJob) WithOpaqueID(s string) func(*MLPutCalendarJobRequest) { return func(r *MLPutCalendarJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_data_frame_analytics.go index 004369ed872..5e885fe7be0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { // MLPutDataFrameAnalytics - Instantiates a data frame analytics job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html. +// type MLPutDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) // MLPutDataFrameAnalyticsRequest configures the ML Put Data Frame Analytics API request. +// type MLPutDataFrameAnalyticsRequest struct { ID string @@ -60,6 +62,7 @@ type MLPutDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp 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 @@ -122,10 +129,6 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f MLPutDataFrameAnalytics) WithContext(v context.Context) func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f MLPutDataFrameAnalytics) WithContext(v context.Context) func(*MLPutDataF } // WithPretty makes the response body pretty-printed. +// func (f MLPutDataFrameAnalytics) WithPretty() func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { r.Pretty = true @@ -159,6 +164,7 @@ func (f MLPutDataFrameAnalytics) WithPretty() func(*MLPutDataFrameAnalyticsReque } // WithHuman makes statistical values human-readable. +// func (f MLPutDataFrameAnalytics) WithHuman() func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { r.Human = true @@ -166,6 +172,7 @@ func (f MLPutDataFrameAnalytics) WithHuman() func(*MLPutDataFrameAnalyticsReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutDataFrameAnalytics) WithErrorTrace() func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -173,6 +180,7 @@ func (f MLPutDataFrameAnalytics) WithErrorTrace() func(*MLPutDataFrameAnalyticsR } // WithFilterPath filters the properties of the response body. +// func (f MLPutDataFrameAnalytics) WithFilterPath(v ...string) func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { r.FilterPath = v @@ -180,6 +188,7 @@ func (f MLPutDataFrameAnalytics) WithFilterPath(v ...string) func(*MLPutDataFram } // WithHeader adds the headers to the HTTP request. +// func (f MLPutDataFrameAnalytics) WithHeader(h map[string]string) func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { if r.Header == nil { @@ -192,6 +201,7 @@ func (f MLPutDataFrameAnalytics) WithHeader(h map[string]string) func(*MLPutData } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutDataFrameAnalytics) WithOpaqueID(s string) func(*MLPutDataFrameAnalyticsRequest) { return func(r *MLPutDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_datafeed.go index d0acdc352b1..5ce7658f84d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLPutDatafeedFunc(t Transport) MLPutDatafeed { // MLPutDatafeed - Instantiates a datafeed. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html. +// type MLPutDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLPutDatafeedRequest)) (*Response, error) // MLPutDatafeedRequest configures the ML Put Datafeed API request. +// type MLPutDatafeedRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type MLPutDatafeedRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res 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 @@ -142,10 +149,6 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f MLPutDatafeed) WithContext(v context.Context) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f MLPutDatafeed) WithContext(v context.Context) func(*MLPutDatafeedRequest } // WithAllowNoIndices - ignore if the source indices expressions resolves to no concrete indices (default: true). +// func (f MLPutDatafeed) WithAllowNoIndices(v bool) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.AllowNoIndices = &v @@ -179,6 +184,7 @@ func (f MLPutDatafeed) WithAllowNoIndices(v bool) func(*MLPutDatafeedRequest) { } // WithExpandWildcards - whether source index expressions should get expanded to open or closed indices (default: open). +// func (f MLPutDatafeed) WithExpandWildcards(v string) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.ExpandWildcards = v @@ -186,6 +192,7 @@ func (f MLPutDatafeed) WithExpandWildcards(v string) func(*MLPutDatafeedRequest) } // WithIgnoreThrottled - ignore indices that are marked as throttled (default: true). +// func (f MLPutDatafeed) WithIgnoreThrottled(v bool) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.IgnoreThrottled = &v @@ -193,6 +200,7 @@ func (f MLPutDatafeed) WithIgnoreThrottled(v bool) func(*MLPutDatafeedRequest) { } // WithIgnoreUnavailable - ignore unavailable indexes (default: false). +// func (f MLPutDatafeed) WithIgnoreUnavailable(v bool) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.IgnoreUnavailable = &v @@ -200,6 +208,7 @@ func (f MLPutDatafeed) WithIgnoreUnavailable(v bool) func(*MLPutDatafeedRequest) } // WithPretty makes the response body pretty-printed. +// func (f MLPutDatafeed) WithPretty() func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.Pretty = true @@ -207,6 +216,7 @@ func (f MLPutDatafeed) WithPretty() func(*MLPutDatafeedRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPutDatafeed) WithHuman() func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.Human = true @@ -214,6 +224,7 @@ func (f MLPutDatafeed) WithHuman() func(*MLPutDatafeedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutDatafeed) WithErrorTrace() func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.ErrorTrace = true @@ -221,6 +232,7 @@ func (f MLPutDatafeed) WithErrorTrace() func(*MLPutDatafeedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPutDatafeed) WithFilterPath(v ...string) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.FilterPath = v @@ -228,6 +240,7 @@ func (f MLPutDatafeed) WithFilterPath(v ...string) func(*MLPutDatafeedRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLPutDatafeed) WithHeader(h map[string]string) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { if r.Header == nil { @@ -240,6 +253,7 @@ func (f MLPutDatafeed) WithHeader(h map[string]string) func(*MLPutDatafeedReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutDatafeed) WithOpaqueID(s string) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_filter.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_filter.go index 3c827771ed1..f987f4bd5d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_filter.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPutFilterFunc(t Transport) MLPutFilter { // MLPutFilter - Instantiates a filter. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html. +// type MLPutFilter func(body io.Reader, filter_id string, o ...func(*MLPutFilterRequest)) (*Response, error) // MLPutFilterRequest configures the ML Put Filter API request. +// type MLPutFilterRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLPutFilterRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo 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 @@ -120,10 +127,6 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f MLPutFilter) WithContext(v context.Context) func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f MLPutFilter) WithContext(v context.Context) func(*MLPutFilterRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLPutFilter) WithPretty() func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f MLPutFilter) WithPretty() func(*MLPutFilterRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPutFilter) WithHuman() func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f MLPutFilter) WithHuman() func(*MLPutFilterRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutFilter) WithErrorTrace() func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f MLPutFilter) WithErrorTrace() func(*MLPutFilterRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPutFilter) WithFilterPath(v ...string) func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f MLPutFilter) WithFilterPath(v ...string) func(*MLPutFilterRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLPutFilter) WithHeader(h map[string]string) func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f MLPutFilter) WithHeader(h map[string]string) func(*MLPutFilterRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutFilter) WithOpaqueID(s string) func(*MLPutFilterRequest) { return func(r *MLPutFilterRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_job.go index cbeb3018a5f..72f99106d4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLPutJobFunc(t Transport) MLPutJob { // MLPutJob - Instantiates an anomaly detection job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html. +// type MLPutJob func(job_id string, body io.Reader, o ...func(*MLPutJobRequest)) (*Response, error) // MLPutJobRequest configures the ML Put Job API request. +// type MLPutJobRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type MLPutJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response 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 @@ -142,10 +149,6 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f MLPutJob) WithContext(v context.Context) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f MLPutJob) WithContext(v context.Context) func(*MLPutJobRequest) { } // WithAllowNoIndices - ignore if the source indices expressions resolves to no concrete indices (default: true). only set if datafeed_config is provided.. +// func (f MLPutJob) WithAllowNoIndices(v bool) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.AllowNoIndices = &v @@ -179,6 +184,7 @@ func (f MLPutJob) WithAllowNoIndices(v bool) func(*MLPutJobRequest) { } // WithExpandWildcards - whether source index expressions should get expanded to open or closed indices (default: open). only set if datafeed_config is provided.. +// func (f MLPutJob) WithExpandWildcards(v string) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.ExpandWildcards = v @@ -186,6 +192,7 @@ func (f MLPutJob) WithExpandWildcards(v string) func(*MLPutJobRequest) { } // WithIgnoreThrottled - ignore indices that are marked as throttled (default: true). only set if datafeed_config is provided.. +// func (f MLPutJob) WithIgnoreThrottled(v bool) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.IgnoreThrottled = &v @@ -193,6 +200,7 @@ func (f MLPutJob) WithIgnoreThrottled(v bool) func(*MLPutJobRequest) { } // WithIgnoreUnavailable - ignore unavailable indexes (default: false). only set if datafeed_config is provided.. +// func (f MLPutJob) WithIgnoreUnavailable(v bool) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.IgnoreUnavailable = &v @@ -200,6 +208,7 @@ func (f MLPutJob) WithIgnoreUnavailable(v bool) func(*MLPutJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLPutJob) WithPretty() func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.Pretty = true @@ -207,6 +216,7 @@ func (f MLPutJob) WithPretty() func(*MLPutJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPutJob) WithHuman() func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.Human = true @@ -214,6 +224,7 @@ func (f MLPutJob) WithHuman() func(*MLPutJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutJob) WithErrorTrace() func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.ErrorTrace = true @@ -221,6 +232,7 @@ func (f MLPutJob) WithErrorTrace() func(*MLPutJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPutJob) WithFilterPath(v ...string) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.FilterPath = v @@ -228,6 +240,7 @@ func (f MLPutJob) WithFilterPath(v ...string) func(*MLPutJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLPutJob) WithHeader(h map[string]string) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { if r.Header == nil { @@ -240,6 +253,7 @@ func (f MLPutJob) WithHeader(h map[string]string) func(*MLPutJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutJob) WithOpaqueID(s string) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model.go index 7febbe67eae..fbf29e4f1ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLPutTrainedModelFunc(t Transport) MLPutTrainedModel { // MLPutTrainedModel - Creates an inference trained model. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html. +// type MLPutTrainedModel func(body io.Reader, model_id string, o ...func(*MLPutTrainedModelRequest)) (*Response, error) // MLPutTrainedModelRequest configures the ML Put Trained Model API request. +// type MLPutTrainedModelRequest struct { Body io.Reader @@ -63,6 +65,7 @@ type MLPutTrainedModelRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -115,6 +118,10 @@ func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) ( 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 @@ -127,10 +134,6 @@ func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) ( } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -150,6 +153,7 @@ func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f MLPutTrainedModel) WithContext(v context.Context) func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { r.ctx = v @@ -157,6 +161,7 @@ func (f MLPutTrainedModel) WithContext(v context.Context) func(*MLPutTrainedMode } // WithDeferDefinitionDecompression - if set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations.. +// func (f MLPutTrainedModel) WithDeferDefinitionDecompression(v bool) func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { r.DeferDefinitionDecompression = &v @@ -164,6 +169,7 @@ func (f MLPutTrainedModel) WithDeferDefinitionDecompression(v bool) func(*MLPutT } // WithPretty makes the response body pretty-printed. +// func (f MLPutTrainedModel) WithPretty() func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { r.Pretty = true @@ -171,6 +177,7 @@ func (f MLPutTrainedModel) WithPretty() func(*MLPutTrainedModelRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLPutTrainedModel) WithHuman() func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { r.Human = true @@ -178,6 +185,7 @@ func (f MLPutTrainedModel) WithHuman() func(*MLPutTrainedModelRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutTrainedModel) WithErrorTrace() func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { r.ErrorTrace = true @@ -185,6 +193,7 @@ func (f MLPutTrainedModel) WithErrorTrace() func(*MLPutTrainedModelRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLPutTrainedModel) WithFilterPath(v ...string) func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { r.FilterPath = v @@ -192,6 +201,7 @@ func (f MLPutTrainedModel) WithFilterPath(v ...string) func(*MLPutTrainedModelRe } // WithHeader adds the headers to the HTTP request. +// func (f MLPutTrainedModel) WithHeader(h map[string]string) func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { if r.Header == nil { @@ -204,6 +214,7 @@ func (f MLPutTrainedModel) WithHeader(h map[string]string) func(*MLPutTrainedMod } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutTrainedModel) WithOpaqueID(s string) func(*MLPutTrainedModelRequest) { return func(r *MLPutTrainedModelRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model_alias.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model_alias.go index b00595d4765..b5d811d9bd7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.put_trained_model_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLPutTrainedModelAliasFunc(t Transport) MLPutTrainedModelAlias { // MLPutTrainedModelAlias - Creates a new model alias (or reassigns an existing one) to refer to the trained model // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html. +// type MLPutTrainedModelAlias func(model_alias string, model_id string, o ...func(*MLPutTrainedModelAliasRequest)) (*Response, error) // MLPutTrainedModelAliasRequest configures the ML Put Trained Model Alias API request. +// type MLPutTrainedModelAliasRequest struct { ModelAlias string ModelID string @@ -61,6 +63,7 @@ type MLPutTrainedModelAliasRequest struct { } // Do executes the request and returns response or error. +// func (r MLPutTrainedModelAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -148,6 +151,7 @@ func (r MLPutTrainedModelAliasRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f MLPutTrainedModelAlias) WithContext(v context.Context) func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { r.ctx = v @@ -155,6 +159,7 @@ func (f MLPutTrainedModelAlias) WithContext(v context.Context) func(*MLPutTraine } // WithReassign - if the model_alias already exists and points to a separate model_id, this parameter must be true. defaults to false.. +// func (f MLPutTrainedModelAlias) WithReassign(v bool) func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { r.Reassign = &v @@ -162,6 +167,7 @@ func (f MLPutTrainedModelAlias) WithReassign(v bool) func(*MLPutTrainedModelAlia } // WithPretty makes the response body pretty-printed. +// func (f MLPutTrainedModelAlias) WithPretty() func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { r.Pretty = true @@ -169,6 +175,7 @@ func (f MLPutTrainedModelAlias) WithPretty() func(*MLPutTrainedModelAliasRequest } // WithHuman makes statistical values human-readable. +// func (f MLPutTrainedModelAlias) WithHuman() func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { r.Human = true @@ -176,6 +183,7 @@ func (f MLPutTrainedModelAlias) WithHuman() func(*MLPutTrainedModelAliasRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLPutTrainedModelAlias) WithErrorTrace() func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { r.ErrorTrace = true @@ -183,6 +191,7 @@ func (f MLPutTrainedModelAlias) WithErrorTrace() func(*MLPutTrainedModelAliasReq } // WithFilterPath filters the properties of the response body. +// func (f MLPutTrainedModelAlias) WithFilterPath(v ...string) func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { r.FilterPath = v @@ -190,6 +199,7 @@ func (f MLPutTrainedModelAlias) WithFilterPath(v ...string) func(*MLPutTrainedMo } // WithHeader adds the headers to the HTTP request. +// func (f MLPutTrainedModelAlias) WithHeader(h map[string]string) func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { if r.Header == nil { @@ -202,6 +212,7 @@ func (f MLPutTrainedModelAlias) WithHeader(h map[string]string) func(*MLPutTrain } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLPutTrainedModelAlias) WithOpaqueID(s string) func(*MLPutTrainedModelAliasRequest) { return func(r *MLPutTrainedModelAliasRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.reset_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.reset_job.go index a1c9f96b18b..cc79ea722f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.reset_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.reset_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLResetJobFunc(t Transport) MLResetJob { // MLResetJob - Resets an existing anomaly detection job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html. +// type MLResetJob func(job_id string, o ...func(*MLResetJobRequest)) (*Response, error) // MLResetJobRequest configures the ML Reset Job API request. +// type MLResetJobRequest struct { JobID string @@ -60,6 +62,7 @@ type MLResetJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLResetJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -145,6 +148,7 @@ func (r MLResetJobRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f MLResetJob) WithContext(v context.Context) func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f MLResetJob) WithContext(v context.Context) func(*MLResetJobRequest) { } // WithWaitForCompletion - should this request wait until the operation has completed before returning. +// func (f MLResetJob) WithWaitForCompletion(v bool) func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { r.WaitForCompletion = &v @@ -159,6 +164,7 @@ func (f MLResetJob) WithWaitForCompletion(v bool) func(*MLResetJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLResetJob) WithPretty() func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f MLResetJob) WithPretty() func(*MLResetJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLResetJob) WithHuman() func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f MLResetJob) WithHuman() func(*MLResetJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLResetJob) WithErrorTrace() func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f MLResetJob) WithErrorTrace() func(*MLResetJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLResetJob) WithFilterPath(v ...string) func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f MLResetJob) WithFilterPath(v ...string) func(*MLResetJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLResetJob) WithHeader(h map[string]string) func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f MLResetJob) WithHeader(h map[string]string) func(*MLResetJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLResetJob) WithOpaqueID(s string) func(*MLResetJobRequest) { return func(r *MLResetJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.revert_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.revert_model_snapshot.go index 0cdd04ca45c..466b1ba1f7a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.revert_model_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLRevertModelSnapshotFunc(t Transport) MLRevertModelSnapshot { // MLRevertModelSnapshot - Reverts to a specific snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html. +// type MLRevertModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLRevertModelSnapshotRequest)) (*Response, error) // MLRevertModelSnapshotRequest configures the ML Revert Model Snapshot API request. +// type MLRevertModelSnapshotRequest struct { Body io.Reader @@ -64,6 +66,7 @@ type MLRevertModelSnapshotRequest struct { } // Do executes the request and returns response or error. +// func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -122,6 +125,10 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor 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 @@ -134,10 +141,6 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -157,6 +160,7 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f MLRevertModelSnapshot) WithContext(v context.Context) func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.ctx = v @@ -164,6 +168,7 @@ func (f MLRevertModelSnapshot) WithContext(v context.Context) func(*MLRevertMode } // WithBody - Reversion options. +// func (f MLRevertModelSnapshot) WithBody(v io.Reader) func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.Body = v @@ -171,6 +176,7 @@ func (f MLRevertModelSnapshot) WithBody(v io.Reader) func(*MLRevertModelSnapshot } // WithDeleteInterveningResults - should we reset the results back to the time of the snapshot?. +// func (f MLRevertModelSnapshot) WithDeleteInterveningResults(v bool) func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.DeleteInterveningResults = &v @@ -178,6 +184,7 @@ func (f MLRevertModelSnapshot) WithDeleteInterveningResults(v bool) func(*MLReve } // WithPretty makes the response body pretty-printed. +// func (f MLRevertModelSnapshot) WithPretty() func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.Pretty = true @@ -185,6 +192,7 @@ func (f MLRevertModelSnapshot) WithPretty() func(*MLRevertModelSnapshotRequest) } // WithHuman makes statistical values human-readable. +// func (f MLRevertModelSnapshot) WithHuman() func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.Human = true @@ -192,6 +200,7 @@ func (f MLRevertModelSnapshot) WithHuman() func(*MLRevertModelSnapshotRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLRevertModelSnapshot) WithErrorTrace() func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.ErrorTrace = true @@ -199,6 +208,7 @@ func (f MLRevertModelSnapshot) WithErrorTrace() func(*MLRevertModelSnapshotReque } // WithFilterPath filters the properties of the response body. +// func (f MLRevertModelSnapshot) WithFilterPath(v ...string) func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { r.FilterPath = v @@ -206,6 +216,7 @@ func (f MLRevertModelSnapshot) WithFilterPath(v ...string) func(*MLRevertModelSn } // WithHeader adds the headers to the HTTP request. +// func (f MLRevertModelSnapshot) WithHeader(h map[string]string) func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { if r.Header == nil { @@ -218,6 +229,7 @@ func (f MLRevertModelSnapshot) WithHeader(h map[string]string) func(*MLRevertMod } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLRevertModelSnapshot) WithOpaqueID(s string) func(*MLRevertModelSnapshotRequest) { return func(r *MLRevertModelSnapshotRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.set_upgrade_mode.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.set_upgrade_mode.go index fa6bb569710..9e4752c3291 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.set_upgrade_mode.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLSetUpgradeModeFunc(t Transport) MLSetUpgradeMode { // MLSetUpgradeMode - Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html. +// type MLSetUpgradeMode func(o ...func(*MLSetUpgradeModeRequest)) (*Response, error) // MLSetUpgradeModeRequest configures the ML Set Upgrade Mode API request. +// type MLSetUpgradeModeRequest struct { Enabled *bool Timeout time.Duration @@ -60,6 +62,7 @@ type MLSetUpgradeModeRequest struct { } // Do executes the request and returns response or error. +// func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLSetUpgradeMode) WithContext(v context.Context) func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f MLSetUpgradeMode) WithContext(v context.Context) func(*MLSetUpgradeModeR } // WithEnabled - whether to enable upgrade_mode ml setting or not. defaults to false.. +// func (f MLSetUpgradeMode) WithEnabled(v bool) func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.Enabled = &v @@ -156,6 +161,7 @@ func (f MLSetUpgradeMode) WithEnabled(v bool) func(*MLSetUpgradeModeRequest) { } // WithTimeout - controls the time to wait before action times out. defaults to 30 seconds. +// func (f MLSetUpgradeMode) WithTimeout(v time.Duration) func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.Timeout = v @@ -163,6 +169,7 @@ func (f MLSetUpgradeMode) WithTimeout(v time.Duration) func(*MLSetUpgradeModeReq } // WithPretty makes the response body pretty-printed. +// func (f MLSetUpgradeMode) WithPretty() func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.Pretty = true @@ -170,6 +177,7 @@ func (f MLSetUpgradeMode) WithPretty() func(*MLSetUpgradeModeRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLSetUpgradeMode) WithHuman() func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.Human = true @@ -177,6 +185,7 @@ func (f MLSetUpgradeMode) WithHuman() func(*MLSetUpgradeModeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLSetUpgradeMode) WithErrorTrace() func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.ErrorTrace = true @@ -184,6 +193,7 @@ func (f MLSetUpgradeMode) WithErrorTrace() func(*MLSetUpgradeModeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLSetUpgradeMode) WithFilterPath(v ...string) func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { r.FilterPath = v @@ -191,6 +201,7 @@ func (f MLSetUpgradeMode) WithFilterPath(v ...string) func(*MLSetUpgradeModeRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLSetUpgradeMode) WithHeader(h map[string]string) func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { if r.Header == nil { @@ -203,6 +214,7 @@ func (f MLSetUpgradeMode) WithHeader(h map[string]string) func(*MLSetUpgradeMode } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLSetUpgradeMode) WithOpaqueID(s string) func(*MLSetUpgradeModeRequest) { return func(r *MLSetUpgradeModeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_data_frame_analytics.go index 7bb5b543ad5..5a568a88419 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { // MLStartDataFrameAnalytics - Starts a data frame analytics job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html. +// type MLStartDataFrameAnalytics func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) // MLStartDataFrameAnalyticsRequest configures the ML Start Data Frame Analytics API request. +// type MLStartDataFrameAnalyticsRequest struct { ID string @@ -63,6 +65,7 @@ type MLStartDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -119,6 +122,10 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran 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 @@ -131,10 +138,6 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -154,6 +157,7 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f MLStartDataFrameAnalytics) WithContext(v context.Context) func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f MLStartDataFrameAnalytics) WithContext(v context.Context) func(*MLStartD } // WithBody - The start data frame analytics parameters. +// func (f MLStartDataFrameAnalytics) WithBody(v io.Reader) func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.Body = v @@ -168,6 +173,7 @@ func (f MLStartDataFrameAnalytics) WithBody(v io.Reader) func(*MLStartDataFrameA } // WithTimeout - controls the time to wait until the task has started. defaults to 20 seconds. +// func (f MLStartDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.Timeout = v @@ -175,6 +181,7 @@ func (f MLStartDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLStartDat } // WithPretty makes the response body pretty-printed. +// func (f MLStartDataFrameAnalytics) WithPretty() func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.Pretty = true @@ -182,6 +189,7 @@ func (f MLStartDataFrameAnalytics) WithPretty() func(*MLStartDataFrameAnalyticsR } // WithHuman makes statistical values human-readable. +// func (f MLStartDataFrameAnalytics) WithHuman() func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.Human = true @@ -189,6 +197,7 @@ func (f MLStartDataFrameAnalytics) WithHuman() func(*MLStartDataFrameAnalyticsRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLStartDataFrameAnalytics) WithErrorTrace() func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -196,6 +205,7 @@ func (f MLStartDataFrameAnalytics) WithErrorTrace() func(*MLStartDataFrameAnalyt } // WithFilterPath filters the properties of the response body. +// func (f MLStartDataFrameAnalytics) WithFilterPath(v ...string) func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { r.FilterPath = v @@ -203,6 +213,7 @@ func (f MLStartDataFrameAnalytics) WithFilterPath(v ...string) func(*MLStartData } // WithHeader adds the headers to the HTTP request. +// func (f MLStartDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { if r.Header == nil { @@ -215,6 +226,7 @@ func (f MLStartDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStart } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLStartDataFrameAnalytics) WithOpaqueID(s string) func(*MLStartDataFrameAnalyticsRequest) { return func(r *MLStartDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_datafeed.go index 2cdb46819fc..0fb716dc354 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.start_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLStartDatafeedFunc(t Transport) MLStartDatafeed { // MLStartDatafeed - Starts one or more datafeeds. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html. +// type MLStartDatafeed func(datafeed_id string, o ...func(*MLStartDatafeedRequest)) (*Response, error) // MLStartDatafeedRequest configures the ML Start Datafeed API request. +// type MLStartDatafeedRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type MLStartDatafeedRequest struct { } // Do executes the request and returns response or error. +// func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -127,6 +130,10 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -139,10 +146,6 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -162,6 +165,7 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f MLStartDatafeed) WithContext(v context.Context) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.ctx = v @@ -169,6 +173,7 @@ func (f MLStartDatafeed) WithContext(v context.Context) func(*MLStartDatafeedReq } // WithBody - The start datafeed parameters. +// func (f MLStartDatafeed) WithBody(v io.Reader) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.Body = v @@ -176,6 +181,7 @@ func (f MLStartDatafeed) WithBody(v io.Reader) func(*MLStartDatafeedRequest) { } // WithEnd - the end time when the datafeed should stop. when not set, the datafeed continues in real time. +// func (f MLStartDatafeed) WithEnd(v string) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.End = v @@ -183,6 +189,7 @@ func (f MLStartDatafeed) WithEnd(v string) func(*MLStartDatafeedRequest) { } // WithStart - the start time from where the datafeed should begin. +// func (f MLStartDatafeed) WithStart(v string) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.Start = v @@ -190,6 +197,7 @@ func (f MLStartDatafeed) WithStart(v string) func(*MLStartDatafeedRequest) { } // WithTimeout - controls the time to wait until a datafeed has started. default to 20 seconds. +// func (f MLStartDatafeed) WithTimeout(v time.Duration) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.Timeout = v @@ -197,6 +205,7 @@ func (f MLStartDatafeed) WithTimeout(v time.Duration) func(*MLStartDatafeedReque } // WithPretty makes the response body pretty-printed. +// func (f MLStartDatafeed) WithPretty() func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.Pretty = true @@ -204,6 +213,7 @@ func (f MLStartDatafeed) WithPretty() func(*MLStartDatafeedRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLStartDatafeed) WithHuman() func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.Human = true @@ -211,6 +221,7 @@ func (f MLStartDatafeed) WithHuman() func(*MLStartDatafeedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLStartDatafeed) WithErrorTrace() func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.ErrorTrace = true @@ -218,6 +229,7 @@ func (f MLStartDatafeed) WithErrorTrace() func(*MLStartDatafeedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLStartDatafeed) WithFilterPath(v ...string) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.FilterPath = v @@ -225,6 +237,7 @@ func (f MLStartDatafeed) WithFilterPath(v ...string) func(*MLStartDatafeedReques } // WithHeader adds the headers to the HTTP request. +// func (f MLStartDatafeed) WithHeader(h map[string]string) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { if r.Header == nil { @@ -237,6 +250,7 @@ func (f MLStartDatafeed) WithHeader(h map[string]string) func(*MLStartDatafeedRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLStartDatafeed) WithOpaqueID(s string) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_data_frame_analytics.go index 3e8f2ac0f26..d3c78d9e248 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { // MLStopDataFrameAnalytics - Stops one or more data frame analytics jobs. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html. +// type MLStopDataFrameAnalytics func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) // MLStopDataFrameAnalyticsRequest configures the ML Stop Data Frame Analytics API request. +// type MLStopDataFrameAnalyticsRequest struct { ID string @@ -66,6 +68,7 @@ type MLStopDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans 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 @@ -142,10 +149,6 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f MLStopDataFrameAnalytics) WithContext(v context.Context) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f MLStopDataFrameAnalytics) WithContext(v context.Context) func(*MLStopDat } // WithBody - The stop data frame analytics parameters. +// func (f MLStopDataFrameAnalytics) WithBody(v io.Reader) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.Body = v @@ -179,6 +184,7 @@ func (f MLStopDataFrameAnalytics) WithBody(v io.Reader) func(*MLStopDataFrameAna } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame analytics. (this includes `_all` string or when no data frame analytics have been specified). +// func (f MLStopDataFrameAnalytics) WithAllowNoMatch(v bool) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.AllowNoMatch = &v @@ -186,6 +192,7 @@ func (f MLStopDataFrameAnalytics) WithAllowNoMatch(v bool) func(*MLStopDataFrame } // WithForce - true if the data frame analytics should be forcefully stopped. +// func (f MLStopDataFrameAnalytics) WithForce(v bool) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.Force = &v @@ -193,6 +200,7 @@ func (f MLStopDataFrameAnalytics) WithForce(v bool) func(*MLStopDataFrameAnalyti } // WithTimeout - controls the time to wait until the task has stopped. defaults to 20 seconds. +// func (f MLStopDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.Timeout = v @@ -200,6 +208,7 @@ func (f MLStopDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLStopDataF } // WithPretty makes the response body pretty-printed. +// func (f MLStopDataFrameAnalytics) WithPretty() func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.Pretty = true @@ -207,6 +216,7 @@ func (f MLStopDataFrameAnalytics) WithPretty() func(*MLStopDataFrameAnalyticsReq } // WithHuman makes statistical values human-readable. +// func (f MLStopDataFrameAnalytics) WithHuman() func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.Human = true @@ -214,6 +224,7 @@ func (f MLStopDataFrameAnalytics) WithHuman() func(*MLStopDataFrameAnalyticsRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLStopDataFrameAnalytics) WithErrorTrace() func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -221,6 +232,7 @@ func (f MLStopDataFrameAnalytics) WithErrorTrace() func(*MLStopDataFrameAnalytic } // WithFilterPath filters the properties of the response body. +// func (f MLStopDataFrameAnalytics) WithFilterPath(v ...string) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { r.FilterPath = v @@ -228,6 +240,7 @@ func (f MLStopDataFrameAnalytics) WithFilterPath(v ...string) func(*MLStopDataFr } // WithHeader adds the headers to the HTTP request. +// func (f MLStopDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { if r.Header == nil { @@ -240,6 +253,7 @@ func (f MLStopDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStopDa } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLStopDataFrameAnalytics) WithOpaqueID(s string) func(*MLStopDataFrameAnalyticsRequest) { return func(r *MLStopDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_datafeed.go index 28309407ded..01e72dd7905 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.stop_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newMLStopDatafeedFunc(t Transport) MLStopDatafeed { // MLStopDatafeed - Stops one or more datafeeds. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html. +// type MLStopDatafeed func(datafeed_id string, o ...func(*MLStopDatafeedRequest)) (*Response, error) // MLStopDatafeedRequest configures the ML Stop Datafeed API request. +// type MLStopDatafeedRequest struct { Body io.Reader @@ -67,6 +69,7 @@ type MLStopDatafeedRequest struct { } // Do executes the request and returns response or error. +// func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -133,6 +136,10 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -145,10 +152,6 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -168,6 +171,7 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f MLStopDatafeed) WithContext(v context.Context) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.ctx = v @@ -175,6 +179,7 @@ func (f MLStopDatafeed) WithContext(v context.Context) func(*MLStopDatafeedReque } // WithBody - The URL params optionally sent in the body. +// func (f MLStopDatafeed) WithBody(v io.Reader) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.Body = v @@ -182,6 +187,7 @@ func (f MLStopDatafeed) WithBody(v io.Reader) func(*MLStopDatafeedRequest) { } // WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f MLStopDatafeed) WithAllowNoDatafeeds(v bool) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.AllowNoDatafeeds = &v @@ -189,6 +195,7 @@ func (f MLStopDatafeed) WithAllowNoDatafeeds(v bool) func(*MLStopDatafeedRequest } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// func (f MLStopDatafeed) WithAllowNoMatch(v bool) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.AllowNoMatch = &v @@ -196,6 +203,7 @@ func (f MLStopDatafeed) WithAllowNoMatch(v bool) func(*MLStopDatafeedRequest) { } // WithForce - true if the datafeed should be forcefully stopped.. +// func (f MLStopDatafeed) WithForce(v bool) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.Force = &v @@ -203,6 +211,7 @@ func (f MLStopDatafeed) WithForce(v bool) func(*MLStopDatafeedRequest) { } // WithTimeout - controls the time to wait until a datafeed has stopped. default to 20 seconds. +// func (f MLStopDatafeed) WithTimeout(v time.Duration) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.Timeout = v @@ -210,6 +219,7 @@ func (f MLStopDatafeed) WithTimeout(v time.Duration) func(*MLStopDatafeedRequest } // WithPretty makes the response body pretty-printed. +// func (f MLStopDatafeed) WithPretty() func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.Pretty = true @@ -217,6 +227,7 @@ func (f MLStopDatafeed) WithPretty() func(*MLStopDatafeedRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLStopDatafeed) WithHuman() func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.Human = true @@ -224,6 +235,7 @@ func (f MLStopDatafeed) WithHuman() func(*MLStopDatafeedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLStopDatafeed) WithErrorTrace() func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.ErrorTrace = true @@ -231,6 +243,7 @@ func (f MLStopDatafeed) WithErrorTrace() func(*MLStopDatafeedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLStopDatafeed) WithFilterPath(v ...string) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { r.FilterPath = v @@ -238,6 +251,7 @@ func (f MLStopDatafeed) WithFilterPath(v ...string) func(*MLStopDatafeedRequest) } // WithHeader adds the headers to the HTTP request. +// func (f MLStopDatafeed) WithHeader(h map[string]string) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { if r.Header == nil { @@ -250,6 +264,7 @@ func (f MLStopDatafeed) WithHeader(h map[string]string) func(*MLStopDatafeedRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLStopDatafeed) WithOpaqueID(s string) func(*MLStopDatafeedRequest) { return func(r *MLStopDatafeedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_data_frame_analytics.go index 3858685e865..a5cf45cd058 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLUpdateDataFrameAnalyticsFunc(t Transport) MLUpdateDataFrameAnalytics { // MLUpdateDataFrameAnalytics - Updates certain properties of a data frame analytics job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html. +// type MLUpdateDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLUpdateDataFrameAnalyticsRequest)) (*Response, error) // MLUpdateDataFrameAnalyticsRequest configures the ML Update Data Frame Analytics API request. +// type MLUpdateDataFrameAnalyticsRequest struct { DocumentID string @@ -60,6 +62,7 @@ type MLUpdateDataFrameAnalyticsRequest struct { } // Do executes the request and returns response or error. +// func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -112,6 +115,10 @@ func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra 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 @@ -124,10 +131,6 @@ func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -147,6 +150,7 @@ func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f MLUpdateDataFrameAnalytics) WithContext(v context.Context) func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f MLUpdateDataFrameAnalytics) WithContext(v context.Context) func(*MLUpdat } // WithPretty makes the response body pretty-printed. +// func (f MLUpdateDataFrameAnalytics) WithPretty() func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { r.Pretty = true @@ -161,6 +166,7 @@ func (f MLUpdateDataFrameAnalytics) WithPretty() func(*MLUpdateDataFrameAnalytic } // WithHuman makes statistical values human-readable. +// func (f MLUpdateDataFrameAnalytics) WithHuman() func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { r.Human = true @@ -168,6 +174,7 @@ func (f MLUpdateDataFrameAnalytics) WithHuman() func(*MLUpdateDataFrameAnalytics } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLUpdateDataFrameAnalytics) WithErrorTrace() func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { r.ErrorTrace = true @@ -175,6 +182,7 @@ func (f MLUpdateDataFrameAnalytics) WithErrorTrace() func(*MLUpdateDataFrameAnal } // WithFilterPath filters the properties of the response body. +// func (f MLUpdateDataFrameAnalytics) WithFilterPath(v ...string) func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { r.FilterPath = v @@ -182,6 +190,7 @@ func (f MLUpdateDataFrameAnalytics) WithFilterPath(v ...string) func(*MLUpdateDa } // WithHeader adds the headers to the HTTP request. +// func (f MLUpdateDataFrameAnalytics) WithHeader(h map[string]string) func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { if r.Header == nil { @@ -194,6 +203,7 @@ func (f MLUpdateDataFrameAnalytics) WithHeader(h map[string]string) func(*MLUpda } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLUpdateDataFrameAnalytics) WithOpaqueID(s string) func(*MLUpdateDataFrameAnalyticsRequest) { return func(r *MLUpdateDataFrameAnalyticsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_datafeed.go index 09d57b2af22..41afe56be6c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLUpdateDatafeedFunc(t Transport) MLUpdateDatafeed { // MLUpdateDatafeed - Updates certain properties of a datafeed. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html. +// type MLUpdateDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLUpdateDatafeedRequest)) (*Response, error) // MLUpdateDatafeedRequest configures the ML Update Datafeed API request. +// type MLUpdateDatafeedRequest struct { Body io.Reader @@ -66,6 +68,7 @@ type MLUpdateDatafeedRequest struct { } // Do executes the request and returns response or error. +// func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -132,6 +135,10 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* 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 @@ -144,10 +151,6 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -167,6 +170,7 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f MLUpdateDatafeed) WithContext(v context.Context) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.ctx = v @@ -174,6 +178,7 @@ func (f MLUpdateDatafeed) WithContext(v context.Context) func(*MLUpdateDatafeedR } // WithAllowNoIndices - ignore if the source indices expressions resolves to no concrete indices (default: true). +// func (f MLUpdateDatafeed) WithAllowNoIndices(v bool) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.AllowNoIndices = &v @@ -181,6 +186,7 @@ func (f MLUpdateDatafeed) WithAllowNoIndices(v bool) func(*MLUpdateDatafeedReque } // WithExpandWildcards - whether source index expressions should get expanded to open or closed indices (default: open). +// func (f MLUpdateDatafeed) WithExpandWildcards(v string) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.ExpandWildcards = v @@ -188,6 +194,7 @@ func (f MLUpdateDatafeed) WithExpandWildcards(v string) func(*MLUpdateDatafeedRe } // WithIgnoreThrottled - ignore indices that are marked as throttled (default: true). +// func (f MLUpdateDatafeed) WithIgnoreThrottled(v bool) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.IgnoreThrottled = &v @@ -195,6 +202,7 @@ func (f MLUpdateDatafeed) WithIgnoreThrottled(v bool) func(*MLUpdateDatafeedRequ } // WithIgnoreUnavailable - ignore unavailable indexes (default: false). +// func (f MLUpdateDatafeed) WithIgnoreUnavailable(v bool) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.IgnoreUnavailable = &v @@ -202,6 +210,7 @@ func (f MLUpdateDatafeed) WithIgnoreUnavailable(v bool) func(*MLUpdateDatafeedRe } // WithPretty makes the response body pretty-printed. +// func (f MLUpdateDatafeed) WithPretty() func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.Pretty = true @@ -209,6 +218,7 @@ func (f MLUpdateDatafeed) WithPretty() func(*MLUpdateDatafeedRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLUpdateDatafeed) WithHuman() func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.Human = true @@ -216,6 +226,7 @@ func (f MLUpdateDatafeed) WithHuman() func(*MLUpdateDatafeedRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLUpdateDatafeed) WithErrorTrace() func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.ErrorTrace = true @@ -223,6 +234,7 @@ func (f MLUpdateDatafeed) WithErrorTrace() func(*MLUpdateDatafeedRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLUpdateDatafeed) WithFilterPath(v ...string) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.FilterPath = v @@ -230,6 +242,7 @@ func (f MLUpdateDatafeed) WithFilterPath(v ...string) func(*MLUpdateDatafeedRequ } // WithHeader adds the headers to the HTTP request. +// func (f MLUpdateDatafeed) WithHeader(h map[string]string) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { if r.Header == nil { @@ -242,6 +255,7 @@ func (f MLUpdateDatafeed) WithHeader(h map[string]string) func(*MLUpdateDatafeed } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLUpdateDatafeed) WithOpaqueID(s string) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_filter.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_filter.go index c3dcf218edb..d3416722601 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_filter.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLUpdateFilterFunc(t Transport) MLUpdateFilter { // MLUpdateFilter - Updates the description of a filter, adds items, or removes items. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html. +// type MLUpdateFilter func(body io.Reader, filter_id string, o ...func(*MLUpdateFilterRequest)) (*Response, error) // MLUpdateFilterRequest configures the ML Update Filter API request. +// type MLUpdateFilterRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLUpdateFilterRequest struct { } // Do executes the request and returns response or error. +// func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -122,10 +129,6 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f MLUpdateFilter) WithContext(v context.Context) func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f MLUpdateFilter) WithContext(v context.Context) func(*MLUpdateFilterReque } // WithPretty makes the response body pretty-printed. +// func (f MLUpdateFilter) WithPretty() func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { r.Pretty = true @@ -159,6 +164,7 @@ func (f MLUpdateFilter) WithPretty() func(*MLUpdateFilterRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLUpdateFilter) WithHuman() func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { r.Human = true @@ -166,6 +172,7 @@ func (f MLUpdateFilter) WithHuman() func(*MLUpdateFilterRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLUpdateFilter) WithErrorTrace() func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { r.ErrorTrace = true @@ -173,6 +180,7 @@ func (f MLUpdateFilter) WithErrorTrace() func(*MLUpdateFilterRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLUpdateFilter) WithFilterPath(v ...string) func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { r.FilterPath = v @@ -180,6 +188,7 @@ func (f MLUpdateFilter) WithFilterPath(v ...string) func(*MLUpdateFilterRequest) } // WithHeader adds the headers to the HTTP request. +// func (f MLUpdateFilter) WithHeader(h map[string]string) func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { if r.Header == nil { @@ -192,6 +201,7 @@ func (f MLUpdateFilter) WithHeader(h map[string]string) func(*MLUpdateFilterRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLUpdateFilter) WithOpaqueID(s string) func(*MLUpdateFilterRequest) { return func(r *MLUpdateFilterRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_job.go index cf221416832..eef17d19b85 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLUpdateJobFunc(t Transport) MLUpdateJob { // MLUpdateJob - Updates certain properties of an anomaly detection job. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html. +// type MLUpdateJob func(job_id string, body io.Reader, o ...func(*MLUpdateJobRequest)) (*Response, error) // MLUpdateJobRequest configures the ML Update Job API request. +// type MLUpdateJobRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type MLUpdateJobRequest struct { } // Do executes the request and returns response or error. +// func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo 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 @@ -122,10 +129,6 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f MLUpdateJob) WithContext(v context.Context) func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f MLUpdateJob) WithContext(v context.Context) func(*MLUpdateJobRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLUpdateJob) WithPretty() func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { r.Pretty = true @@ -159,6 +164,7 @@ func (f MLUpdateJob) WithPretty() func(*MLUpdateJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLUpdateJob) WithHuman() func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { r.Human = true @@ -166,6 +172,7 @@ func (f MLUpdateJob) WithHuman() func(*MLUpdateJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLUpdateJob) WithErrorTrace() func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { r.ErrorTrace = true @@ -173,6 +180,7 @@ func (f MLUpdateJob) WithErrorTrace() func(*MLUpdateJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLUpdateJob) WithFilterPath(v ...string) func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { r.FilterPath = v @@ -180,6 +188,7 @@ func (f MLUpdateJob) WithFilterPath(v ...string) func(*MLUpdateJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLUpdateJob) WithHeader(h map[string]string) func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { if r.Header == nil { @@ -192,6 +201,7 @@ func (f MLUpdateJob) WithHeader(h map[string]string) func(*MLUpdateJobRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLUpdateJob) WithOpaqueID(s string) func(*MLUpdateJobRequest) { return func(r *MLUpdateJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_model_snapshot.go index 4422073ccab..bd9780b2ce8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.update_model_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLUpdateModelSnapshotFunc(t Transport) MLUpdateModelSnapshot { // MLUpdateModelSnapshot - Updates certain properties of a snapshot. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html. +// type MLUpdateModelSnapshot func(snapshot_id string, job_id string, body io.Reader, o ...func(*MLUpdateModelSnapshotRequest)) (*Response, error) // MLUpdateModelSnapshotRequest configures the ML Update Model Snapshot API request. +// type MLUpdateModelSnapshotRequest struct { Body io.Reader @@ -61,6 +63,7 @@ type MLUpdateModelSnapshotRequest struct { } // Do executes the request and returns response or error. +// func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -115,6 +118,10 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor 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 @@ -127,10 +134,6 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -150,6 +153,7 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f MLUpdateModelSnapshot) WithContext(v context.Context) func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { r.ctx = v @@ -157,6 +161,7 @@ func (f MLUpdateModelSnapshot) WithContext(v context.Context) func(*MLUpdateMode } // WithPretty makes the response body pretty-printed. +// func (f MLUpdateModelSnapshot) WithPretty() func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { r.Pretty = true @@ -164,6 +169,7 @@ func (f MLUpdateModelSnapshot) WithPretty() func(*MLUpdateModelSnapshotRequest) } // WithHuman makes statistical values human-readable. +// func (f MLUpdateModelSnapshot) WithHuman() func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { r.Human = true @@ -171,6 +177,7 @@ func (f MLUpdateModelSnapshot) WithHuman() func(*MLUpdateModelSnapshotRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLUpdateModelSnapshot) WithErrorTrace() func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { r.ErrorTrace = true @@ -178,6 +185,7 @@ func (f MLUpdateModelSnapshot) WithErrorTrace() func(*MLUpdateModelSnapshotReque } // WithFilterPath filters the properties of the response body. +// func (f MLUpdateModelSnapshot) WithFilterPath(v ...string) func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { r.FilterPath = v @@ -185,6 +193,7 @@ func (f MLUpdateModelSnapshot) WithFilterPath(v ...string) func(*MLUpdateModelSn } // WithHeader adds the headers to the HTTP request. +// func (f MLUpdateModelSnapshot) WithHeader(h map[string]string) func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { if r.Header == nil { @@ -197,6 +206,7 @@ func (f MLUpdateModelSnapshot) WithHeader(h map[string]string) func(*MLUpdateMod } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLUpdateModelSnapshot) WithOpaqueID(s string) func(*MLUpdateModelSnapshotRequest) { return func(r *MLUpdateModelSnapshotRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.upgrade_job_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.upgrade_job_snapshot.go index 3a714e933e6..41ef64361c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.upgrade_job_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.upgrade_job_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newMLUpgradeJobSnapshotFunc(t Transport) MLUpgradeJobSnapshot { // MLUpgradeJobSnapshot - Upgrades a given job snapshot to the current major version. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html. +// type MLUpgradeJobSnapshot func(snapshot_id string, job_id string, o ...func(*MLUpgradeJobSnapshotRequest)) (*Response, error) // MLUpgradeJobSnapshotRequest configures the ML Upgrade Job Snapshot API request. +// type MLUpgradeJobSnapshotRequest struct { JobID string SnapshotID string @@ -63,6 +65,7 @@ type MLUpgradeJobSnapshotRequest struct { } // Do executes the request and returns response or error. +// func (r MLUpgradeJobSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -156,6 +159,7 @@ func (r MLUpgradeJobSnapshotRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f MLUpgradeJobSnapshot) WithContext(v context.Context) func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f MLUpgradeJobSnapshot) WithContext(v context.Context) func(*MLUpgradeJobS } // WithTimeout - how long should the api wait for the job to be opened and the old snapshot to be loaded.. +// func (f MLUpgradeJobSnapshot) WithTimeout(v time.Duration) func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.Timeout = v @@ -170,6 +175,7 @@ func (f MLUpgradeJobSnapshot) WithTimeout(v time.Duration) func(*MLUpgradeJobSna } // WithWaitForCompletion - should the request wait until the task is complete before responding to the caller. default is false.. +// func (f MLUpgradeJobSnapshot) WithWaitForCompletion(v bool) func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.WaitForCompletion = &v @@ -177,6 +183,7 @@ func (f MLUpgradeJobSnapshot) WithWaitForCompletion(v bool) func(*MLUpgradeJobSn } // WithPretty makes the response body pretty-printed. +// func (f MLUpgradeJobSnapshot) WithPretty() func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.Pretty = true @@ -184,6 +191,7 @@ func (f MLUpgradeJobSnapshot) WithPretty() func(*MLUpgradeJobSnapshotRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLUpgradeJobSnapshot) WithHuman() func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.Human = true @@ -191,6 +199,7 @@ func (f MLUpgradeJobSnapshot) WithHuman() func(*MLUpgradeJobSnapshotRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLUpgradeJobSnapshot) WithErrorTrace() func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.ErrorTrace = true @@ -198,6 +207,7 @@ func (f MLUpgradeJobSnapshot) WithErrorTrace() func(*MLUpgradeJobSnapshotRequest } // WithFilterPath filters the properties of the response body. +// func (f MLUpgradeJobSnapshot) WithFilterPath(v ...string) func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { r.FilterPath = v @@ -205,6 +215,7 @@ func (f MLUpgradeJobSnapshot) WithFilterPath(v ...string) func(*MLUpgradeJobSnap } // WithHeader adds the headers to the HTTP request. +// func (f MLUpgradeJobSnapshot) WithHeader(h map[string]string) func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { if r.Header == nil { @@ -217,6 +228,7 @@ func (f MLUpgradeJobSnapshot) WithHeader(h map[string]string) func(*MLUpgradeJob } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLUpgradeJobSnapshot) WithOpaqueID(s string) func(*MLUpgradeJobSnapshotRequest) { return func(r *MLUpgradeJobSnapshotRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate.go index 50481d2d599..0e429398dc2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLValidateFunc(t Transport) MLValidate { // MLValidate - Validates an anomaly detection job. // // See full documentation at https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html. +// type MLValidate func(body io.Reader, o ...func(*MLValidateRequest)) (*Response, error) // MLValidateRequest configures the ML Validate API request. +// type MLValidateRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type MLValidateRequest struct { } // Do executes the request and returns response or error. +// func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Respon 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 @@ -113,10 +120,6 @@ func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Respon } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f MLValidate) WithContext(v context.Context) func(*MLValidateRequest) { return func(r *MLValidateRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLValidate) WithContext(v context.Context) func(*MLValidateRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MLValidate) WithPretty() func(*MLValidateRequest) { return func(r *MLValidateRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLValidate) WithPretty() func(*MLValidateRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLValidate) WithHuman() func(*MLValidateRequest) { return func(r *MLValidateRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLValidate) WithHuman() func(*MLValidateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLValidate) WithErrorTrace() func(*MLValidateRequest) { return func(r *MLValidateRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLValidate) WithErrorTrace() func(*MLValidateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLValidate) WithFilterPath(v ...string) func(*MLValidateRequest) { return func(r *MLValidateRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLValidate) WithFilterPath(v ...string) func(*MLValidateRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f MLValidate) WithHeader(h map[string]string) func(*MLValidateRequest) { return func(r *MLValidateRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLValidate) WithHeader(h map[string]string) func(*MLValidateRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLValidate) WithOpaqueID(s string) func(*MLValidateRequest) { return func(r *MLValidateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate_detector.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate_detector.go index b560e3b6eba..a676e35015b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate_detector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ml.validate_detector.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMLValidateDetectorFunc(t Transport) MLValidateDetector { // MLValidateDetector - Validates an anomaly detection detector. // // See full documentation at https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html. +// type MLValidateDetector func(body io.Reader, o ...func(*MLValidateDetectorRequest)) (*Response, error) // MLValidateDetectorRequest configures the ML Validate Detector API request. +// type MLValidateDetectorRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type MLValidateDetectorRequest struct { } // Do executes the request and returns response or error. +// func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) 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 @@ -113,10 +120,6 @@ func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f MLValidateDetector) WithContext(v context.Context) func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f MLValidateDetector) WithContext(v context.Context) func(*MLValidateDetec } // WithPretty makes the response body pretty-printed. +// func (f MLValidateDetector) WithPretty() func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f MLValidateDetector) WithPretty() func(*MLValidateDetectorRequest) { } // WithHuman makes statistical values human-readable. +// func (f MLValidateDetector) WithHuman() func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f MLValidateDetector) WithHuman() func(*MLValidateDetectorRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MLValidateDetector) WithErrorTrace() func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f MLValidateDetector) WithErrorTrace() func(*MLValidateDetectorRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MLValidateDetector) WithFilterPath(v ...string) func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f MLValidateDetector) WithFilterPath(v ...string) func(*MLValidateDetector } // WithHeader adds the headers to the HTTP request. +// func (f MLValidateDetector) WithHeader(h map[string]string) func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f MLValidateDetector) WithHeader(h map[string]string) func(*MLValidateDete } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MLValidateDetector) WithOpaqueID(s string) func(*MLValidateDetectorRequest) { return func(r *MLValidateDetectorRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.monitoring.bulk.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.monitoring.bulk.go index c3093b0e3c2..6fc695aec3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.monitoring.bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.monitoring.bulk.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newMonitoringBulkFunc(t Transport) MonitoringBulk { // MonitoringBulk - Used by the monitoring features to send monitoring data. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html. +// type MonitoringBulk func(body io.Reader, o ...func(*MonitoringBulkRequest)) (*Response, error) // MonitoringBulkRequest configures the Monitoring Bulk API request. +// type MonitoringBulkRequest struct { DocumentType string @@ -64,6 +66,7 @@ type MonitoringBulkRequest struct { } // Do executes the request and returns response or error. +// func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -126,6 +129,10 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -138,10 +145,6 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -161,6 +164,7 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f MonitoringBulk) WithContext(v context.Context) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.ctx = v @@ -168,6 +172,7 @@ func (f MonitoringBulk) WithContext(v context.Context) func(*MonitoringBulkReque } // WithDocumentType - default document type for items which don't provide one. +// func (f MonitoringBulk) WithDocumentType(v string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.DocumentType = v @@ -175,6 +180,7 @@ func (f MonitoringBulk) WithDocumentType(v string) func(*MonitoringBulkRequest) } // WithInterval - collection interval (e.g., '10s' or '10000ms') of the payload. +// func (f MonitoringBulk) WithInterval(v string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.Interval = v @@ -182,6 +188,7 @@ func (f MonitoringBulk) WithInterval(v string) func(*MonitoringBulkRequest) { } // WithSystemAPIVersion - api version of the monitored system. +// func (f MonitoringBulk) WithSystemAPIVersion(v string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.SystemAPIVersion = v @@ -189,6 +196,7 @@ func (f MonitoringBulk) WithSystemAPIVersion(v string) func(*MonitoringBulkReque } // WithSystemID - identifier of the monitored system. +// func (f MonitoringBulk) WithSystemID(v string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.SystemID = v @@ -196,6 +204,7 @@ func (f MonitoringBulk) WithSystemID(v string) func(*MonitoringBulkRequest) { } // WithPretty makes the response body pretty-printed. +// func (f MonitoringBulk) WithPretty() func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.Pretty = true @@ -203,6 +212,7 @@ func (f MonitoringBulk) WithPretty() func(*MonitoringBulkRequest) { } // WithHuman makes statistical values human-readable. +// func (f MonitoringBulk) WithHuman() func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.Human = true @@ -210,6 +220,7 @@ func (f MonitoringBulk) WithHuman() func(*MonitoringBulkRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f MonitoringBulk) WithErrorTrace() func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.ErrorTrace = true @@ -217,6 +228,7 @@ func (f MonitoringBulk) WithErrorTrace() func(*MonitoringBulkRequest) { } // WithFilterPath filters the properties of the response body. +// func (f MonitoringBulk) WithFilterPath(v ...string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { r.FilterPath = v @@ -224,6 +236,7 @@ func (f MonitoringBulk) WithFilterPath(v ...string) func(*MonitoringBulkRequest) } // WithHeader adds the headers to the HTTP request. +// func (f MonitoringBulk) WithHeader(h map[string]string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { if r.Header == nil { @@ -236,6 +249,7 @@ func (f MonitoringBulk) WithHeader(h map[string]string) func(*MonitoringBulkRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f MonitoringBulk) WithOpaqueID(s string) func(*MonitoringBulkRequest) { return func(r *MonitoringBulkRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.open_point_in_time.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.open_point_in_time.go index 6b95917d035..255d5ce66ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.open_point_in_time.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.open_point_in_time.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newOpenPointInTimeFunc(t Transport) OpenPointInTime { // OpenPointInTime - Open a point in time that can be used in subsequent searches // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html. +// type OpenPointInTime func(index []string, keep_alive string, o ...func(*OpenPointInTimeRequest)) (*Response, error) // OpenPointInTimeRequest configures the Open Point In Time API request. +// type OpenPointInTimeRequest struct { Index []string @@ -65,6 +67,7 @@ type OpenPointInTimeRequest struct { } // Do executes the request and returns response or error. +// func (r OpenPointInTimeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -166,6 +169,7 @@ func (r OpenPointInTimeRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f OpenPointInTime) WithContext(v context.Context) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.ctx = v @@ -173,6 +177,7 @@ func (f OpenPointInTime) WithContext(v context.Context) func(*OpenPointInTimeReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f OpenPointInTime) WithExpandWildcards(v string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.ExpandWildcards = v @@ -180,6 +185,7 @@ func (f OpenPointInTime) WithExpandWildcards(v string) func(*OpenPointInTimeRequ } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f OpenPointInTime) WithIgnoreUnavailable(v bool) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.IgnoreUnavailable = &v @@ -187,6 +193,7 @@ func (f OpenPointInTime) WithIgnoreUnavailable(v bool) func(*OpenPointInTimeRequ } // WithKeepAlive - specific the time to live for the point in time. +// func (f OpenPointInTime) WithKeepAlive(v string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.KeepAlive = v @@ -194,6 +201,7 @@ func (f OpenPointInTime) WithKeepAlive(v string) func(*OpenPointInTimeRequest) { } // WithPreference - specify the node or shard the operation should be performed on (default: random). +// func (f OpenPointInTime) WithPreference(v string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.Preference = v @@ -201,6 +209,7 @@ func (f OpenPointInTime) WithPreference(v string) func(*OpenPointInTimeRequest) } // WithRouting - specific routing value. +// func (f OpenPointInTime) WithRouting(v string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.Routing = v @@ -208,6 +217,7 @@ func (f OpenPointInTime) WithRouting(v string) func(*OpenPointInTimeRequest) { } // WithPretty makes the response body pretty-printed. +// func (f OpenPointInTime) WithPretty() func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.Pretty = true @@ -215,6 +225,7 @@ func (f OpenPointInTime) WithPretty() func(*OpenPointInTimeRequest) { } // WithHuman makes statistical values human-readable. +// func (f OpenPointInTime) WithHuman() func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.Human = true @@ -222,6 +233,7 @@ func (f OpenPointInTime) WithHuman() func(*OpenPointInTimeRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f OpenPointInTime) WithErrorTrace() func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.ErrorTrace = true @@ -229,6 +241,7 @@ func (f OpenPointInTime) WithErrorTrace() func(*OpenPointInTimeRequest) { } // WithFilterPath filters the properties of the response body. +// func (f OpenPointInTime) WithFilterPath(v ...string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.FilterPath = v @@ -236,6 +249,7 @@ func (f OpenPointInTime) WithFilterPath(v ...string) func(*OpenPointInTimeReques } // WithHeader adds the headers to the HTTP request. +// func (f OpenPointInTime) WithHeader(h map[string]string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { if r.Header == nil { @@ -248,6 +262,7 @@ func (f OpenPointInTime) WithHeader(h map[string]string) func(*OpenPointInTimeRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f OpenPointInTime) WithOpaqueID(s string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.delete_job.go index 01c41876705..b39761061b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.delete_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newRollupDeleteJobFunc(t Transport) RollupDeleteJob { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html. +// type RollupDeleteJob func(id string, o ...func(*RollupDeleteJobRequest)) (*Response, error) // RollupDeleteJobRequest configures the Rollup Delete Job API request. +// type RollupDeleteJobRequest struct { JobID string @@ -59,6 +61,7 @@ type RollupDeleteJobRequest struct { } // Do executes the request and returns response or error. +// func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f RollupDeleteJob) WithContext(v context.Context) func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f RollupDeleteJob) WithContext(v context.Context) func(*RollupDeleteJobReq } // WithPretty makes the response body pretty-printed. +// func (f RollupDeleteJob) WithPretty() func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f RollupDeleteJob) WithPretty() func(*RollupDeleteJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupDeleteJob) WithHuman() func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f RollupDeleteJob) WithHuman() func(*RollupDeleteJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupDeleteJob) WithErrorTrace() func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f RollupDeleteJob) WithErrorTrace() func(*RollupDeleteJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupDeleteJob) WithFilterPath(v ...string) func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f RollupDeleteJob) WithFilterPath(v ...string) func(*RollupDeleteJobReques } // WithHeader adds the headers to the HTTP request. +// func (f RollupDeleteJob) WithHeader(h map[string]string) func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f RollupDeleteJob) WithHeader(h map[string]string) func(*RollupDeleteJobRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupDeleteJob) WithOpaqueID(s string) func(*RollupDeleteJobRequest) { return func(r *RollupDeleteJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_jobs.go index caa857d6f3a..c2cc8edd637 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_jobs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newRollupGetJobsFunc(t Transport) RollupGetJobs { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html. +// type RollupGetJobs func(o ...func(*RollupGetJobsRequest)) (*Response, error) // RollupGetJobsRequest configures the Rollup Get Jobs API request. +// type RollupGetJobsRequest struct { JobID string @@ -59,6 +61,7 @@ type RollupGetJobsRequest struct { } // Do executes the request and returns response or error. +// func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -140,6 +143,7 @@ func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f RollupGetJobs) WithContext(v context.Context) func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { r.ctx = v @@ -147,6 +151,7 @@ func (f RollupGetJobs) WithContext(v context.Context) func(*RollupGetJobsRequest } // WithJobID - the ID of the job(s) to fetch. accepts glob patterns, or left blank for all jobs. +// func (f RollupGetJobs) WithJobID(v string) func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { r.JobID = v @@ -154,6 +159,7 @@ func (f RollupGetJobs) WithJobID(v string) func(*RollupGetJobsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f RollupGetJobs) WithPretty() func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { r.Pretty = true @@ -161,6 +167,7 @@ func (f RollupGetJobs) WithPretty() func(*RollupGetJobsRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupGetJobs) WithHuman() func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { r.Human = true @@ -168,6 +175,7 @@ func (f RollupGetJobs) WithHuman() func(*RollupGetJobsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupGetJobs) WithErrorTrace() func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { r.ErrorTrace = true @@ -175,6 +183,7 @@ func (f RollupGetJobs) WithErrorTrace() func(*RollupGetJobsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupGetJobs) WithFilterPath(v ...string) func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { r.FilterPath = v @@ -182,6 +191,7 @@ func (f RollupGetJobs) WithFilterPath(v ...string) func(*RollupGetJobsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f RollupGetJobs) WithHeader(h map[string]string) func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { if r.Header == nil { @@ -194,6 +204,7 @@ func (f RollupGetJobs) WithHeader(h map[string]string) func(*RollupGetJobsReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupGetJobs) WithOpaqueID(s string) func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_caps.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_caps.go index cfbc64036ac..416c79e7dc9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_caps.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newRollupGetRollupCapsFunc(t Transport) RollupGetRollupCaps { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html. +// type RollupGetRollupCaps func(o ...func(*RollupGetRollupCapsRequest)) (*Response, error) // RollupGetRollupCapsRequest configures the Rollup Get Rollup Caps API request. +// type RollupGetRollupCapsRequest struct { Index string @@ -59,6 +61,7 @@ type RollupGetRollupCapsRequest struct { } // Do executes the request and returns response or error. +// func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -140,6 +143,7 @@ func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f RollupGetRollupCaps) WithContext(v context.Context) func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { r.ctx = v @@ -147,6 +151,7 @@ func (f RollupGetRollupCaps) WithContext(v context.Context) func(*RollupGetRollu } // WithIndex - the ID of the index to check rollup capabilities on, or left blank for all jobs. +// func (f RollupGetRollupCaps) WithIndex(v string) func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { r.Index = v @@ -154,6 +159,7 @@ func (f RollupGetRollupCaps) WithIndex(v string) func(*RollupGetRollupCapsReques } // WithPretty makes the response body pretty-printed. +// func (f RollupGetRollupCaps) WithPretty() func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { r.Pretty = true @@ -161,6 +167,7 @@ func (f RollupGetRollupCaps) WithPretty() func(*RollupGetRollupCapsRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupGetRollupCaps) WithHuman() func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { r.Human = true @@ -168,6 +175,7 @@ func (f RollupGetRollupCaps) WithHuman() func(*RollupGetRollupCapsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupGetRollupCaps) WithErrorTrace() func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { r.ErrorTrace = true @@ -175,6 +183,7 @@ func (f RollupGetRollupCaps) WithErrorTrace() func(*RollupGetRollupCapsRequest) } // WithFilterPath filters the properties of the response body. +// func (f RollupGetRollupCaps) WithFilterPath(v ...string) func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { r.FilterPath = v @@ -182,6 +191,7 @@ func (f RollupGetRollupCaps) WithFilterPath(v ...string) func(*RollupGetRollupCa } // WithHeader adds the headers to the HTTP request. +// func (f RollupGetRollupCaps) WithHeader(h map[string]string) func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { if r.Header == nil { @@ -194,6 +204,7 @@ func (f RollupGetRollupCaps) WithHeader(h map[string]string) func(*RollupGetRoll } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupGetRollupCaps) WithOpaqueID(s string) func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_index_caps.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_index_caps.go index 7907f59471c..3db2ce2c4c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newRollupGetRollupIndexCapsFunc(t Transport) RollupGetRollupIndexCaps { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html. +// type RollupGetRollupIndexCaps func(index string, o ...func(*RollupGetRollupIndexCapsRequest)) (*Response, error) // RollupGetRollupIndexCapsRequest configures the Rollup Get Rollup Index Caps API request. +// type RollupGetRollupIndexCapsRequest struct { Index string @@ -59,6 +61,7 @@ type RollupGetRollupIndexCapsRequest struct { } // Do executes the request and returns response or error. +// func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f RollupGetRollupIndexCaps) WithContext(v context.Context) func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f RollupGetRollupIndexCaps) WithContext(v context.Context) func(*RollupGet } // WithPretty makes the response body pretty-printed. +// func (f RollupGetRollupIndexCaps) WithPretty() func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f RollupGetRollupIndexCaps) WithPretty() func(*RollupGetRollupIndexCapsReq } // WithHuman makes statistical values human-readable. +// func (f RollupGetRollupIndexCaps) WithHuman() func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f RollupGetRollupIndexCaps) WithHuman() func(*RollupGetRollupIndexCapsRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupGetRollupIndexCaps) WithErrorTrace() func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f RollupGetRollupIndexCaps) WithErrorTrace() func(*RollupGetRollupIndexCap } // WithFilterPath filters the properties of the response body. +// func (f RollupGetRollupIndexCaps) WithFilterPath(v ...string) func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f RollupGetRollupIndexCaps) WithFilterPath(v ...string) func(*RollupGetRol } // WithHeader adds the headers to the HTTP request. +// func (f RollupGetRollupIndexCaps) WithHeader(h map[string]string) func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f RollupGetRollupIndexCaps) WithHeader(h map[string]string) func(*RollupGe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupGetRollupIndexCaps) WithOpaqueID(s string) func(*RollupGetRollupIndexCapsRequest) { return func(r *RollupGetRollupIndexCapsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.put_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.put_job.go index 64e96b7318c..07b62623fc5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.put_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newRollupPutJobFunc(t Transport) RollupPutJob { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html. +// type RollupPutJob func(id string, body io.Reader, o ...func(*RollupPutJobRequest)) (*Response, error) // RollupPutJobRequest configures the Rollup Put Job API request. +// type RollupPutJobRequest struct { JobID string @@ -62,6 +64,7 @@ type RollupPutJobRequest struct { } // Do executes the request and returns response or error. +// func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -110,6 +113,10 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -122,10 +129,6 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -145,6 +148,7 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f RollupPutJob) WithContext(v context.Context) func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f RollupPutJob) WithContext(v context.Context) func(*RollupPutJobRequest) } // WithPretty makes the response body pretty-printed. +// func (f RollupPutJob) WithPretty() func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { r.Pretty = true @@ -159,6 +164,7 @@ func (f RollupPutJob) WithPretty() func(*RollupPutJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupPutJob) WithHuman() func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { r.Human = true @@ -166,6 +172,7 @@ func (f RollupPutJob) WithHuman() func(*RollupPutJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupPutJob) WithErrorTrace() func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { r.ErrorTrace = true @@ -173,6 +180,7 @@ func (f RollupPutJob) WithErrorTrace() func(*RollupPutJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupPutJob) WithFilterPath(v ...string) func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { r.FilterPath = v @@ -180,6 +188,7 @@ func (f RollupPutJob) WithFilterPath(v ...string) func(*RollupPutJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f RollupPutJob) WithHeader(h map[string]string) func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { if r.Header == nil { @@ -192,6 +201,7 @@ func (f RollupPutJob) WithHeader(h map[string]string) func(*RollupPutJobRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupPutJob) WithOpaqueID(s string) func(*RollupPutJobRequest) { return func(r *RollupPutJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup.go index 1fa86129b48..1b9c495fce9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newRollupRollupFunc(t Transport) RollupRollup { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html. +// type RollupRollup func(index string, body io.Reader, rollup_index string, o ...func(*RollupRollupRequest)) (*Response, error) // RollupRollupRequest configures the Rollup Rollup API request. +// type RollupRollupRequest struct { Index string @@ -64,6 +66,7 @@ type RollupRollupRequest struct { } // Do executes the request and returns response or error. +// func (r RollupRollupRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -112,6 +115,10 @@ func (r RollupRollupRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -124,10 +131,6 @@ func (r RollupRollupRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -147,6 +150,7 @@ func (r RollupRollupRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f RollupRollup) WithContext(v context.Context) func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f RollupRollup) WithContext(v context.Context) func(*RollupRollupRequest) } // WithPretty makes the response body pretty-printed. +// func (f RollupRollup) WithPretty() func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { r.Pretty = true @@ -161,6 +166,7 @@ func (f RollupRollup) WithPretty() func(*RollupRollupRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupRollup) WithHuman() func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { r.Human = true @@ -168,6 +174,7 @@ func (f RollupRollup) WithHuman() func(*RollupRollupRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupRollup) WithErrorTrace() func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { r.ErrorTrace = true @@ -175,6 +182,7 @@ func (f RollupRollup) WithErrorTrace() func(*RollupRollupRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupRollup) WithFilterPath(v ...string) func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { r.FilterPath = v @@ -182,6 +190,7 @@ func (f RollupRollup) WithFilterPath(v ...string) func(*RollupRollupRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f RollupRollup) WithHeader(h map[string]string) func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { if r.Header == nil { @@ -194,6 +203,7 @@ func (f RollupRollup) WithHeader(h map[string]string) func(*RollupRollupRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupRollup) WithOpaqueID(s string) func(*RollupRollupRequest) { return func(r *RollupRollupRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup_search.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup_search.go index 303ab2ffd80..a30f3925233 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup_search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.rollup_search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -45,9 +45,11 @@ func newRollupRollupSearchFunc(t Transport) RollupRollupSearch { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html. +// type RollupRollupSearch func(index []string, body io.Reader, o ...func(*RollupRollupSearchRequest)) (*Response, error) // RollupRollupSearchRequest configures the Rollup Rollup Search API request. +// type RollupRollupSearchRequest struct { Index []string DocumentType string @@ -68,6 +70,7 @@ type RollupRollupSearchRequest struct { } // Do executes the request and returns response or error. +// func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) 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 @@ -142,10 +149,6 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f RollupRollupSearch) WithContext(v context.Context) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f RollupRollupSearch) WithContext(v context.Context) func(*RollupRollupSea } // WithDocumentType - the doc type inside the index. +// func (f RollupRollupSearch) WithDocumentType(v string) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.DocumentType = v @@ -179,6 +184,7 @@ func (f RollupRollupSearch) WithDocumentType(v string) func(*RollupRollupSearchR } // WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// func (f RollupRollupSearch) WithRestTotalHitsAsInt(v bool) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.RestTotalHitsAsInt = &v @@ -186,6 +192,7 @@ func (f RollupRollupSearch) WithRestTotalHitsAsInt(v bool) func(*RollupRollupSea } // WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// func (f RollupRollupSearch) WithTypedKeys(v bool) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.TypedKeys = &v @@ -193,6 +200,7 @@ func (f RollupRollupSearch) WithTypedKeys(v bool) func(*RollupRollupSearchReques } // WithPretty makes the response body pretty-printed. +// func (f RollupRollupSearch) WithPretty() func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.Pretty = true @@ -200,6 +208,7 @@ func (f RollupRollupSearch) WithPretty() func(*RollupRollupSearchRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupRollupSearch) WithHuman() func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.Human = true @@ -207,6 +216,7 @@ func (f RollupRollupSearch) WithHuman() func(*RollupRollupSearchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupRollupSearch) WithErrorTrace() func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.ErrorTrace = true @@ -214,6 +224,7 @@ func (f RollupRollupSearch) WithErrorTrace() func(*RollupRollupSearchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupRollupSearch) WithFilterPath(v ...string) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { r.FilterPath = v @@ -221,6 +232,7 @@ func (f RollupRollupSearch) WithFilterPath(v ...string) func(*RollupRollupSearch } // WithHeader adds the headers to the HTTP request. +// func (f RollupRollupSearch) WithHeader(h map[string]string) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { if r.Header == nil { @@ -233,6 +245,7 @@ func (f RollupRollupSearch) WithHeader(h map[string]string) func(*RollupRollupSe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupRollupSearch) WithOpaqueID(s string) func(*RollupRollupSearchRequest) { return func(r *RollupRollupSearchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.start_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.start_job.go index 7cd09267cc0..e4c1f3f7d45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.start_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.start_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newRollupStartJobFunc(t Transport) RollupStartJob { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html. +// type RollupStartJob func(id string, o ...func(*RollupStartJobRequest)) (*Response, error) // RollupStartJobRequest configures the Rollup Start Job API request. +// type RollupStartJobRequest struct { JobID string @@ -59,6 +61,7 @@ type RollupStartJobRequest struct { } // Do executes the request and returns response or error. +// func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -140,6 +143,7 @@ func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f RollupStartJob) WithContext(v context.Context) func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { r.ctx = v @@ -147,6 +151,7 @@ func (f RollupStartJob) WithContext(v context.Context) func(*RollupStartJobReque } // WithPretty makes the response body pretty-printed. +// func (f RollupStartJob) WithPretty() func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { r.Pretty = true @@ -154,6 +159,7 @@ func (f RollupStartJob) WithPretty() func(*RollupStartJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupStartJob) WithHuman() func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { r.Human = true @@ -161,6 +167,7 @@ func (f RollupStartJob) WithHuman() func(*RollupStartJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupStartJob) WithErrorTrace() func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { r.ErrorTrace = true @@ -168,6 +175,7 @@ func (f RollupStartJob) WithErrorTrace() func(*RollupStartJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupStartJob) WithFilterPath(v ...string) func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { r.FilterPath = v @@ -175,6 +183,7 @@ func (f RollupStartJob) WithFilterPath(v ...string) func(*RollupStartJobRequest) } // WithHeader adds the headers to the HTTP request. +// func (f RollupStartJob) WithHeader(h map[string]string) func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { if r.Header == nil { @@ -187,6 +196,7 @@ func (f RollupStartJob) WithHeader(h map[string]string) func(*RollupStartJobRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupStartJob) WithOpaqueID(s string) func(*RollupStartJobRequest) { return func(r *RollupStartJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.stop_job.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.stop_job.go index fff8e36f6bf..7f38d576a4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.stop_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.rollup.stop_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -44,9 +44,11 @@ func newRollupStopJobFunc(t Transport) RollupStopJob { // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html. +// type RollupStopJob func(id string, o ...func(*RollupStopJobRequest)) (*Response, error) // RollupStopJobRequest configures the Rollup Stop Job API request. +// type RollupStopJobRequest struct { JobID string @@ -64,6 +66,7 @@ type RollupStopJobRequest struct { } // Do executes the request and returns response or error. +// func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -153,6 +156,7 @@ func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Res } // WithContext sets the request context. +// func (f RollupStopJob) WithContext(v context.Context) func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f RollupStopJob) WithContext(v context.Context) func(*RollupStopJobRequest } // WithTimeout - block for (at maximum) the specified duration while waiting for the job to stop. defaults to 30s.. +// func (f RollupStopJob) WithTimeout(v time.Duration) func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.Timeout = v @@ -167,6 +172,7 @@ func (f RollupStopJob) WithTimeout(v time.Duration) func(*RollupStopJobRequest) } // WithWaitForCompletion - true if the api should block until the job has fully stopped, false if should be executed async. defaults to false.. +// func (f RollupStopJob) WithWaitForCompletion(v bool) func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.WaitForCompletion = &v @@ -174,6 +180,7 @@ func (f RollupStopJob) WithWaitForCompletion(v bool) func(*RollupStopJobRequest) } // WithPretty makes the response body pretty-printed. +// func (f RollupStopJob) WithPretty() func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.Pretty = true @@ -181,6 +188,7 @@ func (f RollupStopJob) WithPretty() func(*RollupStopJobRequest) { } // WithHuman makes statistical values human-readable. +// func (f RollupStopJob) WithHuman() func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.Human = true @@ -188,6 +196,7 @@ func (f RollupStopJob) WithHuman() func(*RollupStopJobRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f RollupStopJob) WithErrorTrace() func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.ErrorTrace = true @@ -195,6 +204,7 @@ func (f RollupStopJob) WithErrorTrace() func(*RollupStopJobRequest) { } // WithFilterPath filters the properties of the response body. +// func (f RollupStopJob) WithFilterPath(v ...string) func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { r.FilterPath = v @@ -202,6 +212,7 @@ func (f RollupStopJob) WithFilterPath(v ...string) func(*RollupStopJobRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f RollupStopJob) WithHeader(h map[string]string) func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { if r.Header == nil { @@ -214,6 +225,7 @@ func (f RollupStopJob) WithHeader(h map[string]string) func(*RollupStopJobReques } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f RollupStopJob) WithOpaqueID(s string) func(*RollupStopJobRequest) { return func(r *RollupStopJobRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.cache_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.cache_stats.go index ebd785c2267..f611759c81f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.cache_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.cache_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSearchableSnapshotsCacheStatsFunc(t Transport) SearchableSnapshotsCacheS // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html. +// type SearchableSnapshotsCacheStats func(o ...func(*SearchableSnapshotsCacheStatsRequest)) (*Response, error) // SearchableSnapshotsCacheStatsRequest configures the Searchable Snapshots Cache Stats API request. +// type SearchableSnapshotsCacheStatsRequest struct { NodeID []string @@ -59,6 +61,7 @@ type SearchableSnapshotsCacheStatsRequest struct { } // Do executes the request and returns response or error. +// func (r SearchableSnapshotsCacheStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r SearchableSnapshotsCacheStatsRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f SearchableSnapshotsCacheStats) WithContext(v context.Context) func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SearchableSnapshotsCacheStats) WithContext(v context.Context) func(*Sear } // WithNodeID - a list of node ids or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. +// func (f SearchableSnapshotsCacheStats) WithNodeID(v ...string) func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { r.NodeID = v @@ -156,6 +161,7 @@ func (f SearchableSnapshotsCacheStats) WithNodeID(v ...string) func(*SearchableS } // WithPretty makes the response body pretty-printed. +// func (f SearchableSnapshotsCacheStats) WithPretty() func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SearchableSnapshotsCacheStats) WithPretty() func(*SearchableSnapshotsCac } // WithHuman makes statistical values human-readable. +// func (f SearchableSnapshotsCacheStats) WithHuman() func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SearchableSnapshotsCacheStats) WithHuman() func(*SearchableSnapshotsCach } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchableSnapshotsCacheStats) WithErrorTrace() func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SearchableSnapshotsCacheStats) WithErrorTrace() func(*SearchableSnapshot } // WithFilterPath filters the properties of the response body. +// func (f SearchableSnapshotsCacheStats) WithFilterPath(v ...string) func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SearchableSnapshotsCacheStats) WithFilterPath(v ...string) func(*Searcha } // WithHeader adds the headers to the HTTP request. +// func (f SearchableSnapshotsCacheStats) WithHeader(h map[string]string) func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SearchableSnapshotsCacheStats) WithHeader(h map[string]string) func(*Sea } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchableSnapshotsCacheStats) WithOpaqueID(s string) func(*SearchableSnapshotsCacheStatsRequest) { return func(r *SearchableSnapshotsCacheStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.clear_cache.go index 1dd801a9f92..908b9810f21 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.clear_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newSearchableSnapshotsClearCacheFunc(t Transport) SearchableSnapshotsClearC // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html. +// type SearchableSnapshotsClearCache func(o ...func(*SearchableSnapshotsClearCacheRequest)) (*Response, error) // SearchableSnapshotsClearCacheRequest configures the Searchable Snapshots Clear Cache API request. +// type SearchableSnapshotsClearCacheRequest struct { Index []string @@ -64,6 +66,7 @@ type SearchableSnapshotsClearCacheRequest struct { } // Do executes the request and returns response or error. +// func (r SearchableSnapshotsClearCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -163,6 +166,7 @@ func (r SearchableSnapshotsClearCacheRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f SearchableSnapshotsClearCache) WithContext(v context.Context) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.ctx = v @@ -170,6 +174,7 @@ func (f SearchableSnapshotsClearCache) WithContext(v context.Context) func(*Sear } // WithIndex - a list of index names. +// func (f SearchableSnapshotsClearCache) WithIndex(v ...string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.Index = v @@ -177,6 +182,7 @@ func (f SearchableSnapshotsClearCache) WithIndex(v ...string) func(*SearchableSn } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// func (f SearchableSnapshotsClearCache) WithAllowNoIndices(v bool) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.AllowNoIndices = &v @@ -184,6 +190,7 @@ func (f SearchableSnapshotsClearCache) WithAllowNoIndices(v bool) func(*Searchab } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// func (f SearchableSnapshotsClearCache) WithExpandWildcards(v string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.ExpandWildcards = v @@ -191,6 +198,7 @@ func (f SearchableSnapshotsClearCache) WithExpandWildcards(v string) func(*Searc } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// func (f SearchableSnapshotsClearCache) WithIgnoreUnavailable(v bool) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.IgnoreUnavailable = &v @@ -198,6 +206,7 @@ func (f SearchableSnapshotsClearCache) WithIgnoreUnavailable(v bool) func(*Searc } // WithPretty makes the response body pretty-printed. +// func (f SearchableSnapshotsClearCache) WithPretty() func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.Pretty = true @@ -205,6 +214,7 @@ func (f SearchableSnapshotsClearCache) WithPretty() func(*SearchableSnapshotsCle } // WithHuman makes statistical values human-readable. +// func (f SearchableSnapshotsClearCache) WithHuman() func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.Human = true @@ -212,6 +222,7 @@ func (f SearchableSnapshotsClearCache) WithHuman() func(*SearchableSnapshotsClea } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchableSnapshotsClearCache) WithErrorTrace() func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.ErrorTrace = true @@ -219,6 +230,7 @@ func (f SearchableSnapshotsClearCache) WithErrorTrace() func(*SearchableSnapshot } // WithFilterPath filters the properties of the response body. +// func (f SearchableSnapshotsClearCache) WithFilterPath(v ...string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.FilterPath = v @@ -226,6 +238,7 @@ func (f SearchableSnapshotsClearCache) WithFilterPath(v ...string) func(*Searcha } // WithHeader adds the headers to the HTTP request. +// func (f SearchableSnapshotsClearCache) WithHeader(h map[string]string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { if r.Header == nil { @@ -238,6 +251,7 @@ func (f SearchableSnapshotsClearCache) WithHeader(h map[string]string) func(*Sea } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchableSnapshotsClearCache) WithOpaqueID(s string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.mount.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.mount.go index ed39317c54b..f8687e1caa4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.mount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.mount.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newSearchableSnapshotsMountFunc(t Transport) SearchableSnapshotsMount { // SearchableSnapshotsMount - Mount a snapshot as a searchable index. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-mount-snapshot.html. +// type SearchableSnapshotsMount func(repository string, snapshot string, body io.Reader, o ...func(*SearchableSnapshotsMountRequest)) (*Response, error) // SearchableSnapshotsMountRequest configures the Searchable Snapshots Mount API request. +// type SearchableSnapshotsMountRequest struct { Body io.Reader @@ -67,6 +69,7 @@ type SearchableSnapshotsMountRequest struct { } // Do executes the request and returns response or error. +// func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,10 @@ func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Trans 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 @@ -141,10 +148,6 @@ func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -164,6 +167,7 @@ func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SearchableSnapshotsMount) WithContext(v context.Context) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.ctx = v @@ -171,6 +175,7 @@ func (f SearchableSnapshotsMount) WithContext(v context.Context) func(*Searchabl } // WithMasterTimeout - explicit operation timeout for connection to master node. +// func (f SearchableSnapshotsMount) WithMasterTimeout(v time.Duration) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.MasterTimeout = v @@ -178,6 +183,7 @@ func (f SearchableSnapshotsMount) WithMasterTimeout(v time.Duration) func(*Searc } // WithStorage - selects the kind of local storage used to accelerate searches. experimental, and defaults to `full_copy`. +// func (f SearchableSnapshotsMount) WithStorage(v string) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.Storage = v @@ -185,6 +191,7 @@ func (f SearchableSnapshotsMount) WithStorage(v string) func(*SearchableSnapshot } // WithWaitForCompletion - should this request wait until the operation has completed before returning. +// func (f SearchableSnapshotsMount) WithWaitForCompletion(v bool) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.WaitForCompletion = &v @@ -192,6 +199,7 @@ func (f SearchableSnapshotsMount) WithWaitForCompletion(v bool) func(*Searchable } // WithPretty makes the response body pretty-printed. +// func (f SearchableSnapshotsMount) WithPretty() func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.Pretty = true @@ -199,6 +207,7 @@ func (f SearchableSnapshotsMount) WithPretty() func(*SearchableSnapshotsMountReq } // WithHuman makes statistical values human-readable. +// func (f SearchableSnapshotsMount) WithHuman() func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.Human = true @@ -206,6 +215,7 @@ func (f SearchableSnapshotsMount) WithHuman() func(*SearchableSnapshotsMountRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchableSnapshotsMount) WithErrorTrace() func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.ErrorTrace = true @@ -213,6 +223,7 @@ func (f SearchableSnapshotsMount) WithErrorTrace() func(*SearchableSnapshotsMoun } // WithFilterPath filters the properties of the response body. +// func (f SearchableSnapshotsMount) WithFilterPath(v ...string) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { r.FilterPath = v @@ -220,6 +231,7 @@ func (f SearchableSnapshotsMount) WithFilterPath(v ...string) func(*SearchableSn } // WithHeader adds the headers to the HTTP request. +// func (f SearchableSnapshotsMount) WithHeader(h map[string]string) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { if r.Header == nil { @@ -232,6 +244,7 @@ func (f SearchableSnapshotsMount) WithHeader(h map[string]string) func(*Searchab } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchableSnapshotsMount) WithOpaqueID(s string) func(*SearchableSnapshotsMountRequest) { return func(r *SearchableSnapshotsMountRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.repository_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.repository_stats.go index 1fdcc0c5f1f..30b34838ad9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.repository_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.repository_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newSearchableSnapshotsRepositoryStatsFunc(t Transport) SearchableSnapshotsR // This API is experimental. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html. +// type SearchableSnapshotsRepositoryStats func(repository string, o ...func(*SearchableSnapshotsRepositoryStatsRequest)) (*Response, error) // SearchableSnapshotsRepositoryStatsRequest configures the Searchable Snapshots Repository Stats API request. +// type SearchableSnapshotsRepositoryStatsRequest struct { Repository string @@ -59,6 +61,7 @@ type SearchableSnapshotsRepositoryStatsRequest struct { } // Do executes the request and returns response or error. +// func (r SearchableSnapshotsRepositoryStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SearchableSnapshotsRepositoryStatsRequest) Do(ctx context.Context, trans } // WithContext sets the request context. +// func (f SearchableSnapshotsRepositoryStats) WithContext(v context.Context) func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SearchableSnapshotsRepositoryStats) WithContext(v context.Context) func( } // WithPretty makes the response body pretty-printed. +// func (f SearchableSnapshotsRepositoryStats) WithPretty() func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f SearchableSnapshotsRepositoryStats) WithPretty() func(*SearchableSnapsho } // WithHuman makes statistical values human-readable. +// func (f SearchableSnapshotsRepositoryStats) WithHuman() func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f SearchableSnapshotsRepositoryStats) WithHuman() func(*SearchableSnapshot } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchableSnapshotsRepositoryStats) WithErrorTrace() func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f SearchableSnapshotsRepositoryStats) WithErrorTrace() func(*SearchableSna } // WithFilterPath filters the properties of the response body. +// func (f SearchableSnapshotsRepositoryStats) WithFilterPath(v ...string) func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f SearchableSnapshotsRepositoryStats) WithFilterPath(v ...string) func(*Se } // WithHeader adds the headers to the HTTP request. +// func (f SearchableSnapshotsRepositoryStats) WithHeader(h map[string]string) func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f SearchableSnapshotsRepositoryStats) WithHeader(h map[string]string) func } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchableSnapshotsRepositoryStats) WithOpaqueID(s string) func(*SearchableSnapshotsRepositoryStatsRequest) { return func(r *SearchableSnapshotsRepositoryStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.stats.go index 3b9695276db..fc5ec02027a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.searchable_snapshots.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSearchableSnapshotsStatsFunc(t Transport) SearchableSnapshotsStats { // SearchableSnapshotsStats - Retrieve shard-level statistics about searchable snapshots. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html. +// type SearchableSnapshotsStats func(o ...func(*SearchableSnapshotsStatsRequest)) (*Response, error) // SearchableSnapshotsStatsRequest configures the Searchable Snapshots Stats API request. +// type SearchableSnapshotsStatsRequest struct { Index []string @@ -59,6 +61,7 @@ type SearchableSnapshotsStatsRequest struct { } // Do executes the request and returns response or error. +// func (r SearchableSnapshotsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -144,6 +147,7 @@ func (r SearchableSnapshotsStatsRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SearchableSnapshotsStats) WithContext(v context.Context) func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.ctx = v @@ -151,6 +155,7 @@ func (f SearchableSnapshotsStats) WithContext(v context.Context) func(*Searchabl } // WithIndex - a list of index names. +// func (f SearchableSnapshotsStats) WithIndex(v ...string) func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.Index = v @@ -158,6 +163,7 @@ func (f SearchableSnapshotsStats) WithIndex(v ...string) func(*SearchableSnapsho } // WithLevel - return stats aggregated at cluster, index or shard level. +// func (f SearchableSnapshotsStats) WithLevel(v string) func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.Level = v @@ -165,6 +171,7 @@ func (f SearchableSnapshotsStats) WithLevel(v string) func(*SearchableSnapshotsS } // WithPretty makes the response body pretty-printed. +// func (f SearchableSnapshotsStats) WithPretty() func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.Pretty = true @@ -172,6 +179,7 @@ func (f SearchableSnapshotsStats) WithPretty() func(*SearchableSnapshotsStatsReq } // WithHuman makes statistical values human-readable. +// func (f SearchableSnapshotsStats) WithHuman() func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.Human = true @@ -179,6 +187,7 @@ func (f SearchableSnapshotsStats) WithHuman() func(*SearchableSnapshotsStatsRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SearchableSnapshotsStats) WithErrorTrace() func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.ErrorTrace = true @@ -186,6 +195,7 @@ func (f SearchableSnapshotsStats) WithErrorTrace() func(*SearchableSnapshotsStat } // WithFilterPath filters the properties of the response body. +// func (f SearchableSnapshotsStats) WithFilterPath(v ...string) func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { r.FilterPath = v @@ -193,6 +203,7 @@ func (f SearchableSnapshotsStats) WithFilterPath(v ...string) func(*SearchableSn } // WithHeader adds the headers to the HTTP request. +// func (f SearchableSnapshotsStats) WithHeader(h map[string]string) func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { if r.Header == nil { @@ -205,6 +216,7 @@ func (f SearchableSnapshotsStats) WithHeader(h map[string]string) func(*Searchab } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SearchableSnapshotsStats) WithOpaqueID(s string) func(*SearchableSnapshotsStatsRequest) { return func(r *SearchableSnapshotsStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.authenticate.go index eee1dcf37bd..aa372db0a2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.authenticate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityAuthenticateFunc(t Transport) SecurityAuthenticate { // SecurityAuthenticate - Enables authentication as a user and retrieve information about the authenticated user. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html. +// type SecurityAuthenticate func(o ...func(*SecurityAuthenticateRequest)) (*Response, error) // SecurityAuthenticateRequest configures the Security Authenticate API request. +// type SecurityAuthenticateRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SecurityAuthenticateRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f SecurityAuthenticate) WithContext(v context.Context) func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SecurityAuthenticate) WithContext(v context.Context) func(*SecurityAuthe } // WithPretty makes the response body pretty-printed. +// func (f SecurityAuthenticate) WithPretty() func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SecurityAuthenticate) WithPretty() func(*SecurityAuthenticateRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityAuthenticate) WithHuman() func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SecurityAuthenticate) WithHuman() func(*SecurityAuthenticateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityAuthenticate) WithErrorTrace() func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SecurityAuthenticate) WithErrorTrace() func(*SecurityAuthenticateRequest } // WithFilterPath filters the properties of the response body. +// func (f SecurityAuthenticate) WithFilterPath(v ...string) func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SecurityAuthenticate) WithFilterPath(v ...string) func(*SecurityAuthenti } // WithHeader adds the headers to the HTTP request. +// func (f SecurityAuthenticate) WithHeader(h map[string]string) func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SecurityAuthenticate) WithHeader(h map[string]string) func(*SecurityAuth } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityAuthenticate) WithOpaqueID(s string) func(*SecurityAuthenticateRequest) { return func(r *SecurityAuthenticateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.change_password.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.change_password.go index c954f1812cb..828ad71a656 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.change_password.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.change_password.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityChangePasswordFunc(t Transport) SecurityChangePassword { // SecurityChangePassword - Changes the passwords of users in the native realm and built-in users. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html. +// type SecurityChangePassword func(body io.Reader, o ...func(*SecurityChangePasswordRequest)) (*Response, error) // SecurityChangePasswordRequest configures the Security Change Password API request. +// type SecurityChangePasswordRequest struct { Body io.Reader @@ -62,6 +64,7 @@ type SecurityChangePasswordRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -118,6 +121,10 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo 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 @@ -130,10 +137,6 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -153,6 +156,7 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f SecurityChangePassword) WithContext(v context.Context) func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f SecurityChangePassword) WithContext(v context.Context) func(*SecurityCha } // WithUsername - the username of the user to change the password for. +// func (f SecurityChangePassword) WithUsername(v string) func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.Username = v @@ -167,6 +172,7 @@ func (f SecurityChangePassword) WithUsername(v string) func(*SecurityChangePassw } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityChangePassword) WithRefresh(v string) func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.Refresh = v @@ -174,6 +180,7 @@ func (f SecurityChangePassword) WithRefresh(v string) func(*SecurityChangePasswo } // WithPretty makes the response body pretty-printed. +// func (f SecurityChangePassword) WithPretty() func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.Pretty = true @@ -181,6 +188,7 @@ func (f SecurityChangePassword) WithPretty() func(*SecurityChangePasswordRequest } // WithHuman makes statistical values human-readable. +// func (f SecurityChangePassword) WithHuman() func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.Human = true @@ -188,6 +196,7 @@ func (f SecurityChangePassword) WithHuman() func(*SecurityChangePasswordRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityChangePassword) WithErrorTrace() func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.ErrorTrace = true @@ -195,6 +204,7 @@ func (f SecurityChangePassword) WithErrorTrace() func(*SecurityChangePasswordReq } // WithFilterPath filters the properties of the response body. +// func (f SecurityChangePassword) WithFilterPath(v ...string) func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { r.FilterPath = v @@ -202,6 +212,7 @@ func (f SecurityChangePassword) WithFilterPath(v ...string) func(*SecurityChange } // WithHeader adds the headers to the HTTP request. +// func (f SecurityChangePassword) WithHeader(h map[string]string) func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { if r.Header == nil { @@ -214,6 +225,7 @@ func (f SecurityChangePassword) WithHeader(h map[string]string) func(*SecurityCh } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityChangePassword) WithOpaqueID(s string) func(*SecurityChangePasswordRequest) { return func(r *SecurityChangePasswordRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_api_key_cache.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_api_key_cache.go index e610dfc623c..11092d15c03 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_api_key_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_api_key_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityClearAPIKeyCacheFunc(t Transport) SecurityClearAPIKeyCache { // SecurityClearAPIKeyCache - Clear a subset or all entries from the API key cache. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html. +// type SecurityClearAPIKeyCache func(ids []string, o ...func(*SecurityClearAPIKeyCacheRequest)) (*Response, error) // SecurityClearAPIKeyCacheRequest configures the Security ClearAPI Key Cache API request. +// type SecurityClearAPIKeyCacheRequest struct { Ids []string @@ -58,6 +60,7 @@ type SecurityClearAPIKeyCacheRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityClearAPIKeyCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r SecurityClearAPIKeyCacheRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SecurityClearAPIKeyCache) WithContext(v context.Context) func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f SecurityClearAPIKeyCache) WithContext(v context.Context) func(*SecurityC } // WithPretty makes the response body pretty-printed. +// func (f SecurityClearAPIKeyCache) WithPretty() func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f SecurityClearAPIKeyCache) WithPretty() func(*SecurityClearAPIKeyCacheReq } // WithHuman makes statistical values human-readable. +// func (f SecurityClearAPIKeyCache) WithHuman() func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f SecurityClearAPIKeyCache) WithHuman() func(*SecurityClearAPIKeyCacheRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityClearAPIKeyCache) WithErrorTrace() func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f SecurityClearAPIKeyCache) WithErrorTrace() func(*SecurityClearAPIKeyCach } // WithFilterPath filters the properties of the response body. +// func (f SecurityClearAPIKeyCache) WithFilterPath(v ...string) func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f SecurityClearAPIKeyCache) WithFilterPath(v ...string) func(*SecurityClea } // WithHeader adds the headers to the HTTP request. +// func (f SecurityClearAPIKeyCache) WithHeader(h map[string]string) func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f SecurityClearAPIKeyCache) WithHeader(h map[string]string) func(*Security } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityClearAPIKeyCache) WithOpaqueID(s string) func(*SecurityClearAPIKeyCacheRequest) { return func(r *SecurityClearAPIKeyCacheRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_privileges.go index e51290e72aa..ded475ea338 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityClearCachedPrivilegesFunc(t Transport) SecurityClearCachedPrivil // SecurityClearCachedPrivileges - Evicts application privileges from the native application privileges cache. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html. +// type SecurityClearCachedPrivileges func(application []string, o ...func(*SecurityClearCachedPrivilegesRequest)) (*Response, error) // SecurityClearCachedPrivilegesRequest configures the Security Clear Cached Privileges API request. +// type SecurityClearCachedPrivilegesRequest struct { Application []string @@ -58,6 +60,7 @@ type SecurityClearCachedPrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityClearCachedPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r SecurityClearCachedPrivilegesRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f SecurityClearCachedPrivileges) WithContext(v context.Context) func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f SecurityClearCachedPrivileges) WithContext(v context.Context) func(*Secu } // WithPretty makes the response body pretty-printed. +// func (f SecurityClearCachedPrivileges) WithPretty() func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f SecurityClearCachedPrivileges) WithPretty() func(*SecurityClearCachedPri } // WithHuman makes statistical values human-readable. +// func (f SecurityClearCachedPrivileges) WithHuman() func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f SecurityClearCachedPrivileges) WithHuman() func(*SecurityClearCachedPriv } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityClearCachedPrivileges) WithErrorTrace() func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f SecurityClearCachedPrivileges) WithErrorTrace() func(*SecurityClearCache } // WithFilterPath filters the properties of the response body. +// func (f SecurityClearCachedPrivileges) WithFilterPath(v ...string) func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f SecurityClearCachedPrivileges) WithFilterPath(v ...string) func(*Securit } // WithHeader adds the headers to the HTTP request. +// func (f SecurityClearCachedPrivileges) WithHeader(h map[string]string) func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f SecurityClearCachedPrivileges) WithHeader(h map[string]string) func(*Sec } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityClearCachedPrivileges) WithOpaqueID(s string) func(*SecurityClearCachedPrivilegesRequest) { return func(r *SecurityClearCachedPrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_realms.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_realms.go index 8f4cad47f88..850b3b8ab33 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_realms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_realms.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityClearCachedRealmsFunc(t Transport) SecurityClearCachedRealms { // SecurityClearCachedRealms - Evicts users from the user cache. Can completely clear the cache or evict specific users. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html. +// type SecurityClearCachedRealms func(realms []string, o ...func(*SecurityClearCachedRealmsRequest)) (*Response, error) // SecurityClearCachedRealmsRequest configures the Security Clear Cached Realms API request. +// type SecurityClearCachedRealmsRequest struct { Realms []string @@ -60,6 +62,7 @@ type SecurityClearCachedRealmsRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -149,6 +152,7 @@ func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f SecurityClearCachedRealms) WithContext(v context.Context) func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f SecurityClearCachedRealms) WithContext(v context.Context) func(*Security } // WithUsernames - comma-separated list of usernames to clear from the cache. +// func (f SecurityClearCachedRealms) WithUsernames(v ...string) func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { r.Usernames = v @@ -163,6 +168,7 @@ func (f SecurityClearCachedRealms) WithUsernames(v ...string) func(*SecurityClea } // WithPretty makes the response body pretty-printed. +// func (f SecurityClearCachedRealms) WithPretty() func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { r.Pretty = true @@ -170,6 +176,7 @@ func (f SecurityClearCachedRealms) WithPretty() func(*SecurityClearCachedRealmsR } // WithHuman makes statistical values human-readable. +// func (f SecurityClearCachedRealms) WithHuman() func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { r.Human = true @@ -177,6 +184,7 @@ func (f SecurityClearCachedRealms) WithHuman() func(*SecurityClearCachedRealmsRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityClearCachedRealms) WithErrorTrace() func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { r.ErrorTrace = true @@ -184,6 +192,7 @@ func (f SecurityClearCachedRealms) WithErrorTrace() func(*SecurityClearCachedRea } // WithFilterPath filters the properties of the response body. +// func (f SecurityClearCachedRealms) WithFilterPath(v ...string) func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { r.FilterPath = v @@ -191,6 +200,7 @@ func (f SecurityClearCachedRealms) WithFilterPath(v ...string) func(*SecurityCle } // WithHeader adds the headers to the HTTP request. +// func (f SecurityClearCachedRealms) WithHeader(h map[string]string) func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { if r.Header == nil { @@ -203,6 +213,7 @@ func (f SecurityClearCachedRealms) WithHeader(h map[string]string) func(*Securit } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityClearCachedRealms) WithOpaqueID(s string) func(*SecurityClearCachedRealmsRequest) { return func(r *SecurityClearCachedRealmsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_roles.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_roles.go index 2eb2d94aab4..7a66db6592c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_roles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_roles.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityClearCachedRolesFunc(t Transport) SecurityClearCachedRoles { // SecurityClearCachedRoles - Evicts roles from the native role cache. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html. +// type SecurityClearCachedRoles func(name []string, o ...func(*SecurityClearCachedRolesRequest)) (*Response, error) // SecurityClearCachedRolesRequest configures the Security Clear Cached Roles API request. +// type SecurityClearCachedRolesRequest struct { Name []string @@ -58,6 +60,7 @@ type SecurityClearCachedRolesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SecurityClearCachedRoles) WithContext(v context.Context) func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f SecurityClearCachedRoles) WithContext(v context.Context) func(*SecurityC } // WithPretty makes the response body pretty-printed. +// func (f SecurityClearCachedRoles) WithPretty() func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { r.Pretty = true @@ -157,6 +162,7 @@ func (f SecurityClearCachedRoles) WithPretty() func(*SecurityClearCachedRolesReq } // WithHuman makes statistical values human-readable. +// func (f SecurityClearCachedRoles) WithHuman() func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { r.Human = true @@ -164,6 +170,7 @@ func (f SecurityClearCachedRoles) WithHuman() func(*SecurityClearCachedRolesRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityClearCachedRoles) WithErrorTrace() func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { r.ErrorTrace = true @@ -171,6 +178,7 @@ func (f SecurityClearCachedRoles) WithErrorTrace() func(*SecurityClearCachedRole } // WithFilterPath filters the properties of the response body. +// func (f SecurityClearCachedRoles) WithFilterPath(v ...string) func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { r.FilterPath = v @@ -178,6 +186,7 @@ func (f SecurityClearCachedRoles) WithFilterPath(v ...string) func(*SecurityClea } // WithHeader adds the headers to the HTTP request. +// func (f SecurityClearCachedRoles) WithHeader(h map[string]string) func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { if r.Header == nil { @@ -190,6 +199,7 @@ func (f SecurityClearCachedRoles) WithHeader(h map[string]string) func(*Security } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityClearCachedRoles) WithOpaqueID(s string) func(*SecurityClearCachedRolesRequest) { return func(r *SecurityClearCachedRolesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_service_tokens.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_service_tokens.go index 380715c6577..4e0c033e81a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_service_tokens.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.clear_cached_service_tokens.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -27,7 +27,7 @@ import ( ) func newSecurityClearCachedServiceTokensFunc(t Transport) SecurityClearCachedServiceTokens { - return func(name []string, namespace string, service string, o ...func(*SecurityClearCachedServiceTokensRequest)) (*Response, error) { + return func(name []string, service string, namespace string, o ...func(*SecurityClearCachedServiceTokensRequest)) (*Response, error) { var r = SecurityClearCachedServiceTokensRequest{Name: name, Namespace: namespace, Service: service} for _, f := range o { f(&r) @@ -41,9 +41,11 @@ func newSecurityClearCachedServiceTokensFunc(t Transport) SecurityClearCachedSer // SecurityClearCachedServiceTokens - Evicts tokens from the service account token caches. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html. +// type SecurityClearCachedServiceTokens func(name []string, namespace string, service string, o ...func(*SecurityClearCachedServiceTokensRequest)) (*Response, error) // SecurityClearCachedServiceTokensRequest configures the Security Clear Cached Service Tokens API request. +// type SecurityClearCachedServiceTokensRequest struct { Name []string Namespace string @@ -60,6 +62,7 @@ type SecurityClearCachedServiceTokensRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityClearCachedServiceTokensRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -153,6 +156,7 @@ func (r SecurityClearCachedServiceTokensRequest) Do(ctx context.Context, transpo } // WithContext sets the request context. +// func (f SecurityClearCachedServiceTokens) WithContext(v context.Context) func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f SecurityClearCachedServiceTokens) WithContext(v context.Context) func(*S } // WithPretty makes the response body pretty-printed. +// func (f SecurityClearCachedServiceTokens) WithPretty() func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { r.Pretty = true @@ -167,6 +172,7 @@ func (f SecurityClearCachedServiceTokens) WithPretty() func(*SecurityClearCached } // WithHuman makes statistical values human-readable. +// func (f SecurityClearCachedServiceTokens) WithHuman() func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { r.Human = true @@ -174,6 +180,7 @@ func (f SecurityClearCachedServiceTokens) WithHuman() func(*SecurityClearCachedS } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityClearCachedServiceTokens) WithErrorTrace() func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { r.ErrorTrace = true @@ -181,6 +188,7 @@ func (f SecurityClearCachedServiceTokens) WithErrorTrace() func(*SecurityClearCa } // WithFilterPath filters the properties of the response body. +// func (f SecurityClearCachedServiceTokens) WithFilterPath(v ...string) func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { r.FilterPath = v @@ -188,6 +196,7 @@ func (f SecurityClearCachedServiceTokens) WithFilterPath(v ...string) func(*Secu } // WithHeader adds the headers to the HTTP request. +// func (f SecurityClearCachedServiceTokens) WithHeader(h map[string]string) func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { if r.Header == nil { @@ -200,6 +209,7 @@ func (f SecurityClearCachedServiceTokens) WithHeader(h map[string]string) func(* } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityClearCachedServiceTokens) WithOpaqueID(s string) func(*SecurityClearCachedServiceTokensRequest) { return func(r *SecurityClearCachedServiceTokensRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_api_key.go index b36335f9057..8f439dc3a87 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityCreateAPIKeyFunc(t Transport) SecurityCreateAPIKey { // SecurityCreateAPIKey - Creates an API key for access without requiring basic authentication. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html. +// type SecurityCreateAPIKey func(body io.Reader, o ...func(*SecurityCreateAPIKeyRequest)) (*Response, error) // SecurityCreateAPIKeyRequest configures the Security CreateAPI Key API request. +// type SecurityCreateAPIKeyRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type SecurityCreateAPIKeyRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -107,6 +110,10 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport 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 @@ -119,10 +126,6 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -142,6 +145,7 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f SecurityCreateAPIKey) WithContext(v context.Context) func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SecurityCreateAPIKey) WithContext(v context.Context) func(*SecurityCreat } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityCreateAPIKey) WithRefresh(v string) func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { r.Refresh = v @@ -156,6 +161,7 @@ func (f SecurityCreateAPIKey) WithRefresh(v string) func(*SecurityCreateAPIKeyRe } // WithPretty makes the response body pretty-printed. +// func (f SecurityCreateAPIKey) WithPretty() func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SecurityCreateAPIKey) WithPretty() func(*SecurityCreateAPIKeyRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityCreateAPIKey) WithHuman() func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SecurityCreateAPIKey) WithHuman() func(*SecurityCreateAPIKeyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityCreateAPIKey) WithErrorTrace() func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SecurityCreateAPIKey) WithErrorTrace() func(*SecurityCreateAPIKeyRequest } // WithFilterPath filters the properties of the response body. +// func (f SecurityCreateAPIKey) WithFilterPath(v ...string) func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SecurityCreateAPIKey) WithFilterPath(v ...string) func(*SecurityCreateAP } // WithHeader adds the headers to the HTTP request. +// func (f SecurityCreateAPIKey) WithHeader(h map[string]string) func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SecurityCreateAPIKey) WithHeader(h map[string]string) func(*SecurityCrea } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityCreateAPIKey) WithOpaqueID(s string) func(*SecurityCreateAPIKeyRequest) { return func(r *SecurityCreateAPIKeyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_service_token.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_service_token.go index 59453a47575..4e60f81b6ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_service_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.create_service_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -27,7 +27,7 @@ import ( func newSecurityCreateServiceTokenFunc(t Transport) SecurityCreateServiceToken { return func(namespace string, service string, o ...func(*SecurityCreateServiceTokenRequest)) (*Response, error) { - var r = SecurityCreateServiceTokenRequest{Namespace: namespace, Service: service} + var r = SecurityCreateServiceTokenRequest{Service: service, Namespace: namespace} for _, f := range o { f(&r) } @@ -40,9 +40,11 @@ func newSecurityCreateServiceTokenFunc(t Transport) SecurityCreateServiceToken { // SecurityCreateServiceToken - Creates a service account token for access without requiring basic authentication. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html. +// type SecurityCreateServiceToken func(namespace string, service string, o ...func(*SecurityCreateServiceTokenRequest)) (*Response, error) // SecurityCreateServiceTokenRequest configures the Security Create Service Token API request. +// type SecurityCreateServiceTokenRequest struct { Name string Namespace string @@ -61,6 +63,7 @@ type SecurityCreateServiceTokenRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -154,6 +157,7 @@ func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f SecurityCreateServiceToken) WithContext(v context.Context) func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f SecurityCreateServiceToken) WithContext(v context.Context) func(*Securit } // WithName - an identifier for the token name. +// func (f SecurityCreateServiceToken) WithName(v string) func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.Name = v @@ -168,6 +173,7 @@ func (f SecurityCreateServiceToken) WithName(v string) func(*SecurityCreateServi } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityCreateServiceToken) WithRefresh(v string) func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.Refresh = v @@ -175,6 +181,7 @@ func (f SecurityCreateServiceToken) WithRefresh(v string) func(*SecurityCreateSe } // WithPretty makes the response body pretty-printed. +// func (f SecurityCreateServiceToken) WithPretty() func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.Pretty = true @@ -182,6 +189,7 @@ func (f SecurityCreateServiceToken) WithPretty() func(*SecurityCreateServiceToke } // WithHuman makes statistical values human-readable. +// func (f SecurityCreateServiceToken) WithHuman() func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.Human = true @@ -189,6 +197,7 @@ func (f SecurityCreateServiceToken) WithHuman() func(*SecurityCreateServiceToken } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityCreateServiceToken) WithErrorTrace() func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.ErrorTrace = true @@ -196,6 +205,7 @@ func (f SecurityCreateServiceToken) WithErrorTrace() func(*SecurityCreateService } // WithFilterPath filters the properties of the response body. +// func (f SecurityCreateServiceToken) WithFilterPath(v ...string) func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { r.FilterPath = v @@ -203,6 +213,7 @@ func (f SecurityCreateServiceToken) WithFilterPath(v ...string) func(*SecurityCr } // WithHeader adds the headers to the HTTP request. +// func (f SecurityCreateServiceToken) WithHeader(h map[string]string) func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { if r.Header == nil { @@ -215,6 +226,7 @@ func (f SecurityCreateServiceToken) WithHeader(h map[string]string) func(*Securi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityCreateServiceToken) WithOpaqueID(s string) func(*SecurityCreateServiceTokenRequest) { return func(r *SecurityCreateServiceTokenRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_privileges.go index 1020b255deb..c8c5efb78e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityDeletePrivilegesFunc(t Transport) SecurityDeletePrivileges { // SecurityDeletePrivileges - Removes application privileges. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html. +// type SecurityDeletePrivileges func(name string, application string, o ...func(*SecurityDeletePrivilegesRequest)) (*Response, error) // SecurityDeletePrivilegesRequest configures the Security Delete Privileges API request. +// type SecurityDeletePrivilegesRequest struct { Application string Name string @@ -60,6 +62,7 @@ type SecurityDeletePrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -145,6 +148,7 @@ func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SecurityDeletePrivileges) WithContext(v context.Context) func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { r.ctx = v @@ -152,6 +156,7 @@ func (f SecurityDeletePrivileges) WithContext(v context.Context) func(*SecurityD } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityDeletePrivileges) WithRefresh(v string) func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { r.Refresh = v @@ -159,6 +164,7 @@ func (f SecurityDeletePrivileges) WithRefresh(v string) func(*SecurityDeletePriv } // WithPretty makes the response body pretty-printed. +// func (f SecurityDeletePrivileges) WithPretty() func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { r.Pretty = true @@ -166,6 +172,7 @@ func (f SecurityDeletePrivileges) WithPretty() func(*SecurityDeletePrivilegesReq } // WithHuman makes statistical values human-readable. +// func (f SecurityDeletePrivileges) WithHuman() func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { r.Human = true @@ -173,6 +180,7 @@ func (f SecurityDeletePrivileges) WithHuman() func(*SecurityDeletePrivilegesRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityDeletePrivileges) WithErrorTrace() func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { r.ErrorTrace = true @@ -180,6 +188,7 @@ func (f SecurityDeletePrivileges) WithErrorTrace() func(*SecurityDeletePrivilege } // WithFilterPath filters the properties of the response body. +// func (f SecurityDeletePrivileges) WithFilterPath(v ...string) func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { r.FilterPath = v @@ -187,6 +196,7 @@ func (f SecurityDeletePrivileges) WithFilterPath(v ...string) func(*SecurityDele } // WithHeader adds the headers to the HTTP request. +// func (f SecurityDeletePrivileges) WithHeader(h map[string]string) func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { if r.Header == nil { @@ -199,6 +209,7 @@ func (f SecurityDeletePrivileges) WithHeader(h map[string]string) func(*Security } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityDeletePrivileges) WithOpaqueID(s string) func(*SecurityDeletePrivilegesRequest) { return func(r *SecurityDeletePrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role.go index 10df6a8d2c5..3ef1b437f5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityDeleteRoleFunc(t Transport) SecurityDeleteRole { // SecurityDeleteRole - Removes roles in the native realm. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html. +// type SecurityDeleteRole func(name string, o ...func(*SecurityDeleteRoleRequest)) (*Response, error) // SecurityDeleteRoleRequest configures the Security Delete Role API request. +// type SecurityDeleteRoleRequest struct { Name string @@ -59,6 +61,7 @@ type SecurityDeleteRoleRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SecurityDeleteRole) WithContext(v context.Context) func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SecurityDeleteRole) WithContext(v context.Context) func(*SecurityDeleteR } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityDeleteRole) WithRefresh(v string) func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { r.Refresh = v @@ -156,6 +161,7 @@ func (f SecurityDeleteRole) WithRefresh(v string) func(*SecurityDeleteRoleReques } // WithPretty makes the response body pretty-printed. +// func (f SecurityDeleteRole) WithPretty() func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SecurityDeleteRole) WithPretty() func(*SecurityDeleteRoleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityDeleteRole) WithHuman() func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SecurityDeleteRole) WithHuman() func(*SecurityDeleteRoleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityDeleteRole) WithErrorTrace() func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SecurityDeleteRole) WithErrorTrace() func(*SecurityDeleteRoleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityDeleteRole) WithFilterPath(v ...string) func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SecurityDeleteRole) WithFilterPath(v ...string) func(*SecurityDeleteRole } // WithHeader adds the headers to the HTTP request. +// func (f SecurityDeleteRole) WithHeader(h map[string]string) func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SecurityDeleteRole) WithHeader(h map[string]string) func(*SecurityDelete } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityDeleteRole) WithOpaqueID(s string) func(*SecurityDeleteRoleRequest) { return func(r *SecurityDeleteRoleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role_mapping.go index 90fccfc616d..c1411afca41 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_role_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityDeleteRoleMappingFunc(t Transport) SecurityDeleteRoleMapping { // SecurityDeleteRoleMapping - Removes role mappings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html. +// type SecurityDeleteRoleMapping func(name string, o ...func(*SecurityDeleteRoleMappingRequest)) (*Response, error) // SecurityDeleteRoleMappingRequest configures the Security Delete Role Mapping API request. +// type SecurityDeleteRoleMappingRequest struct { Name string @@ -59,6 +61,7 @@ type SecurityDeleteRoleMappingRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f SecurityDeleteRoleMapping) WithContext(v context.Context) func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SecurityDeleteRoleMapping) WithContext(v context.Context) func(*Security } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityDeleteRoleMapping) WithRefresh(v string) func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { r.Refresh = v @@ -156,6 +161,7 @@ func (f SecurityDeleteRoleMapping) WithRefresh(v string) func(*SecurityDeleteRol } // WithPretty makes the response body pretty-printed. +// func (f SecurityDeleteRoleMapping) WithPretty() func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SecurityDeleteRoleMapping) WithPretty() func(*SecurityDeleteRoleMappingR } // WithHuman makes statistical values human-readable. +// func (f SecurityDeleteRoleMapping) WithHuman() func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SecurityDeleteRoleMapping) WithHuman() func(*SecurityDeleteRoleMappingRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityDeleteRoleMapping) WithErrorTrace() func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SecurityDeleteRoleMapping) WithErrorTrace() func(*SecurityDeleteRoleMapp } // WithFilterPath filters the properties of the response body. +// func (f SecurityDeleteRoleMapping) WithFilterPath(v ...string) func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SecurityDeleteRoleMapping) WithFilterPath(v ...string) func(*SecurityDel } // WithHeader adds the headers to the HTTP request. +// func (f SecurityDeleteRoleMapping) WithHeader(h map[string]string) func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SecurityDeleteRoleMapping) WithHeader(h map[string]string) func(*Securit } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityDeleteRoleMapping) WithOpaqueID(s string) func(*SecurityDeleteRoleMappingRequest) { return func(r *SecurityDeleteRoleMappingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_service_token.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_service_token.go index 38a3d91eaa7..a84bf13d38f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_service_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_service_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -26,7 +26,7 @@ import ( ) func newSecurityDeleteServiceTokenFunc(t Transport) SecurityDeleteServiceToken { - return func(name string, service string, namespace string, o ...func(*SecurityDeleteServiceTokenRequest)) (*Response, error) { + return func(name string, namespace string, service string, o ...func(*SecurityDeleteServiceTokenRequest)) (*Response, error) { var r = SecurityDeleteServiceTokenRequest{Name: name, Namespace: namespace, Service: service} for _, f := range o { f(&r) @@ -40,9 +40,11 @@ func newSecurityDeleteServiceTokenFunc(t Transport) SecurityDeleteServiceToken { // SecurityDeleteServiceToken - Deletes a service account token. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html. +// type SecurityDeleteServiceToken func(name string, namespace string, service string, o ...func(*SecurityDeleteServiceTokenRequest)) (*Response, error) // SecurityDeleteServiceTokenRequest configures the Security Delete Service Token API request. +// type SecurityDeleteServiceTokenRequest struct { Name string Namespace string @@ -61,6 +63,7 @@ type SecurityDeleteServiceTokenRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityDeleteServiceTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -152,6 +155,7 @@ func (r SecurityDeleteServiceTokenRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f SecurityDeleteServiceToken) WithContext(v context.Context) func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f SecurityDeleteServiceToken) WithContext(v context.Context) func(*Securit } // WithRefresh - if `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityDeleteServiceToken) WithRefresh(v string) func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { r.Refresh = v @@ -166,6 +171,7 @@ func (f SecurityDeleteServiceToken) WithRefresh(v string) func(*SecurityDeleteSe } // WithPretty makes the response body pretty-printed. +// func (f SecurityDeleteServiceToken) WithPretty() func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { r.Pretty = true @@ -173,6 +179,7 @@ func (f SecurityDeleteServiceToken) WithPretty() func(*SecurityDeleteServiceToke } // WithHuman makes statistical values human-readable. +// func (f SecurityDeleteServiceToken) WithHuman() func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { r.Human = true @@ -180,6 +187,7 @@ func (f SecurityDeleteServiceToken) WithHuman() func(*SecurityDeleteServiceToken } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityDeleteServiceToken) WithErrorTrace() func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { r.ErrorTrace = true @@ -187,6 +195,7 @@ func (f SecurityDeleteServiceToken) WithErrorTrace() func(*SecurityDeleteService } // WithFilterPath filters the properties of the response body. +// func (f SecurityDeleteServiceToken) WithFilterPath(v ...string) func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { r.FilterPath = v @@ -194,6 +203,7 @@ func (f SecurityDeleteServiceToken) WithFilterPath(v ...string) func(*SecurityDe } // WithHeader adds the headers to the HTTP request. +// func (f SecurityDeleteServiceToken) WithHeader(h map[string]string) func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { if r.Header == nil { @@ -206,6 +216,7 @@ func (f SecurityDeleteServiceToken) WithHeader(h map[string]string) func(*Securi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityDeleteServiceToken) WithOpaqueID(s string) func(*SecurityDeleteServiceTokenRequest) { return func(r *SecurityDeleteServiceTokenRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_user.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_user.go index 630cfdd3804..4e263d75455 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.delete_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityDeleteUserFunc(t Transport) SecurityDeleteUser { // SecurityDeleteUser - Deletes users from the native realm. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html. +// type SecurityDeleteUser func(username string, o ...func(*SecurityDeleteUserRequest)) (*Response, error) // SecurityDeleteUserRequest configures the Security Delete User API request. +// type SecurityDeleteUserRequest struct { Username string @@ -59,6 +61,7 @@ type SecurityDeleteUserRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SecurityDeleteUser) WithContext(v context.Context) func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SecurityDeleteUser) WithContext(v context.Context) func(*SecurityDeleteU } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityDeleteUser) WithRefresh(v string) func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { r.Refresh = v @@ -156,6 +161,7 @@ func (f SecurityDeleteUser) WithRefresh(v string) func(*SecurityDeleteUserReques } // WithPretty makes the response body pretty-printed. +// func (f SecurityDeleteUser) WithPretty() func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SecurityDeleteUser) WithPretty() func(*SecurityDeleteUserRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityDeleteUser) WithHuman() func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SecurityDeleteUser) WithHuman() func(*SecurityDeleteUserRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityDeleteUser) WithErrorTrace() func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SecurityDeleteUser) WithErrorTrace() func(*SecurityDeleteUserRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityDeleteUser) WithFilterPath(v ...string) func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SecurityDeleteUser) WithFilterPath(v ...string) func(*SecurityDeleteUser } // WithHeader adds the headers to the HTTP request. +// func (f SecurityDeleteUser) WithHeader(h map[string]string) func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SecurityDeleteUser) WithHeader(h map[string]string) func(*SecurityDelete } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityDeleteUser) WithOpaqueID(s string) func(*SecurityDeleteUserRequest) { return func(r *SecurityDeleteUserRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.disable_user.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.disable_user.go index bb39044d42e..a92082347aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.disable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.disable_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityDisableUserFunc(t Transport) SecurityDisableUser { // SecurityDisableUser - Disables users in the native realm. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html. +// type SecurityDisableUser func(username string, o ...func(*SecurityDisableUserRequest)) (*Response, error) // SecurityDisableUserRequest configures the Security Disable User API request. +// type SecurityDisableUserRequest struct { Username string @@ -59,6 +61,7 @@ type SecurityDisableUserRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -144,6 +147,7 @@ func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SecurityDisableUser) WithContext(v context.Context) func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { r.ctx = v @@ -151,6 +155,7 @@ func (f SecurityDisableUser) WithContext(v context.Context) func(*SecurityDisabl } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityDisableUser) WithRefresh(v string) func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { r.Refresh = v @@ -158,6 +163,7 @@ func (f SecurityDisableUser) WithRefresh(v string) func(*SecurityDisableUserRequ } // WithPretty makes the response body pretty-printed. +// func (f SecurityDisableUser) WithPretty() func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { r.Pretty = true @@ -165,6 +171,7 @@ func (f SecurityDisableUser) WithPretty() func(*SecurityDisableUserRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityDisableUser) WithHuman() func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { r.Human = true @@ -172,6 +179,7 @@ func (f SecurityDisableUser) WithHuman() func(*SecurityDisableUserRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityDisableUser) WithErrorTrace() func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { r.ErrorTrace = true @@ -179,6 +187,7 @@ func (f SecurityDisableUser) WithErrorTrace() func(*SecurityDisableUserRequest) } // WithFilterPath filters the properties of the response body. +// func (f SecurityDisableUser) WithFilterPath(v ...string) func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { r.FilterPath = v @@ -186,6 +195,7 @@ func (f SecurityDisableUser) WithFilterPath(v ...string) func(*SecurityDisableUs } // WithHeader adds the headers to the HTTP request. +// func (f SecurityDisableUser) WithHeader(h map[string]string) func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { if r.Header == nil { @@ -198,6 +208,7 @@ func (f SecurityDisableUser) WithHeader(h map[string]string) func(*SecurityDisab } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityDisableUser) WithOpaqueID(s string) func(*SecurityDisableUserRequest) { return func(r *SecurityDisableUserRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.enable_user.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.enable_user.go index 967eb5933a9..1093e82c11a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.enable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.enable_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityEnableUserFunc(t Transport) SecurityEnableUser { // SecurityEnableUser - Enables users in the native realm. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html. +// type SecurityEnableUser func(username string, o ...func(*SecurityEnableUserRequest)) (*Response, error) // SecurityEnableUserRequest configures the Security Enable User API request. +// type SecurityEnableUserRequest struct { Username string @@ -59,6 +61,7 @@ type SecurityEnableUserRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -144,6 +147,7 @@ func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SecurityEnableUser) WithContext(v context.Context) func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { r.ctx = v @@ -151,6 +155,7 @@ func (f SecurityEnableUser) WithContext(v context.Context) func(*SecurityEnableU } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityEnableUser) WithRefresh(v string) func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { r.Refresh = v @@ -158,6 +163,7 @@ func (f SecurityEnableUser) WithRefresh(v string) func(*SecurityEnableUserReques } // WithPretty makes the response body pretty-printed. +// func (f SecurityEnableUser) WithPretty() func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { r.Pretty = true @@ -165,6 +171,7 @@ func (f SecurityEnableUser) WithPretty() func(*SecurityEnableUserRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityEnableUser) WithHuman() func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { r.Human = true @@ -172,6 +179,7 @@ func (f SecurityEnableUser) WithHuman() func(*SecurityEnableUserRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityEnableUser) WithErrorTrace() func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { r.ErrorTrace = true @@ -179,6 +187,7 @@ func (f SecurityEnableUser) WithErrorTrace() func(*SecurityEnableUserRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityEnableUser) WithFilterPath(v ...string) func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { r.FilterPath = v @@ -186,6 +195,7 @@ func (f SecurityEnableUser) WithFilterPath(v ...string) func(*SecurityEnableUser } // WithHeader adds the headers to the HTTP request. +// func (f SecurityEnableUser) WithHeader(h map[string]string) func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { if r.Header == nil { @@ -198,6 +208,7 @@ func (f SecurityEnableUser) WithHeader(h map[string]string) func(*SecurityEnable } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityEnableUser) WithOpaqueID(s string) func(*SecurityEnableUserRequest) { return func(r *SecurityEnableUserRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_api_key.go index f3e27c1dc79..ea8f9cc5b2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityGetAPIKeyFunc(t Transport) SecurityGetAPIKey { // SecurityGetAPIKey - Retrieves information for one or more API keys. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html. +// type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, error) // SecurityGetAPIKeyRequest configures the Security GetAPI Key API request. +// type SecurityGetAPIKeyRequest struct { ID string Name string @@ -62,6 +64,7 @@ type SecurityGetAPIKeyRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -156,6 +159,7 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f SecurityGetAPIKey) WithContext(v context.Context) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f SecurityGetAPIKey) WithContext(v context.Context) func(*SecurityGetAPIKe } // WithID - api key ID of the api key to be retrieved. +// func (f SecurityGetAPIKey) WithID(v string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.ID = v @@ -170,6 +175,7 @@ func (f SecurityGetAPIKey) WithID(v string) func(*SecurityGetAPIKeyRequest) { } // WithName - api key name of the api key to be retrieved. +// func (f SecurityGetAPIKey) WithName(v string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.Name = v @@ -177,6 +183,7 @@ func (f SecurityGetAPIKey) WithName(v string) func(*SecurityGetAPIKeyRequest) { } // WithOwner - flag to query api keys owned by the currently authenticated user. +// func (f SecurityGetAPIKey) WithOwner(v bool) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.Owner = &v @@ -184,6 +191,7 @@ func (f SecurityGetAPIKey) WithOwner(v bool) func(*SecurityGetAPIKeyRequest) { } // WithRealmName - realm name of the user who created this api key to be retrieved. +// func (f SecurityGetAPIKey) WithRealmName(v string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.RealmName = v @@ -191,6 +199,7 @@ func (f SecurityGetAPIKey) WithRealmName(v string) func(*SecurityGetAPIKeyReques } // WithUsername - user name of the user who created this api key to be retrieved. +// func (f SecurityGetAPIKey) WithUsername(v string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.Username = v @@ -198,6 +207,7 @@ func (f SecurityGetAPIKey) WithUsername(v string) func(*SecurityGetAPIKeyRequest } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetAPIKey) WithPretty() func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.Pretty = true @@ -205,6 +215,7 @@ func (f SecurityGetAPIKey) WithPretty() func(*SecurityGetAPIKeyRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityGetAPIKey) WithHuman() func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.Human = true @@ -212,6 +223,7 @@ func (f SecurityGetAPIKey) WithHuman() func(*SecurityGetAPIKeyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetAPIKey) WithErrorTrace() func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.ErrorTrace = true @@ -219,6 +231,7 @@ func (f SecurityGetAPIKey) WithErrorTrace() func(*SecurityGetAPIKeyRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetAPIKey) WithFilterPath(v ...string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { r.FilterPath = v @@ -226,6 +239,7 @@ func (f SecurityGetAPIKey) WithFilterPath(v ...string) func(*SecurityGetAPIKeyRe } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetAPIKey) WithHeader(h map[string]string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { if r.Header == nil { @@ -238,6 +252,7 @@ func (f SecurityGetAPIKey) WithHeader(h map[string]string) func(*SecurityGetAPIK } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetAPIKey) WithOpaqueID(s string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_builtin_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_builtin_privileges.go index 211f34c2276..cc7c1932a1d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_builtin_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_builtin_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetBuiltinPrivilegesFunc(t Transport) SecurityGetBuiltinPrivileg // SecurityGetBuiltinPrivileges - Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html. +// type SecurityGetBuiltinPrivileges func(o ...func(*SecurityGetBuiltinPrivilegesRequest)) (*Response, error) // SecurityGetBuiltinPrivilegesRequest configures the Security Get Builtin Privileges API request. +// type SecurityGetBuiltinPrivilegesRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SecurityGetBuiltinPrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport T } // WithContext sets the request context. +// func (f SecurityGetBuiltinPrivileges) WithContext(v context.Context) func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SecurityGetBuiltinPrivileges) WithContext(v context.Context) func(*Secur } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetBuiltinPrivileges) WithPretty() func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SecurityGetBuiltinPrivileges) WithPretty() func(*SecurityGetBuiltinPrivi } // WithHuman makes statistical values human-readable. +// func (f SecurityGetBuiltinPrivileges) WithHuman() func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SecurityGetBuiltinPrivileges) WithHuman() func(*SecurityGetBuiltinPrivil } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetBuiltinPrivileges) WithErrorTrace() func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SecurityGetBuiltinPrivileges) WithErrorTrace() func(*SecurityGetBuiltinP } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetBuiltinPrivileges) WithFilterPath(v ...string) func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SecurityGetBuiltinPrivileges) WithFilterPath(v ...string) func(*Security } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetBuiltinPrivileges) WithHeader(h map[string]string) func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SecurityGetBuiltinPrivileges) WithHeader(h map[string]string) func(*Secu } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetBuiltinPrivileges) WithOpaqueID(s string) func(*SecurityGetBuiltinPrivilegesRequest) { return func(r *SecurityGetBuiltinPrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_privileges.go index 09427f9d4f2..d4d1a288748 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetPrivilegesFunc(t Transport) SecurityGetPrivileges { // SecurityGetPrivileges - Retrieves application privileges. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html. +// type SecurityGetPrivileges func(o ...func(*SecurityGetPrivilegesRequest)) (*Response, error) // SecurityGetPrivilegesRequest configures the Security Get Privileges API request. +// type SecurityGetPrivilegesRequest struct { Application string Name string @@ -58,6 +60,7 @@ type SecurityGetPrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f SecurityGetPrivileges) WithContext(v context.Context) func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f SecurityGetPrivileges) WithContext(v context.Context) func(*SecurityGetP } // WithApplication - application name. +// func (f SecurityGetPrivileges) WithApplication(v string) func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.Application = v @@ -157,6 +162,7 @@ func (f SecurityGetPrivileges) WithApplication(v string) func(*SecurityGetPrivil } // WithName - privilege name. +// func (f SecurityGetPrivileges) WithName(v string) func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.Name = v @@ -164,6 +170,7 @@ func (f SecurityGetPrivileges) WithName(v string) func(*SecurityGetPrivilegesReq } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetPrivileges) WithPretty() func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.Pretty = true @@ -171,6 +178,7 @@ func (f SecurityGetPrivileges) WithPretty() func(*SecurityGetPrivilegesRequest) } // WithHuman makes statistical values human-readable. +// func (f SecurityGetPrivileges) WithHuman() func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.Human = true @@ -178,6 +186,7 @@ func (f SecurityGetPrivileges) WithHuman() func(*SecurityGetPrivilegesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetPrivileges) WithErrorTrace() func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.ErrorTrace = true @@ -185,6 +194,7 @@ func (f SecurityGetPrivileges) WithErrorTrace() func(*SecurityGetPrivilegesReque } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetPrivileges) WithFilterPath(v ...string) func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { r.FilterPath = v @@ -192,6 +202,7 @@ func (f SecurityGetPrivileges) WithFilterPath(v ...string) func(*SecurityGetPriv } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetPrivileges) WithHeader(h map[string]string) func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { if r.Header == nil { @@ -204,6 +215,7 @@ func (f SecurityGetPrivileges) WithHeader(h map[string]string) func(*SecurityGet } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetPrivileges) WithOpaqueID(s string) func(*SecurityGetPrivilegesRequest) { return func(r *SecurityGetPrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role.go index 14fb39faa49..a0f2b93873c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetRoleFunc(t Transport) SecurityGetRole { // SecurityGetRole - Retrieves roles in the native realm. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html. +// type SecurityGetRole func(o ...func(*SecurityGetRoleRequest)) (*Response, error) // SecurityGetRoleRequest configures the Security Get Role API request. +// type SecurityGetRoleRequest struct { Name []string @@ -57,6 +59,7 @@ type SecurityGetRoleRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SecurityGetRole) WithContext(v context.Context) func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SecurityGetRole) WithContext(v context.Context) func(*SecurityGetRoleReq } // WithName - a list of role names. +// func (f SecurityGetRole) WithName(v ...string) func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { r.Name = v @@ -152,6 +157,7 @@ func (f SecurityGetRole) WithName(v ...string) func(*SecurityGetRoleRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetRole) WithPretty() func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f SecurityGetRole) WithPretty() func(*SecurityGetRoleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityGetRole) WithHuman() func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f SecurityGetRole) WithHuman() func(*SecurityGetRoleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetRole) WithErrorTrace() func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f SecurityGetRole) WithErrorTrace() func(*SecurityGetRoleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetRole) WithFilterPath(v ...string) func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f SecurityGetRole) WithFilterPath(v ...string) func(*SecurityGetRoleReques } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetRole) WithHeader(h map[string]string) func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f SecurityGetRole) WithHeader(h map[string]string) func(*SecurityGetRoleRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetRole) WithOpaqueID(s string) func(*SecurityGetRoleRequest) { return func(r *SecurityGetRoleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role_mapping.go index 8d5e076dda1..3d110ab0b5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_role_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetRoleMappingFunc(t Transport) SecurityGetRoleMapping { // SecurityGetRoleMapping - Retrieves role mappings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html. +// type SecurityGetRoleMapping func(o ...func(*SecurityGetRoleMappingRequest)) (*Response, error) // SecurityGetRoleMappingRequest configures the Security Get Role Mapping API request. +// type SecurityGetRoleMappingRequest struct { Name []string @@ -57,6 +59,7 @@ type SecurityGetRoleMappingRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f SecurityGetRoleMapping) WithContext(v context.Context) func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SecurityGetRoleMapping) WithContext(v context.Context) func(*SecurityGet } // WithName - a list of role-mapping names. +// func (f SecurityGetRoleMapping) WithName(v ...string) func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { r.Name = v @@ -152,6 +157,7 @@ func (f SecurityGetRoleMapping) WithName(v ...string) func(*SecurityGetRoleMappi } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetRoleMapping) WithPretty() func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f SecurityGetRoleMapping) WithPretty() func(*SecurityGetRoleMappingRequest } // WithHuman makes statistical values human-readable. +// func (f SecurityGetRoleMapping) WithHuman() func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f SecurityGetRoleMapping) WithHuman() func(*SecurityGetRoleMappingRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetRoleMapping) WithErrorTrace() func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f SecurityGetRoleMapping) WithErrorTrace() func(*SecurityGetRoleMappingReq } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetRoleMapping) WithFilterPath(v ...string) func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f SecurityGetRoleMapping) WithFilterPath(v ...string) func(*SecurityGetRol } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetRoleMapping) WithHeader(h map[string]string) func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f SecurityGetRoleMapping) WithHeader(h map[string]string) func(*SecurityGe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetRoleMapping) WithOpaqueID(s string) func(*SecurityGetRoleMappingRequest) { return func(r *SecurityGetRoleMappingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_accounts.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_accounts.go index 4baafa61b74..a458a29c4e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_accounts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_accounts.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetServiceAccountsFunc(t Transport) SecurityGetServiceAccounts { // SecurityGetServiceAccounts - Retrieves information about service accounts. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html. +// type SecurityGetServiceAccounts func(o ...func(*SecurityGetServiceAccountsRequest)) (*Response, error) // SecurityGetServiceAccountsRequest configures the Security Get Service Accounts API request. +// type SecurityGetServiceAccountsRequest struct { Namespace string Service string @@ -58,6 +60,7 @@ type SecurityGetServiceAccountsRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetServiceAccountsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r SecurityGetServiceAccountsRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f SecurityGetServiceAccounts) WithContext(v context.Context) func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f SecurityGetServiceAccounts) WithContext(v context.Context) func(*Securit } // WithNamespace - an identifier for the namespace. +// func (f SecurityGetServiceAccounts) WithNamespace(v string) func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.Namespace = v @@ -157,6 +162,7 @@ func (f SecurityGetServiceAccounts) WithNamespace(v string) func(*SecurityGetSer } // WithService - an identifier for the service name. +// func (f SecurityGetServiceAccounts) WithService(v string) func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.Service = v @@ -164,6 +170,7 @@ func (f SecurityGetServiceAccounts) WithService(v string) func(*SecurityGetServi } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetServiceAccounts) WithPretty() func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.Pretty = true @@ -171,6 +178,7 @@ func (f SecurityGetServiceAccounts) WithPretty() func(*SecurityGetServiceAccount } // WithHuman makes statistical values human-readable. +// func (f SecurityGetServiceAccounts) WithHuman() func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.Human = true @@ -178,6 +186,7 @@ func (f SecurityGetServiceAccounts) WithHuman() func(*SecurityGetServiceAccounts } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetServiceAccounts) WithErrorTrace() func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.ErrorTrace = true @@ -185,6 +194,7 @@ func (f SecurityGetServiceAccounts) WithErrorTrace() func(*SecurityGetServiceAcc } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetServiceAccounts) WithFilterPath(v ...string) func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { r.FilterPath = v @@ -192,6 +202,7 @@ func (f SecurityGetServiceAccounts) WithFilterPath(v ...string) func(*SecurityGe } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetServiceAccounts) WithHeader(h map[string]string) func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { if r.Header == nil { @@ -204,6 +215,7 @@ func (f SecurityGetServiceAccounts) WithHeader(h map[string]string) func(*Securi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetServiceAccounts) WithOpaqueID(s string) func(*SecurityGetServiceAccountsRequest) { return func(r *SecurityGetServiceAccountsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_credentials.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_credentials.go index f33cb0433f1..136ad11f6dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_credentials.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_service_credentials.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -26,7 +26,7 @@ import ( ) func newSecurityGetServiceCredentialsFunc(t Transport) SecurityGetServiceCredentials { - return func(namespace string, service string, o ...func(*SecurityGetServiceCredentialsRequest)) (*Response, error) { + return func(service string, namespace string, o ...func(*SecurityGetServiceCredentialsRequest)) (*Response, error) { var r = SecurityGetServiceCredentialsRequest{Namespace: namespace, Service: service} for _, f := range o { f(&r) @@ -40,9 +40,11 @@ func newSecurityGetServiceCredentialsFunc(t Transport) SecurityGetServiceCredent // SecurityGetServiceCredentials - Retrieves information of all service credentials for a service account. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html. +// type SecurityGetServiceCredentials func(namespace string, service string, o ...func(*SecurityGetServiceCredentialsRequest)) (*Response, error) // SecurityGetServiceCredentialsRequest configures the Security Get Service Credentials API request. +// type SecurityGetServiceCredentialsRequest struct { Namespace string Service string @@ -58,6 +60,7 @@ type SecurityGetServiceCredentialsRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetServiceCredentialsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r SecurityGetServiceCredentialsRequest) Do(ctx context.Context, transport } // WithContext sets the request context. +// func (f SecurityGetServiceCredentials) WithContext(v context.Context) func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f SecurityGetServiceCredentials) WithContext(v context.Context) func(*Secu } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetServiceCredentials) WithPretty() func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { r.Pretty = true @@ -155,6 +160,7 @@ func (f SecurityGetServiceCredentials) WithPretty() func(*SecurityGetServiceCred } // WithHuman makes statistical values human-readable. +// func (f SecurityGetServiceCredentials) WithHuman() func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { r.Human = true @@ -162,6 +168,7 @@ func (f SecurityGetServiceCredentials) WithHuman() func(*SecurityGetServiceCrede } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetServiceCredentials) WithErrorTrace() func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { r.ErrorTrace = true @@ -169,6 +176,7 @@ func (f SecurityGetServiceCredentials) WithErrorTrace() func(*SecurityGetService } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetServiceCredentials) WithFilterPath(v ...string) func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { r.FilterPath = v @@ -176,6 +184,7 @@ func (f SecurityGetServiceCredentials) WithFilterPath(v ...string) func(*Securit } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetServiceCredentials) WithHeader(h map[string]string) func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { if r.Header == nil { @@ -188,6 +197,7 @@ func (f SecurityGetServiceCredentials) WithHeader(h map[string]string) func(*Sec } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetServiceCredentials) WithOpaqueID(s string) func(*SecurityGetServiceCredentialsRequest) { return func(r *SecurityGetServiceCredentialsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_token.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_token.go index 0c7f432dc37..8d83c6aad1d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityGetTokenFunc(t Transport) SecurityGetToken { // SecurityGetToken - Creates a bearer token for access without requiring basic authentication. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html. +// type SecurityGetToken func(body io.Reader, o ...func(*SecurityGetTokenRequest)) (*Response, error) // SecurityGetTokenRequest configures the Security Get Token API request. +// type SecurityGetTokenRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecurityGetTokenRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (* 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 @@ -113,10 +120,6 @@ func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (* } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (* } // WithContext sets the request context. +// func (f SecurityGetToken) WithContext(v context.Context) func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecurityGetToken) WithContext(v context.Context) func(*SecurityGetTokenR } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetToken) WithPretty() func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecurityGetToken) WithPretty() func(*SecurityGetTokenRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityGetToken) WithHuman() func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecurityGetToken) WithHuman() func(*SecurityGetTokenRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetToken) WithErrorTrace() func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecurityGetToken) WithErrorTrace() func(*SecurityGetTokenRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetToken) WithFilterPath(v ...string) func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecurityGetToken) WithFilterPath(v ...string) func(*SecurityGetTokenRequ } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetToken) WithHeader(h map[string]string) func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecurityGetToken) WithHeader(h map[string]string) func(*SecurityGetToken } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetToken) WithOpaqueID(s string) func(*SecurityGetTokenRequest) { return func(r *SecurityGetTokenRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user.go index ac3af2e0719..7c5e79235dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetUserFunc(t Transport) SecurityGetUser { // SecurityGetUser - Retrieves information about users in the native realm and built-in users. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html. +// type SecurityGetUser func(o ...func(*SecurityGetUserRequest)) (*Response, error) // SecurityGetUserRequest configures the Security Get User API request. +// type SecurityGetUserRequest struct { Username []string @@ -57,6 +59,7 @@ type SecurityGetUserRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SecurityGetUser) WithContext(v context.Context) func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SecurityGetUser) WithContext(v context.Context) func(*SecurityGetUserReq } // WithUsername - a list of usernames. +// func (f SecurityGetUser) WithUsername(v ...string) func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { r.Username = v @@ -152,6 +157,7 @@ func (f SecurityGetUser) WithUsername(v ...string) func(*SecurityGetUserRequest) } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetUser) WithPretty() func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f SecurityGetUser) WithPretty() func(*SecurityGetUserRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityGetUser) WithHuman() func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f SecurityGetUser) WithHuman() func(*SecurityGetUserRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetUser) WithErrorTrace() func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f SecurityGetUser) WithErrorTrace() func(*SecurityGetUserRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetUser) WithFilterPath(v ...string) func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f SecurityGetUser) WithFilterPath(v ...string) func(*SecurityGetUserReques } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetUser) WithHeader(h map[string]string) func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f SecurityGetUser) WithHeader(h map[string]string) func(*SecurityGetUserRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetUser) WithOpaqueID(s string) func(*SecurityGetUserRequest) { return func(r *SecurityGetUserRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user_privileges.go index 577934e4580..3313d23bc5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.get_user_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecurityGetUserPrivilegesFunc(t Transport) SecurityGetUserPrivileges { // SecurityGetUserPrivileges - Retrieves security privileges for the logged in user. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html. +// type SecurityGetUserPrivileges func(o ...func(*SecurityGetUserPrivilegesRequest)) (*Response, error) // SecurityGetUserPrivilegesRequest configures the Security Get User Privileges API request. +// type SecurityGetUserPrivilegesRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SecurityGetUserPrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f SecurityGetUserPrivileges) WithContext(v context.Context) func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SecurityGetUserPrivileges) WithContext(v context.Context) func(*Security } // WithPretty makes the response body pretty-printed. +// func (f SecurityGetUserPrivileges) WithPretty() func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SecurityGetUserPrivileges) WithPretty() func(*SecurityGetUserPrivilegesR } // WithHuman makes statistical values human-readable. +// func (f SecurityGetUserPrivileges) WithHuman() func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SecurityGetUserPrivileges) WithHuman() func(*SecurityGetUserPrivilegesRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGetUserPrivileges) WithErrorTrace() func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SecurityGetUserPrivileges) WithErrorTrace() func(*SecurityGetUserPrivile } // WithFilterPath filters the properties of the response body. +// func (f SecurityGetUserPrivileges) WithFilterPath(v ...string) func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SecurityGetUserPrivileges) WithFilterPath(v ...string) func(*SecurityGet } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGetUserPrivileges) WithHeader(h map[string]string) func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SecurityGetUserPrivileges) WithHeader(h map[string]string) func(*Securit } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGetUserPrivileges) WithOpaqueID(s string) func(*SecurityGetUserPrivilegesRequest) { return func(r *SecurityGetUserPrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.grant_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.grant_api_key.go index b037512d7f0..ccce70d89db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.grant_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.grant_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityGrantAPIKeyFunc(t Transport) SecurityGrantAPIKey { // SecurityGrantAPIKey - Creates an API key on behalf of another user. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html. +// type SecurityGrantAPIKey func(body io.Reader, o ...func(*SecurityGrantAPIKeyRequest)) (*Response, error) // SecurityGrantAPIKeyRequest configures the Security GrantAPI Key API request. +// type SecurityGrantAPIKeyRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type SecurityGrantAPIKeyRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -107,6 +110,10 @@ func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) 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 @@ -119,10 +126,6 @@ func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -142,6 +145,7 @@ func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SecurityGrantAPIKey) WithContext(v context.Context) func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SecurityGrantAPIKey) WithContext(v context.Context) func(*SecurityGrantA } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityGrantAPIKey) WithRefresh(v string) func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { r.Refresh = v @@ -156,6 +161,7 @@ func (f SecurityGrantAPIKey) WithRefresh(v string) func(*SecurityGrantAPIKeyRequ } // WithPretty makes the response body pretty-printed. +// func (f SecurityGrantAPIKey) WithPretty() func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SecurityGrantAPIKey) WithPretty() func(*SecurityGrantAPIKeyRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityGrantAPIKey) WithHuman() func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SecurityGrantAPIKey) WithHuman() func(*SecurityGrantAPIKeyRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityGrantAPIKey) WithErrorTrace() func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SecurityGrantAPIKey) WithErrorTrace() func(*SecurityGrantAPIKeyRequest) } // WithFilterPath filters the properties of the response body. +// func (f SecurityGrantAPIKey) WithFilterPath(v ...string) func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SecurityGrantAPIKey) WithFilterPath(v ...string) func(*SecurityGrantAPIK } // WithHeader adds the headers to the HTTP request. +// func (f SecurityGrantAPIKey) WithHeader(h map[string]string) func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SecurityGrantAPIKey) WithHeader(h map[string]string) func(*SecurityGrant } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityGrantAPIKey) WithOpaqueID(s string) func(*SecurityGrantAPIKeyRequest) { return func(r *SecurityGrantAPIKeyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.has_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.has_privileges.go index 15d9d3245b4..7375ce45c5d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.has_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.has_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityHasPrivilegesFunc(t Transport) SecurityHasPrivileges { // SecurityHasPrivileges - Determines whether the specified user has a specified list of privileges. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html. +// type SecurityHasPrivileges func(body io.Reader, o ...func(*SecurityHasPrivilegesRequest)) (*Response, error) // SecurityHasPrivilegesRequest configures the Security Has Privileges API request. +// type SecurityHasPrivilegesRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type SecurityHasPrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -112,6 +115,10 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor 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 @@ -124,10 +131,6 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -147,6 +150,7 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f SecurityHasPrivileges) WithContext(v context.Context) func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f SecurityHasPrivileges) WithContext(v context.Context) func(*SecurityHasP } // WithUser - username. +// func (f SecurityHasPrivileges) WithUser(v string) func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { r.User = v @@ -161,6 +166,7 @@ func (f SecurityHasPrivileges) WithUser(v string) func(*SecurityHasPrivilegesReq } // WithPretty makes the response body pretty-printed. +// func (f SecurityHasPrivileges) WithPretty() func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { r.Pretty = true @@ -168,6 +174,7 @@ func (f SecurityHasPrivileges) WithPretty() func(*SecurityHasPrivilegesRequest) } // WithHuman makes statistical values human-readable. +// func (f SecurityHasPrivileges) WithHuman() func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { r.Human = true @@ -175,6 +182,7 @@ func (f SecurityHasPrivileges) WithHuman() func(*SecurityHasPrivilegesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityHasPrivileges) WithErrorTrace() func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { r.ErrorTrace = true @@ -182,6 +190,7 @@ func (f SecurityHasPrivileges) WithErrorTrace() func(*SecurityHasPrivilegesReque } // WithFilterPath filters the properties of the response body. +// func (f SecurityHasPrivileges) WithFilterPath(v ...string) func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { r.FilterPath = v @@ -189,6 +198,7 @@ func (f SecurityHasPrivileges) WithFilterPath(v ...string) func(*SecurityHasPriv } // WithHeader adds the headers to the HTTP request. +// func (f SecurityHasPrivileges) WithHeader(h map[string]string) func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { if r.Header == nil { @@ -201,6 +211,7 @@ func (f SecurityHasPrivileges) WithHeader(h map[string]string) func(*SecurityHas } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityHasPrivileges) WithOpaqueID(s string) func(*SecurityHasPrivilegesRequest) { return func(r *SecurityHasPrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_api_key.go index 5bd60042e6d..5a483aee54d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityInvalidateAPIKeyFunc(t Transport) SecurityInvalidateAPIKey { // SecurityInvalidateAPIKey - Invalidates one or more API keys. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html. +// type SecurityInvalidateAPIKey func(body io.Reader, o ...func(*SecurityInvalidateAPIKeyRequest)) (*Response, error) // SecurityInvalidateAPIKeyRequest configures the Security InvalidateAPI Key API request. +// type SecurityInvalidateAPIKeyRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecurityInvalidateAPIKeyRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans 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 @@ -113,10 +120,6 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SecurityInvalidateAPIKey) WithContext(v context.Context) func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecurityInvalidateAPIKey) WithContext(v context.Context) func(*SecurityI } // WithPretty makes the response body pretty-printed. +// func (f SecurityInvalidateAPIKey) WithPretty() func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecurityInvalidateAPIKey) WithPretty() func(*SecurityInvalidateAPIKeyReq } // WithHuman makes statistical values human-readable. +// func (f SecurityInvalidateAPIKey) WithHuman() func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecurityInvalidateAPIKey) WithHuman() func(*SecurityInvalidateAPIKeyRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityInvalidateAPIKey) WithErrorTrace() func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecurityInvalidateAPIKey) WithErrorTrace() func(*SecurityInvalidateAPIKe } // WithFilterPath filters the properties of the response body. +// func (f SecurityInvalidateAPIKey) WithFilterPath(v ...string) func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecurityInvalidateAPIKey) WithFilterPath(v ...string) func(*SecurityInva } // WithHeader adds the headers to the HTTP request. +// func (f SecurityInvalidateAPIKey) WithHeader(h map[string]string) func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecurityInvalidateAPIKey) WithHeader(h map[string]string) func(*Security } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityInvalidateAPIKey) WithOpaqueID(s string) func(*SecurityInvalidateAPIKeyRequest) { return func(r *SecurityInvalidateAPIKeyRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_token.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_token.go index bf5137de941..da25af0a597 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.invalidate_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityInvalidateTokenFunc(t Transport) SecurityInvalidateToken { // SecurityInvalidateToken - Invalidates one or more access tokens or refresh tokens. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html. +// type SecurityInvalidateToken func(body io.Reader, o ...func(*SecurityInvalidateTokenRequest)) (*Response, error) // SecurityInvalidateTokenRequest configures the Security Invalidate Token API request. +// type SecurityInvalidateTokenRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecurityInvalidateTokenRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transp 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 @@ -113,10 +120,6 @@ func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f SecurityInvalidateToken) WithContext(v context.Context) func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecurityInvalidateToken) WithContext(v context.Context) func(*SecurityIn } // WithPretty makes the response body pretty-printed. +// func (f SecurityInvalidateToken) WithPretty() func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecurityInvalidateToken) WithPretty() func(*SecurityInvalidateTokenReque } // WithHuman makes statistical values human-readable. +// func (f SecurityInvalidateToken) WithHuman() func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecurityInvalidateToken) WithHuman() func(*SecurityInvalidateTokenReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityInvalidateToken) WithErrorTrace() func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecurityInvalidateToken) WithErrorTrace() func(*SecurityInvalidateTokenR } // WithFilterPath filters the properties of the response body. +// func (f SecurityInvalidateToken) WithFilterPath(v ...string) func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecurityInvalidateToken) WithFilterPath(v ...string) func(*SecurityInval } // WithHeader adds the headers to the HTTP request. +// func (f SecurityInvalidateToken) WithHeader(h map[string]string) func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecurityInvalidateToken) WithHeader(h map[string]string) func(*SecurityI } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityInvalidateToken) WithOpaqueID(s string) func(*SecurityInvalidateTokenRequest) { return func(r *SecurityInvalidateTokenRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_privileges.go index f56e969d5c5..787ac617a1f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityPutPrivilegesFunc(t Transport) SecurityPutPrivileges { // SecurityPutPrivileges - Adds or updates application privileges. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html. +// type SecurityPutPrivileges func(body io.Reader, o ...func(*SecurityPutPrivilegesRequest)) (*Response, error) // SecurityPutPrivilegesRequest configures the Security Put Privileges API request. +// type SecurityPutPrivilegesRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type SecurityPutPrivilegesRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -107,6 +110,10 @@ func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transpor 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 @@ -119,10 +126,6 @@ func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -142,6 +145,7 @@ func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f SecurityPutPrivileges) WithContext(v context.Context) func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SecurityPutPrivileges) WithContext(v context.Context) func(*SecurityPutP } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityPutPrivileges) WithRefresh(v string) func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { r.Refresh = v @@ -156,6 +161,7 @@ func (f SecurityPutPrivileges) WithRefresh(v string) func(*SecurityPutPrivileges } // WithPretty makes the response body pretty-printed. +// func (f SecurityPutPrivileges) WithPretty() func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SecurityPutPrivileges) WithPretty() func(*SecurityPutPrivilegesRequest) } // WithHuman makes statistical values human-readable. +// func (f SecurityPutPrivileges) WithHuman() func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SecurityPutPrivileges) WithHuman() func(*SecurityPutPrivilegesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityPutPrivileges) WithErrorTrace() func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SecurityPutPrivileges) WithErrorTrace() func(*SecurityPutPrivilegesReque } // WithFilterPath filters the properties of the response body. +// func (f SecurityPutPrivileges) WithFilterPath(v ...string) func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SecurityPutPrivileges) WithFilterPath(v ...string) func(*SecurityPutPriv } // WithHeader adds the headers to the HTTP request. +// func (f SecurityPutPrivileges) WithHeader(h map[string]string) func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SecurityPutPrivileges) WithHeader(h map[string]string) func(*SecurityPut } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityPutPrivileges) WithOpaqueID(s string) func(*SecurityPutPrivilegesRequest) { return func(r *SecurityPutPrivilegesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role.go index 985dee9e50e..04e9b956682 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityPutRoleFunc(t Transport) SecurityPutRole { // SecurityPutRole - Adds and updates roles in the native realm. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html. +// type SecurityPutRole func(name string, body io.Reader, o ...func(*SecurityPutRoleRequest)) (*Response, error) // SecurityPutRoleRequest configures the Security Put Role API request. +// type SecurityPutRoleRequest struct { Body io.Reader @@ -62,6 +64,7 @@ type SecurityPutRoleRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -114,6 +117,10 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -126,10 +133,6 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -149,6 +152,7 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SecurityPutRole) WithContext(v context.Context) func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f SecurityPutRole) WithContext(v context.Context) func(*SecurityPutRoleReq } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityPutRole) WithRefresh(v string) func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { r.Refresh = v @@ -163,6 +168,7 @@ func (f SecurityPutRole) WithRefresh(v string) func(*SecurityPutRoleRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SecurityPutRole) WithPretty() func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { r.Pretty = true @@ -170,6 +176,7 @@ func (f SecurityPutRole) WithPretty() func(*SecurityPutRoleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityPutRole) WithHuman() func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { r.Human = true @@ -177,6 +184,7 @@ func (f SecurityPutRole) WithHuman() func(*SecurityPutRoleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityPutRole) WithErrorTrace() func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { r.ErrorTrace = true @@ -184,6 +192,7 @@ func (f SecurityPutRole) WithErrorTrace() func(*SecurityPutRoleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityPutRole) WithFilterPath(v ...string) func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { r.FilterPath = v @@ -191,6 +200,7 @@ func (f SecurityPutRole) WithFilterPath(v ...string) func(*SecurityPutRoleReques } // WithHeader adds the headers to the HTTP request. +// func (f SecurityPutRole) WithHeader(h map[string]string) func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { if r.Header == nil { @@ -203,6 +213,7 @@ func (f SecurityPutRole) WithHeader(h map[string]string) func(*SecurityPutRoleRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityPutRole) WithOpaqueID(s string) func(*SecurityPutRoleRequest) { return func(r *SecurityPutRoleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role_mapping.go index 0c2fdee0116..cc224fe2f71 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_role_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityPutRoleMappingFunc(t Transport) SecurityPutRoleMapping { // SecurityPutRoleMapping - Creates and updates role mappings. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html. +// type SecurityPutRoleMapping func(name string, body io.Reader, o ...func(*SecurityPutRoleMappingRequest)) (*Response, error) // SecurityPutRoleMappingRequest configures the Security Put Role Mapping API request. +// type SecurityPutRoleMappingRequest struct { Body io.Reader @@ -62,6 +64,7 @@ type SecurityPutRoleMappingRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -114,6 +117,10 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo 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 @@ -126,10 +133,6 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -149,6 +152,7 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f SecurityPutRoleMapping) WithContext(v context.Context) func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f SecurityPutRoleMapping) WithContext(v context.Context) func(*SecurityPut } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityPutRoleMapping) WithRefresh(v string) func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { r.Refresh = v @@ -163,6 +168,7 @@ func (f SecurityPutRoleMapping) WithRefresh(v string) func(*SecurityPutRoleMappi } // WithPretty makes the response body pretty-printed. +// func (f SecurityPutRoleMapping) WithPretty() func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { r.Pretty = true @@ -170,6 +176,7 @@ func (f SecurityPutRoleMapping) WithPretty() func(*SecurityPutRoleMappingRequest } // WithHuman makes statistical values human-readable. +// func (f SecurityPutRoleMapping) WithHuman() func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { r.Human = true @@ -177,6 +184,7 @@ func (f SecurityPutRoleMapping) WithHuman() func(*SecurityPutRoleMappingRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityPutRoleMapping) WithErrorTrace() func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { r.ErrorTrace = true @@ -184,6 +192,7 @@ func (f SecurityPutRoleMapping) WithErrorTrace() func(*SecurityPutRoleMappingReq } // WithFilterPath filters the properties of the response body. +// func (f SecurityPutRoleMapping) WithFilterPath(v ...string) func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { r.FilterPath = v @@ -191,6 +200,7 @@ func (f SecurityPutRoleMapping) WithFilterPath(v ...string) func(*SecurityPutRol } // WithHeader adds the headers to the HTTP request. +// func (f SecurityPutRoleMapping) WithHeader(h map[string]string) func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { if r.Header == nil { @@ -203,6 +213,7 @@ func (f SecurityPutRoleMapping) WithHeader(h map[string]string) func(*SecurityPu } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityPutRoleMapping) WithOpaqueID(s string) func(*SecurityPutRoleMappingRequest) { return func(r *SecurityPutRoleMappingRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_user.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_user.go index 161bda28532..a7d1093bcc5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.put_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityPutUserFunc(t Transport) SecurityPutUser { // SecurityPutUser - Adds and updates users in the native realm. These users are commonly referred to as native users. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html. +// type SecurityPutUser func(username string, body io.Reader, o ...func(*SecurityPutUserRequest)) (*Response, error) // SecurityPutUserRequest configures the Security Put User API request. +// type SecurityPutUserRequest struct { Body io.Reader @@ -62,6 +64,7 @@ type SecurityPutUserRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -114,6 +117,10 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -126,10 +133,6 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -149,6 +152,7 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SecurityPutUser) WithContext(v context.Context) func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f SecurityPutUser) WithContext(v context.Context) func(*SecurityPutUserReq } // WithRefresh - if `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.. +// func (f SecurityPutUser) WithRefresh(v string) func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { r.Refresh = v @@ -163,6 +168,7 @@ func (f SecurityPutUser) WithRefresh(v string) func(*SecurityPutUserRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SecurityPutUser) WithPretty() func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { r.Pretty = true @@ -170,6 +176,7 @@ func (f SecurityPutUser) WithPretty() func(*SecurityPutUserRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityPutUser) WithHuman() func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { r.Human = true @@ -177,6 +184,7 @@ func (f SecurityPutUser) WithHuman() func(*SecurityPutUserRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityPutUser) WithErrorTrace() func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { r.ErrorTrace = true @@ -184,6 +192,7 @@ func (f SecurityPutUser) WithErrorTrace() func(*SecurityPutUserRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecurityPutUser) WithFilterPath(v ...string) func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { r.FilterPath = v @@ -191,6 +200,7 @@ func (f SecurityPutUser) WithFilterPath(v ...string) func(*SecurityPutUserReques } // WithHeader adds the headers to the HTTP request. +// func (f SecurityPutUser) WithHeader(h map[string]string) func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { if r.Header == nil { @@ -203,6 +213,7 @@ func (f SecurityPutUser) WithHeader(h map[string]string) func(*SecurityPutUserRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityPutUser) WithOpaqueID(s string) func(*SecurityPutUserRequest) { return func(r *SecurityPutUserRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.query_api_keys.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.query_api_keys.go index 1651dc39fbf..8bb0f280056 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.query_api_keys.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.query_api_keys.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecurityQueryAPIKeysFunc(t Transport) SecurityQueryAPIKeys { // SecurityQueryAPIKeys - Retrieves information for API keys using a subset of query DSL // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html. +// type SecurityQueryAPIKeys func(o ...func(*SecurityQueryAPIKeysRequest)) (*Response, error) // SecurityQueryAPIKeysRequest configures the Security QueryAPI Keys API request. +// type SecurityQueryAPIKeysRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecurityQueryAPIKeysRequest struct { } // Do executes the request and returns response or error. +// func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport 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 @@ -113,10 +120,6 @@ func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f SecurityQueryAPIKeys) WithContext(v context.Context) func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecurityQueryAPIKeys) WithContext(v context.Context) func(*SecurityQuery } // WithBody - From, size, query, sort and search_after. +// func (f SecurityQueryAPIKeys) WithBody(v io.Reader) func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { r.Body = v @@ -150,6 +155,7 @@ func (f SecurityQueryAPIKeys) WithBody(v io.Reader) func(*SecurityQueryAPIKeysRe } // WithPretty makes the response body pretty-printed. +// func (f SecurityQueryAPIKeys) WithPretty() func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f SecurityQueryAPIKeys) WithPretty() func(*SecurityQueryAPIKeysRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecurityQueryAPIKeys) WithHuman() func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f SecurityQueryAPIKeys) WithHuman() func(*SecurityQueryAPIKeysRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecurityQueryAPIKeys) WithErrorTrace() func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f SecurityQueryAPIKeys) WithErrorTrace() func(*SecurityQueryAPIKeysRequest } // WithFilterPath filters the properties of the response body. +// func (f SecurityQueryAPIKeys) WithFilterPath(v ...string) func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f SecurityQueryAPIKeys) WithFilterPath(v ...string) func(*SecurityQueryAPI } // WithHeader adds the headers to the HTTP request. +// func (f SecurityQueryAPIKeys) WithHeader(h map[string]string) func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f SecurityQueryAPIKeys) WithHeader(h map[string]string) func(*SecurityQuer } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecurityQueryAPIKeys) WithOpaqueID(s string) func(*SecurityQueryAPIKeysRequest) { return func(r *SecurityQueryAPIKeysRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_authenticate.go index 9da9c62c6ed..3c93868f83b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_authenticate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecuritySamlAuthenticateFunc(t Transport) SecuritySamlAuthenticate { // SecuritySamlAuthenticate - Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html. +// type SecuritySamlAuthenticate func(body io.Reader, o ...func(*SecuritySamlAuthenticateRequest)) (*Response, error) // SecuritySamlAuthenticateRequest configures the Security Saml Authenticate API request. +// type SecuritySamlAuthenticateRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecuritySamlAuthenticateRequest struct { } // Do executes the request and returns response or error. +// func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Trans 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 @@ -113,10 +120,6 @@ func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f SecuritySamlAuthenticate) WithContext(v context.Context) func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecuritySamlAuthenticate) WithContext(v context.Context) func(*SecurityS } // WithPretty makes the response body pretty-printed. +// func (f SecuritySamlAuthenticate) WithPretty() func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecuritySamlAuthenticate) WithPretty() func(*SecuritySamlAuthenticateReq } // WithHuman makes statistical values human-readable. +// func (f SecuritySamlAuthenticate) WithHuman() func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecuritySamlAuthenticate) WithHuman() func(*SecuritySamlAuthenticateRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecuritySamlAuthenticate) WithErrorTrace() func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecuritySamlAuthenticate) WithErrorTrace() func(*SecuritySamlAuthenticat } // WithFilterPath filters the properties of the response body. +// func (f SecuritySamlAuthenticate) WithFilterPath(v ...string) func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecuritySamlAuthenticate) WithFilterPath(v ...string) func(*SecuritySaml } // WithHeader adds the headers to the HTTP request. +// func (f SecuritySamlAuthenticate) WithHeader(h map[string]string) func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecuritySamlAuthenticate) WithHeader(h map[string]string) func(*Security } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecuritySamlAuthenticate) WithOpaqueID(s string) func(*SecuritySamlAuthenticateRequest) { return func(r *SecuritySamlAuthenticateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_complete_logout.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_complete_logout.go index 05bff083bb5..3d8a513119e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_complete_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_complete_logout.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecuritySamlCompleteLogoutFunc(t Transport) SecuritySamlCompleteLogout { // SecuritySamlCompleteLogout - Verifies the logout response sent from the SAML IdP // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html. +// type SecuritySamlCompleteLogout func(body io.Reader, o ...func(*SecuritySamlCompleteLogoutRequest)) (*Response, error) // SecuritySamlCompleteLogoutRequest configures the Security Saml Complete Logout API request. +// type SecuritySamlCompleteLogoutRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecuritySamlCompleteLogoutRequest struct { } // Do executes the request and returns response or error. +// func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Tra 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 @@ -113,10 +120,6 @@ func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Tra } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f SecuritySamlCompleteLogout) WithContext(v context.Context) func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecuritySamlCompleteLogout) WithContext(v context.Context) func(*Securit } // WithPretty makes the response body pretty-printed. +// func (f SecuritySamlCompleteLogout) WithPretty() func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecuritySamlCompleteLogout) WithPretty() func(*SecuritySamlCompleteLogou } // WithHuman makes statistical values human-readable. +// func (f SecuritySamlCompleteLogout) WithHuman() func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecuritySamlCompleteLogout) WithHuman() func(*SecuritySamlCompleteLogout } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecuritySamlCompleteLogout) WithErrorTrace() func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecuritySamlCompleteLogout) WithErrorTrace() func(*SecuritySamlCompleteL } // WithFilterPath filters the properties of the response body. +// func (f SecuritySamlCompleteLogout) WithFilterPath(v ...string) func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecuritySamlCompleteLogout) WithFilterPath(v ...string) func(*SecuritySa } // WithHeader adds the headers to the HTTP request. +// func (f SecuritySamlCompleteLogout) WithHeader(h map[string]string) func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecuritySamlCompleteLogout) WithHeader(h map[string]string) func(*Securi } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecuritySamlCompleteLogout) WithOpaqueID(s string) func(*SecuritySamlCompleteLogoutRequest) { return func(r *SecuritySamlCompleteLogoutRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_invalidate.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_invalidate.go index 7eba5074bc2..eca13549019 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_invalidate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_invalidate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecuritySamlInvalidateFunc(t Transport) SecuritySamlInvalidate { // SecuritySamlInvalidate - Consumes a SAML LogoutRequest // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html. +// type SecuritySamlInvalidate func(body io.Reader, o ...func(*SecuritySamlInvalidateRequest)) (*Response, error) // SecuritySamlInvalidateRequest configures the Security Saml Invalidate API request. +// type SecuritySamlInvalidateRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecuritySamlInvalidateRequest struct { } // Do executes the request and returns response or error. +// func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transpo 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 @@ -113,10 +120,6 @@ func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transpo } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f SecuritySamlInvalidate) WithContext(v context.Context) func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecuritySamlInvalidate) WithContext(v context.Context) func(*SecuritySam } // WithPretty makes the response body pretty-printed. +// func (f SecuritySamlInvalidate) WithPretty() func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecuritySamlInvalidate) WithPretty() func(*SecuritySamlInvalidateRequest } // WithHuman makes statistical values human-readable. +// func (f SecuritySamlInvalidate) WithHuman() func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecuritySamlInvalidate) WithHuman() func(*SecuritySamlInvalidateRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecuritySamlInvalidate) WithErrorTrace() func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecuritySamlInvalidate) WithErrorTrace() func(*SecuritySamlInvalidateReq } // WithFilterPath filters the properties of the response body. +// func (f SecuritySamlInvalidate) WithFilterPath(v ...string) func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecuritySamlInvalidate) WithFilterPath(v ...string) func(*SecuritySamlIn } // WithHeader adds the headers to the HTTP request. +// func (f SecuritySamlInvalidate) WithHeader(h map[string]string) func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecuritySamlInvalidate) WithHeader(h map[string]string) func(*SecuritySa } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecuritySamlInvalidate) WithOpaqueID(s string) func(*SecuritySamlInvalidateRequest) { return func(r *SecuritySamlInvalidateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_logout.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_logout.go index 3b7013535fd..198802cd186 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_logout.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecuritySamlLogoutFunc(t Transport) SecuritySamlLogout { // SecuritySamlLogout - Invalidates an access token and a refresh token that were generated via the SAML Authenticate API // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html. +// type SecuritySamlLogout func(body io.Reader, o ...func(*SecuritySamlLogoutRequest)) (*Response, error) // SecuritySamlLogoutRequest configures the Security Saml Logout API request. +// type SecuritySamlLogoutRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecuritySamlLogoutRequest struct { } // Do executes the request and returns response or error. +// func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) 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 @@ -113,10 +120,6 @@ func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SecuritySamlLogout) WithContext(v context.Context) func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecuritySamlLogout) WithContext(v context.Context) func(*SecuritySamlLog } // WithPretty makes the response body pretty-printed. +// func (f SecuritySamlLogout) WithPretty() func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecuritySamlLogout) WithPretty() func(*SecuritySamlLogoutRequest) { } // WithHuman makes statistical values human-readable. +// func (f SecuritySamlLogout) WithHuman() func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecuritySamlLogout) WithHuman() func(*SecuritySamlLogoutRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecuritySamlLogout) WithErrorTrace() func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecuritySamlLogout) WithErrorTrace() func(*SecuritySamlLogoutRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SecuritySamlLogout) WithFilterPath(v ...string) func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecuritySamlLogout) WithFilterPath(v ...string) func(*SecuritySamlLogout } // WithHeader adds the headers to the HTTP request. +// func (f SecuritySamlLogout) WithHeader(h map[string]string) func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecuritySamlLogout) WithHeader(h map[string]string) func(*SecuritySamlLo } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecuritySamlLogout) WithOpaqueID(s string) func(*SecuritySamlLogoutRequest) { return func(r *SecuritySamlLogoutRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_prepare_authentication.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_prepare_authentication.go index b9662e77e1d..dc37ab96d18 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_prepare_authentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_prepare_authentication.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSecuritySamlPrepareAuthenticationFunc(t Transport) SecuritySamlPrepareAu // SecuritySamlPrepareAuthentication - Creates a SAML authentication request // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html. +// type SecuritySamlPrepareAuthentication func(body io.Reader, o ...func(*SecuritySamlPrepareAuthenticationRequest)) (*Response, error) // SecuritySamlPrepareAuthenticationRequest configures the Security Saml Prepare Authentication API request. +// type SecuritySamlPrepareAuthenticationRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SecuritySamlPrepareAuthenticationRequest struct { } // Do executes the request and returns response or error. +// func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transp 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 @@ -113,10 +120,6 @@ func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transp } // WithContext sets the request context. +// func (f SecuritySamlPrepareAuthentication) WithContext(v context.Context) func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SecuritySamlPrepareAuthentication) WithContext(v context.Context) func(* } // WithPretty makes the response body pretty-printed. +// func (f SecuritySamlPrepareAuthentication) WithPretty() func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SecuritySamlPrepareAuthentication) WithPretty() func(*SecuritySamlPrepar } // WithHuman makes statistical values human-readable. +// func (f SecuritySamlPrepareAuthentication) WithHuman() func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SecuritySamlPrepareAuthentication) WithHuman() func(*SecuritySamlPrepare } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecuritySamlPrepareAuthentication) WithErrorTrace() func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SecuritySamlPrepareAuthentication) WithErrorTrace() func(*SecuritySamlPr } // WithFilterPath filters the properties of the response body. +// func (f SecuritySamlPrepareAuthentication) WithFilterPath(v ...string) func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SecuritySamlPrepareAuthentication) WithFilterPath(v ...string) func(*Sec } // WithHeader adds the headers to the HTTP request. +// func (f SecuritySamlPrepareAuthentication) WithHeader(h map[string]string) func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SecuritySamlPrepareAuthentication) WithHeader(h map[string]string) func( } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecuritySamlPrepareAuthentication) WithOpaqueID(s string) func(*SecuritySamlPrepareAuthenticationRequest) { return func(r *SecuritySamlPrepareAuthenticationRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_service_provider_metadata.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_service_provider_metadata.go index ad6bab51aca..1e8e5e887e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_service_provider_metadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.security.saml_service_provider_metadata.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSecuritySamlServiceProviderMetadataFunc(t Transport) SecuritySamlService // SecuritySamlServiceProviderMetadata - Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html. +// type SecuritySamlServiceProviderMetadata func(realm_name string, o ...func(*SecuritySamlServiceProviderMetadataRequest)) (*Response, error) // SecuritySamlServiceProviderMetadataRequest configures the Security Saml Service Provider Metadata API request. +// type SecuritySamlServiceProviderMetadataRequest struct { RealmName string @@ -57,6 +59,7 @@ type SecuritySamlServiceProviderMetadataRequest struct { } // Do executes the request and returns response or error. +// func (r SecuritySamlServiceProviderMetadataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SecuritySamlServiceProviderMetadataRequest) Do(ctx context.Context, tran } // WithContext sets the request context. +// func (f SecuritySamlServiceProviderMetadata) WithContext(v context.Context) func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SecuritySamlServiceProviderMetadata) WithContext(v context.Context) func } // WithPretty makes the response body pretty-printed. +// func (f SecuritySamlServiceProviderMetadata) WithPretty() func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f SecuritySamlServiceProviderMetadata) WithPretty() func(*SecuritySamlServ } // WithHuman makes statistical values human-readable. +// func (f SecuritySamlServiceProviderMetadata) WithHuman() func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f SecuritySamlServiceProviderMetadata) WithHuman() func(*SecuritySamlServi } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SecuritySamlServiceProviderMetadata) WithErrorTrace() func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f SecuritySamlServiceProviderMetadata) WithErrorTrace() func(*SecuritySaml } // WithFilterPath filters the properties of the response body. +// func (f SecuritySamlServiceProviderMetadata) WithFilterPath(v ...string) func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f SecuritySamlServiceProviderMetadata) WithFilterPath(v ...string) func(*S } // WithHeader adds the headers to the HTTP request. +// func (f SecuritySamlServiceProviderMetadata) WithHeader(h map[string]string) func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f SecuritySamlServiceProviderMetadata) WithHeader(h map[string]string) fun } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SecuritySamlServiceProviderMetadata) WithOpaqueID(s string) func(*SecuritySamlServiceProviderMetadataRequest) { return func(r *SecuritySamlServiceProviderMetadataRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.delete_lifecycle.go index 105f974266f..2505531e191 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.delete_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmDeleteLifecycleFunc(t Transport) SlmDeleteLifecycle { // SlmDeleteLifecycle - Deletes an existing snapshot lifecycle policy. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html. +// type SlmDeleteLifecycle func(policy_id string, o ...func(*SlmDeleteLifecycleRequest)) (*Response, error) // SlmDeleteLifecycleRequest configures the Slm Delete Lifecycle API request. +// type SlmDeleteLifecycleRequest struct { PolicyID string @@ -57,6 +59,7 @@ type SlmDeleteLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SlmDeleteLifecycle) WithContext(v context.Context) func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SlmDeleteLifecycle) WithContext(v context.Context) func(*SlmDeleteLifecy } // WithPretty makes the response body pretty-printed. +// func (f SlmDeleteLifecycle) WithPretty() func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SlmDeleteLifecycle) WithPretty() func(*SlmDeleteLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmDeleteLifecycle) WithHuman() func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SlmDeleteLifecycle) WithHuman() func(*SlmDeleteLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmDeleteLifecycle) WithErrorTrace() func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SlmDeleteLifecycle) WithErrorTrace() func(*SlmDeleteLifecycleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmDeleteLifecycle) WithFilterPath(v ...string) func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SlmDeleteLifecycle) WithFilterPath(v ...string) func(*SlmDeleteLifecycle } // WithHeader adds the headers to the HTTP request. +// func (f SlmDeleteLifecycle) WithHeader(h map[string]string) func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SlmDeleteLifecycle) WithHeader(h map[string]string) func(*SlmDeleteLifec } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmDeleteLifecycle) WithOpaqueID(s string) func(*SlmDeleteLifecycleRequest) { return func(r *SlmDeleteLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_lifecycle.go index f35a05c26d8..788f4bdb5c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmExecuteLifecycleFunc(t Transport) SlmExecuteLifecycle { // SlmExecuteLifecycle - Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html. +// type SlmExecuteLifecycle func(policy_id string, o ...func(*SlmExecuteLifecycleRequest)) (*Response, error) // SlmExecuteLifecycleRequest configures the Slm Execute Lifecycle API request. +// type SlmExecuteLifecycleRequest struct { PolicyID string @@ -57,6 +59,7 @@ type SlmExecuteLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SlmExecuteLifecycle) WithContext(v context.Context) func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SlmExecuteLifecycle) WithContext(v context.Context) func(*SlmExecuteLife } // WithPretty makes the response body pretty-printed. +// func (f SlmExecuteLifecycle) WithPretty() func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f SlmExecuteLifecycle) WithPretty() func(*SlmExecuteLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmExecuteLifecycle) WithHuman() func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f SlmExecuteLifecycle) WithHuman() func(*SlmExecuteLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmExecuteLifecycle) WithErrorTrace() func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f SlmExecuteLifecycle) WithErrorTrace() func(*SlmExecuteLifecycleRequest) } // WithFilterPath filters the properties of the response body. +// func (f SlmExecuteLifecycle) WithFilterPath(v ...string) func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f SlmExecuteLifecycle) WithFilterPath(v ...string) func(*SlmExecuteLifecyc } // WithHeader adds the headers to the HTTP request. +// func (f SlmExecuteLifecycle) WithHeader(h map[string]string) func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f SlmExecuteLifecycle) WithHeader(h map[string]string) func(*SlmExecuteLif } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmExecuteLifecycle) WithOpaqueID(s string) func(*SlmExecuteLifecycleRequest) { return func(r *SlmExecuteLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_retention.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_retention.go index dd1eea8dc6b..b1a08af1fa1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_retention.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.execute_retention.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmExecuteRetentionFunc(t Transport) SlmExecuteRetention { // SlmExecuteRetention - Deletes any snapshots that are expired according to the policy's retention rules. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html. +// type SlmExecuteRetention func(o ...func(*SlmExecuteRetentionRequest)) (*Response, error) // SlmExecuteRetentionRequest configures the Slm Execute Retention API request. +// type SlmExecuteRetentionRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SlmExecuteRetentionRequest struct { } // Do executes the request and returns response or error. +// func (r SlmExecuteRetentionRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SlmExecuteRetentionRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f SlmExecuteRetention) WithContext(v context.Context) func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SlmExecuteRetention) WithContext(v context.Context) func(*SlmExecuteRete } // WithPretty makes the response body pretty-printed. +// func (f SlmExecuteRetention) WithPretty() func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SlmExecuteRetention) WithPretty() func(*SlmExecuteRetentionRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmExecuteRetention) WithHuman() func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SlmExecuteRetention) WithHuman() func(*SlmExecuteRetentionRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmExecuteRetention) WithErrorTrace() func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SlmExecuteRetention) WithErrorTrace() func(*SlmExecuteRetentionRequest) } // WithFilterPath filters the properties of the response body. +// func (f SlmExecuteRetention) WithFilterPath(v ...string) func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SlmExecuteRetention) WithFilterPath(v ...string) func(*SlmExecuteRetenti } // WithHeader adds the headers to the HTTP request. +// func (f SlmExecuteRetention) WithHeader(h map[string]string) func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SlmExecuteRetention) WithHeader(h map[string]string) func(*SlmExecuteRet } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmExecuteRetention) WithOpaqueID(s string) func(*SlmExecuteRetentionRequest) { return func(r *SlmExecuteRetentionRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_lifecycle.go index 0c5264c00e5..778215b039b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmGetLifecycleFunc(t Transport) SlmGetLifecycle { // SlmGetLifecycle - Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html. +// type SlmGetLifecycle func(o ...func(*SlmGetLifecycleRequest)) (*Response, error) // SlmGetLifecycleRequest configures the Slm Get Lifecycle API request. +// type SlmGetLifecycleRequest struct { PolicyID []string @@ -57,6 +59,7 @@ type SlmGetLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SlmGetLifecycle) WithContext(v context.Context) func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SlmGetLifecycle) WithContext(v context.Context) func(*SlmGetLifecycleReq } // WithPolicyID - comma-separated list of snapshot lifecycle policies to retrieve. +// func (f SlmGetLifecycle) WithPolicyID(v ...string) func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.PolicyID = v @@ -152,6 +157,7 @@ func (f SlmGetLifecycle) WithPolicyID(v ...string) func(*SlmGetLifecycleRequest) } // WithPretty makes the response body pretty-printed. +// func (f SlmGetLifecycle) WithPretty() func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.Pretty = true @@ -159,6 +165,7 @@ func (f SlmGetLifecycle) WithPretty() func(*SlmGetLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmGetLifecycle) WithHuman() func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.Human = true @@ -166,6 +173,7 @@ func (f SlmGetLifecycle) WithHuman() func(*SlmGetLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmGetLifecycle) WithErrorTrace() func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.ErrorTrace = true @@ -173,6 +181,7 @@ func (f SlmGetLifecycle) WithErrorTrace() func(*SlmGetLifecycleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmGetLifecycle) WithFilterPath(v ...string) func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.FilterPath = v @@ -180,6 +189,7 @@ func (f SlmGetLifecycle) WithFilterPath(v ...string) func(*SlmGetLifecycleReques } // WithHeader adds the headers to the HTTP request. +// func (f SlmGetLifecycle) WithHeader(h map[string]string) func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { if r.Header == nil { @@ -192,6 +202,7 @@ func (f SlmGetLifecycle) WithHeader(h map[string]string) func(*SlmGetLifecycleRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmGetLifecycle) WithOpaqueID(s string) func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_stats.go index b70e004d6d2..e0e4bd00261 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmGetStatsFunc(t Transport) SlmGetStats { // SlmGetStats - Returns global and policy-level statistics about actions taken by snapshot lifecycle management. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html. +// type SlmGetStats func(o ...func(*SlmGetStatsRequest)) (*Response, error) // SlmGetStatsRequest configures the Slm Get Stats API request. +// type SlmGetStatsRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SlmGetStatsRequest struct { } // Do executes the request and returns response or error. +// func (r SlmGetStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SlmGetStatsRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f SlmGetStats) WithContext(v context.Context) func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SlmGetStats) WithContext(v context.Context) func(*SlmGetStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SlmGetStats) WithPretty() func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SlmGetStats) WithPretty() func(*SlmGetStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmGetStats) WithHuman() func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SlmGetStats) WithHuman() func(*SlmGetStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmGetStats) WithErrorTrace() func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SlmGetStats) WithErrorTrace() func(*SlmGetStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmGetStats) WithFilterPath(v ...string) func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SlmGetStats) WithFilterPath(v ...string) func(*SlmGetStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SlmGetStats) WithHeader(h map[string]string) func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SlmGetStats) WithHeader(h map[string]string) func(*SlmGetStatsRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmGetStats) WithOpaqueID(s string) func(*SlmGetStatsRequest) { return func(r *SlmGetStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_status.go index a15879e7c9f..c193c46e416 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.get_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmGetStatusFunc(t Transport) SlmGetStatus { // SlmGetStatus - Retrieves the status of snapshot lifecycle management (SLM). // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html. +// type SlmGetStatus func(o ...func(*SlmGetStatusRequest)) (*Response, error) // SlmGetStatusRequest configures the Slm Get Status API request. +// type SlmGetStatusRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SlmGetStatusRequest struct { } // Do executes the request and returns response or error. +// func (r SlmGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SlmGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f SlmGetStatus) WithContext(v context.Context) func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SlmGetStatus) WithContext(v context.Context) func(*SlmGetStatusRequest) } // WithPretty makes the response body pretty-printed. +// func (f SlmGetStatus) WithPretty() func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SlmGetStatus) WithPretty() func(*SlmGetStatusRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmGetStatus) WithHuman() func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SlmGetStatus) WithHuman() func(*SlmGetStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmGetStatus) WithErrorTrace() func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SlmGetStatus) WithErrorTrace() func(*SlmGetStatusRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmGetStatus) WithFilterPath(v ...string) func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SlmGetStatus) WithFilterPath(v ...string) func(*SlmGetStatusRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SlmGetStatus) WithHeader(h map[string]string) func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SlmGetStatus) WithHeader(h map[string]string) func(*SlmGetStatusRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmGetStatus) WithOpaqueID(s string) func(*SlmGetStatusRequest) { return func(r *SlmGetStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.put_lifecycle.go index faff25bd58a..e1561ed96f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.put_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSlmPutLifecycleFunc(t Transport) SlmPutLifecycle { // SlmPutLifecycle - Creates or updates a snapshot lifecycle policy. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html. +// type SlmPutLifecycle func(policy_id string, o ...func(*SlmPutLifecycleRequest)) (*Response, error) // SlmPutLifecycleRequest configures the Slm Put Lifecycle API request. +// type SlmPutLifecycleRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type SlmPutLifecycleRequest struct { } // Do executes the request and returns response or error. +// func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +111,10 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -120,10 +127,6 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -143,6 +146,7 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SlmPutLifecycle) WithContext(v context.Context) func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f SlmPutLifecycle) WithContext(v context.Context) func(*SlmPutLifecycleReq } // WithBody - The snapshot lifecycle policy definition to register. +// func (f SlmPutLifecycle) WithBody(v io.Reader) func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { r.Body = v @@ -157,6 +162,7 @@ func (f SlmPutLifecycle) WithBody(v io.Reader) func(*SlmPutLifecycleRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SlmPutLifecycle) WithPretty() func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f SlmPutLifecycle) WithPretty() func(*SlmPutLifecycleRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmPutLifecycle) WithHuman() func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f SlmPutLifecycle) WithHuman() func(*SlmPutLifecycleRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmPutLifecycle) WithErrorTrace() func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f SlmPutLifecycle) WithErrorTrace() func(*SlmPutLifecycleRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmPutLifecycle) WithFilterPath(v ...string) func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f SlmPutLifecycle) WithFilterPath(v ...string) func(*SlmPutLifecycleReques } // WithHeader adds the headers to the HTTP request. +// func (f SlmPutLifecycle) WithHeader(h map[string]string) func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f SlmPutLifecycle) WithHeader(h map[string]string) func(*SlmPutLifecycleRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmPutLifecycle) WithOpaqueID(s string) func(*SlmPutLifecycleRequest) { return func(r *SlmPutLifecycleRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.start.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.start.go index 68f722e9f7d..26fb4a0d195 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.start.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmStartFunc(t Transport) SlmStart { // SlmStart - Turns on snapshot lifecycle management (SLM). // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html. +// type SlmStart func(o ...func(*SlmStartRequest)) (*Response, error) // SlmStartRequest configures the Slm Start API request. +// type SlmStartRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SlmStartRequest struct { } // Do executes the request and returns response or error. +// func (r SlmStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SlmStartRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f SlmStart) WithContext(v context.Context) func(*SlmStartRequest) { return func(r *SlmStartRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SlmStart) WithContext(v context.Context) func(*SlmStartRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SlmStart) WithPretty() func(*SlmStartRequest) { return func(r *SlmStartRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SlmStart) WithPretty() func(*SlmStartRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmStart) WithHuman() func(*SlmStartRequest) { return func(r *SlmStartRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SlmStart) WithHuman() func(*SlmStartRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmStart) WithErrorTrace() func(*SlmStartRequest) { return func(r *SlmStartRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SlmStart) WithErrorTrace() func(*SlmStartRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmStart) WithFilterPath(v ...string) func(*SlmStartRequest) { return func(r *SlmStartRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SlmStart) WithFilterPath(v ...string) func(*SlmStartRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SlmStart) WithHeader(h map[string]string) func(*SlmStartRequest) { return func(r *SlmStartRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SlmStart) WithHeader(h map[string]string) func(*SlmStartRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmStart) WithOpaqueID(s string) func(*SlmStartRequest) { return func(r *SlmStartRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.stop.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.stop.go index 5ff4ce66893..973e407493b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.slm.stop.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSlmStopFunc(t Transport) SlmStop { // SlmStop - Turns off snapshot lifecycle management (SLM). // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html. +// type SlmStop func(o ...func(*SlmStopRequest)) (*Response, error) // SlmStopRequest configures the Slm Stop API request. +// type SlmStopRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SlmStopRequest struct { } // Do executes the request and returns response or error. +// func (r SlmStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SlmStopRequest) Do(ctx context.Context, transport Transport) (*Response, } // WithContext sets the request context. +// func (f SlmStop) WithContext(v context.Context) func(*SlmStopRequest) { return func(r *SlmStopRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SlmStop) WithContext(v context.Context) func(*SlmStopRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SlmStop) WithPretty() func(*SlmStopRequest) { return func(r *SlmStopRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SlmStop) WithPretty() func(*SlmStopRequest) { } // WithHuman makes statistical values human-readable. +// func (f SlmStop) WithHuman() func(*SlmStopRequest) { return func(r *SlmStopRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SlmStop) WithHuman() func(*SlmStopRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SlmStop) WithErrorTrace() func(*SlmStopRequest) { return func(r *SlmStopRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SlmStop) WithErrorTrace() func(*SlmStopRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SlmStop) WithFilterPath(v ...string) func(*SlmStopRequest) { return func(r *SlmStopRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SlmStop) WithFilterPath(v ...string) func(*SlmStopRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SlmStop) WithHeader(h map[string]string) func(*SlmStopRequest) { return func(r *SlmStopRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SlmStop) WithHeader(h map[string]string) func(*SlmStopRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SlmStop) WithOpaqueID(s string) func(*SlmStopRequest) { return func(r *SlmStopRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.clear_cursor.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.clear_cursor.go index c8d7ef3aaf8..35b1b9a5a90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.clear_cursor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.clear_cursor.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSQLClearCursorFunc(t Transport) SQLClearCursor { // SQLClearCursor - Clears the SQL cursor // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html. +// type SQLClearCursor func(body io.Reader, o ...func(*SQLClearCursorRequest)) (*Response, error) // SQLClearCursorRequest configures the SQL Clear Cursor API request. +// type SQLClearCursorRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SQLClearCursorRequest struct { } // Do executes the request and returns response or error. +// func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Re 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 @@ -113,10 +120,6 @@ func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Re } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f SQLClearCursor) WithContext(v context.Context) func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SQLClearCursor) WithContext(v context.Context) func(*SQLClearCursorReque } // WithPretty makes the response body pretty-printed. +// func (f SQLClearCursor) WithPretty() func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SQLClearCursor) WithPretty() func(*SQLClearCursorRequest) { } // WithHuman makes statistical values human-readable. +// func (f SQLClearCursor) WithHuman() func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SQLClearCursor) WithHuman() func(*SQLClearCursorRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SQLClearCursor) WithErrorTrace() func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SQLClearCursor) WithErrorTrace() func(*SQLClearCursorRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SQLClearCursor) WithFilterPath(v ...string) func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SQLClearCursor) WithFilterPath(v ...string) func(*SQLClearCursorRequest) } // WithHeader adds the headers to the HTTP request. +// func (f SQLClearCursor) WithHeader(h map[string]string) func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SQLClearCursor) WithHeader(h map[string]string) func(*SQLClearCursorRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SQLClearCursor) WithOpaqueID(s string) func(*SQLClearCursorRequest) { return func(r *SQLClearCursorRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.delete_async.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.delete_async.go index 2240be5029b..8beb1e69215 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.delete_async.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.delete_async.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSQLDeleteAsyncFunc(t Transport) SQLDeleteAsync { // SQLDeleteAsync - Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html. +// type SQLDeleteAsync func(id string, o ...func(*SQLDeleteAsyncRequest)) (*Response, error) // SQLDeleteAsyncRequest configures the SQL Delete Async API request. +// type SQLDeleteAsyncRequest struct { DocumentID string @@ -57,6 +59,7 @@ type SQLDeleteAsyncRequest struct { } // Do executes the request and returns response or error. +// func (r SQLDeleteAsyncRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SQLDeleteAsyncRequest) Do(ctx context.Context, transport Transport) (*Re } // WithContext sets the request context. +// func (f SQLDeleteAsync) WithContext(v context.Context) func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SQLDeleteAsync) WithContext(v context.Context) func(*SQLDeleteAsyncReque } // WithPretty makes the response body pretty-printed. +// func (f SQLDeleteAsync) WithPretty() func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f SQLDeleteAsync) WithPretty() func(*SQLDeleteAsyncRequest) { } // WithHuman makes statistical values human-readable. +// func (f SQLDeleteAsync) WithHuman() func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f SQLDeleteAsync) WithHuman() func(*SQLDeleteAsyncRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SQLDeleteAsync) WithErrorTrace() func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f SQLDeleteAsync) WithErrorTrace() func(*SQLDeleteAsyncRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SQLDeleteAsync) WithFilterPath(v ...string) func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f SQLDeleteAsync) WithFilterPath(v ...string) func(*SQLDeleteAsyncRequest) } // WithHeader adds the headers to the HTTP request. +// func (f SQLDeleteAsync) WithHeader(h map[string]string) func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f SQLDeleteAsync) WithHeader(h map[string]string) func(*SQLDeleteAsyncRequ } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SQLDeleteAsync) WithOpaqueID(s string) func(*SQLDeleteAsyncRequest) { return func(r *SQLDeleteAsyncRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async.go index c1b9e0211e4..224e79fd240 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSQLGetAsyncFunc(t Transport) SQLGetAsync { // SQLGetAsync - Returns the current status and available results for an async SQL search or stored synchronous SQL search // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html. +// type SQLGetAsync func(id string, o ...func(*SQLGetAsyncRequest)) (*Response, error) // SQLGetAsyncRequest configures the SQL Get Async API request. +// type SQLGetAsyncRequest struct { DocumentID string @@ -63,6 +65,7 @@ type SQLGetAsyncRequest struct { } // Do executes the request and returns response or error. +// func (r SQLGetAsyncRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r SQLGetAsyncRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f SQLGetAsync) WithContext(v context.Context) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f SQLGetAsync) WithContext(v context.Context) func(*SQLGetAsyncRequest) { } // WithDelimiter - separator for csv results. +// func (f SQLGetAsync) WithDelimiter(v string) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.Delimiter = v @@ -172,6 +177,7 @@ func (f SQLGetAsync) WithDelimiter(v string) func(*SQLGetAsyncRequest) { } // WithFormat - short version of the accept header, e.g. json, yaml. +// func (f SQLGetAsync) WithFormat(v string) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.Format = v @@ -179,6 +185,7 @@ func (f SQLGetAsync) WithFormat(v string) func(*SQLGetAsyncRequest) { } // WithKeepAlive - retention period for the search and its results. +// func (f SQLGetAsync) WithKeepAlive(v time.Duration) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.KeepAlive = v @@ -186,6 +193,7 @@ func (f SQLGetAsync) WithKeepAlive(v time.Duration) func(*SQLGetAsyncRequest) { } // WithWaitForCompletionTimeout - duration to wait for complete results. +// func (f SQLGetAsync) WithWaitForCompletionTimeout(v time.Duration) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.WaitForCompletionTimeout = v @@ -193,6 +201,7 @@ func (f SQLGetAsync) WithWaitForCompletionTimeout(v time.Duration) func(*SQLGetA } // WithPretty makes the response body pretty-printed. +// func (f SQLGetAsync) WithPretty() func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.Pretty = true @@ -200,6 +209,7 @@ func (f SQLGetAsync) WithPretty() func(*SQLGetAsyncRequest) { } // WithHuman makes statistical values human-readable. +// func (f SQLGetAsync) WithHuman() func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.Human = true @@ -207,6 +217,7 @@ func (f SQLGetAsync) WithHuman() func(*SQLGetAsyncRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SQLGetAsync) WithErrorTrace() func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.ErrorTrace = true @@ -214,6 +225,7 @@ func (f SQLGetAsync) WithErrorTrace() func(*SQLGetAsyncRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SQLGetAsync) WithFilterPath(v ...string) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { r.FilterPath = v @@ -221,6 +233,7 @@ func (f SQLGetAsync) WithFilterPath(v ...string) func(*SQLGetAsyncRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SQLGetAsync) WithHeader(h map[string]string) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { if r.Header == nil { @@ -233,6 +246,7 @@ func (f SQLGetAsync) WithHeader(h map[string]string) func(*SQLGetAsyncRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SQLGetAsync) WithOpaqueID(s string) func(*SQLGetAsyncRequest) { return func(r *SQLGetAsyncRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async_status.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async_status.go index f1030baf51a..7bd4d30f14b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.get_async_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSQLGetAsyncStatusFunc(t Transport) SQLGetAsyncStatus { // SQLGetAsyncStatus - Returns the current status of an async SQL search or a stored synchronous SQL search // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html. +// type SQLGetAsyncStatus func(id string, o ...func(*SQLGetAsyncStatusRequest)) (*Response, error) // SQLGetAsyncStatusRequest configures the SQL Get Async Status API request. +// type SQLGetAsyncStatusRequest struct { DocumentID string @@ -57,6 +59,7 @@ type SQLGetAsyncStatusRequest struct { } // Do executes the request and returns response or error. +// func (r SQLGetAsyncStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r SQLGetAsyncStatusRequest) Do(ctx context.Context, transport Transport) ( } // WithContext sets the request context. +// func (f SQLGetAsyncStatus) WithContext(v context.Context) func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f SQLGetAsyncStatus) WithContext(v context.Context) func(*SQLGetAsyncStatu } // WithPretty makes the response body pretty-printed. +// func (f SQLGetAsyncStatus) WithPretty() func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f SQLGetAsyncStatus) WithPretty() func(*SQLGetAsyncStatusRequest) { } // WithHuman makes statistical values human-readable. +// func (f SQLGetAsyncStatus) WithHuman() func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f SQLGetAsyncStatus) WithHuman() func(*SQLGetAsyncStatusRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SQLGetAsyncStatus) WithErrorTrace() func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f SQLGetAsyncStatus) WithErrorTrace() func(*SQLGetAsyncStatusRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SQLGetAsyncStatus) WithFilterPath(v ...string) func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f SQLGetAsyncStatus) WithFilterPath(v ...string) func(*SQLGetAsyncStatusRe } // WithHeader adds the headers to the HTTP request. +// func (f SQLGetAsyncStatus) WithHeader(h map[string]string) func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f SQLGetAsyncStatus) WithHeader(h map[string]string) func(*SQLGetAsyncStat } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SQLGetAsyncStatus) WithOpaqueID(s string) func(*SQLGetAsyncStatusRequest) { return func(r *SQLGetAsyncStatusRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.query.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.query.go index 0d172dce7b0..ed77654520a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSQLQueryFunc(t Transport) SQLQuery { // SQLQuery - Executes a SQL request // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html. +// type SQLQuery func(body io.Reader, o ...func(*SQLQueryRequest)) (*Response, error) // SQLQueryRequest configures the SQL Query API request. +// type SQLQueryRequest struct { Body io.Reader @@ -60,6 +62,7 @@ type SQLQueryRequest struct { } // Do executes the request and returns response or error. +// func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -107,6 +110,10 @@ func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response 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 @@ -119,10 +126,6 @@ func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -142,6 +145,7 @@ func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response } // WithContext sets the request context. +// func (f SQLQuery) WithContext(v context.Context) func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f SQLQuery) WithContext(v context.Context) func(*SQLQueryRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. +// func (f SQLQuery) WithFormat(v string) func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.Format = v @@ -156,6 +161,7 @@ func (f SQLQuery) WithFormat(v string) func(*SQLQueryRequest) { } // WithPretty makes the response body pretty-printed. +// func (f SQLQuery) WithPretty() func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.Pretty = true @@ -163,6 +169,7 @@ func (f SQLQuery) WithPretty() func(*SQLQueryRequest) { } // WithHuman makes statistical values human-readable. +// func (f SQLQuery) WithHuman() func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.Human = true @@ -170,6 +177,7 @@ func (f SQLQuery) WithHuman() func(*SQLQueryRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SQLQuery) WithErrorTrace() func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.ErrorTrace = true @@ -177,6 +185,7 @@ func (f SQLQuery) WithErrorTrace() func(*SQLQueryRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SQLQuery) WithFilterPath(v ...string) func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.FilterPath = v @@ -184,6 +193,7 @@ func (f SQLQuery) WithFilterPath(v ...string) func(*SQLQueryRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SQLQuery) WithHeader(h map[string]string) func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { if r.Header == nil { @@ -196,6 +206,7 @@ func (f SQLQuery) WithHeader(h map[string]string) func(*SQLQueryRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SQLQuery) WithOpaqueID(s string) func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.translate.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.translate.go index 5449e542aec..997e7275e4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.translate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.sql.translate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newSQLTranslateFunc(t Transport) SQLTranslate { // SQLTranslate - Translates SQL into Elasticsearch queries // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html. +// type SQLTranslate func(body io.Reader, o ...func(*SQLTranslateRequest)) (*Response, error) // SQLTranslateRequest configures the SQL Translate API request. +// type SQLTranslateRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type SQLTranslateRequest struct { } // Do executes the request and returns response or error. +// func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Resp 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 @@ -113,10 +120,6 @@ func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Resp } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f SQLTranslate) WithContext(v context.Context) func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f SQLTranslate) WithContext(v context.Context) func(*SQLTranslateRequest) } // WithPretty makes the response body pretty-printed. +// func (f SQLTranslate) WithPretty() func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f SQLTranslate) WithPretty() func(*SQLTranslateRequest) { } // WithHuman makes statistical values human-readable. +// func (f SQLTranslate) WithHuman() func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f SQLTranslate) WithHuman() func(*SQLTranslateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SQLTranslate) WithErrorTrace() func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f SQLTranslate) WithErrorTrace() func(*SQLTranslateRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SQLTranslate) WithFilterPath(v ...string) func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f SQLTranslate) WithFilterPath(v ...string) func(*SQLTranslateRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f SQLTranslate) WithHeader(h map[string]string) func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f SQLTranslate) WithHeader(h map[string]string) func(*SQLTranslateRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SQLTranslate) WithOpaqueID(s string) func(*SQLTranslateRequest) { return func(r *SQLTranslateRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ssl.certificates.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ssl.certificates.go index 13397aa4742..c3d38621269 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ssl.certificates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.ssl.certificates.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newSSLCertificatesFunc(t Transport) SSLCertificates { // SSLCertificates - Retrieves information about the X.509 certificates used to encrypt communications in the cluster. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html. +// type SSLCertificates func(o ...func(*SSLCertificatesRequest)) (*Response, error) // SSLCertificatesRequest configures the SSL Certificates API request. +// type SSLCertificatesRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type SSLCertificatesRequest struct { } // Do executes the request and returns response or error. +// func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f SSLCertificates) WithContext(v context.Context) func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f SSLCertificates) WithContext(v context.Context) func(*SSLCertificatesReq } // WithPretty makes the response body pretty-printed. +// func (f SSLCertificates) WithPretty() func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f SSLCertificates) WithPretty() func(*SSLCertificatesRequest) { } // WithHuman makes statistical values human-readable. +// func (f SSLCertificates) WithHuman() func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f SSLCertificates) WithHuman() func(*SSLCertificatesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f SSLCertificates) WithErrorTrace() func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f SSLCertificates) WithErrorTrace() func(*SSLCertificatesRequest) { } // WithFilterPath filters the properties of the response body. +// func (f SSLCertificates) WithFilterPath(v ...string) func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f SSLCertificates) WithFilterPath(v ...string) func(*SSLCertificatesReques } // WithHeader adds the headers to the HTTP request. +// func (f SSLCertificates) WithHeader(h map[string]string) func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f SSLCertificates) WithHeader(h map[string]string) func(*SSLCertificatesRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f SSLCertificates) WithOpaqueID(s string) func(*SSLCertificatesRequest) { return func(r *SSLCertificatesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.text_structure.find_structure.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.text_structure.find_structure.go index 2df5a950327..ec2c8a2ab37 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.text_structure.find_structure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.text_structure.find_structure.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newTextStructureFindStructureFunc(t Transport) TextStructureFindStructure { // TextStructureFindStructure - Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html. +// type TextStructureFindStructure func(body io.Reader, o ...func(*TextStructureFindStructureRequest)) (*Response, error) // TextStructureFindStructureRequest configures the Text Structure Find Structure API request. +// type TextStructureFindStructureRequest struct { Body io.Reader @@ -75,6 +77,7 @@ type TextStructureFindStructureRequest struct { } // Do executes the request and returns response or error. +// func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -174,6 +177,10 @@ func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Tra 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 @@ -186,10 +193,6 @@ func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Tra } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -209,6 +212,7 @@ func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f TextStructureFindStructure) WithContext(v context.Context) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.ctx = v @@ -216,6 +220,7 @@ func (f TextStructureFindStructure) WithContext(v context.Context) func(*TextStr } // WithCharset - optional parameter to specify the character set of the file. +// func (f TextStructureFindStructure) WithCharset(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Charset = v @@ -223,6 +228,7 @@ func (f TextStructureFindStructure) WithCharset(v string) func(*TextStructureFin } // WithColumnNames - optional parameter containing a comma separated list of the column names for a delimited file. +// func (f TextStructureFindStructure) WithColumnNames(v ...string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.ColumnNames = v @@ -230,6 +236,7 @@ func (f TextStructureFindStructure) WithColumnNames(v ...string) func(*TextStruc } // WithDelimiter - optional parameter to specify the delimiter character for a delimited file - must be a single character. +// func (f TextStructureFindStructure) WithDelimiter(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Delimiter = v @@ -237,6 +244,7 @@ func (f TextStructureFindStructure) WithDelimiter(v string) func(*TextStructureF } // WithExplain - whether to include a commentary on how the structure was derived. +// func (f TextStructureFindStructure) WithExplain(v bool) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Explain = &v @@ -244,6 +252,7 @@ func (f TextStructureFindStructure) WithExplain(v bool) func(*TextStructureFindS } // WithFormat - optional parameter to specify the high level file format. +// func (f TextStructureFindStructure) WithFormat(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Format = v @@ -251,6 +260,7 @@ func (f TextStructureFindStructure) WithFormat(v string) func(*TextStructureFind } // WithGrokPattern - optional parameter to specify the grok pattern that should be used to extract fields from messages in a semi-structured text file. +// func (f TextStructureFindStructure) WithGrokPattern(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.GrokPattern = v @@ -258,6 +268,7 @@ func (f TextStructureFindStructure) WithGrokPattern(v string) func(*TextStructur } // WithHasHeaderRow - optional parameter to specify whether a delimited file includes the column names in its first row. +// func (f TextStructureFindStructure) WithHasHeaderRow(v bool) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.HasHeaderRow = &v @@ -265,6 +276,7 @@ func (f TextStructureFindStructure) WithHasHeaderRow(v bool) func(*TextStructure } // WithLineMergeSizeLimit - maximum number of characters permitted in a single message when lines are merged to create messages.. +// func (f TextStructureFindStructure) WithLineMergeSizeLimit(v int) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.LineMergeSizeLimit = &v @@ -272,6 +284,7 @@ func (f TextStructureFindStructure) WithLineMergeSizeLimit(v int) func(*TextStru } // WithLinesToSample - how many lines of the file should be included in the analysis. +// func (f TextStructureFindStructure) WithLinesToSample(v int) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.LinesToSample = &v @@ -279,6 +292,7 @@ func (f TextStructureFindStructure) WithLinesToSample(v int) func(*TextStructure } // WithQuote - optional parameter to specify the quote character for a delimited file - must be a single character. +// func (f TextStructureFindStructure) WithQuote(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Quote = v @@ -286,6 +300,7 @@ func (f TextStructureFindStructure) WithQuote(v string) func(*TextStructureFindS } // WithShouldTrimFields - optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them. +// func (f TextStructureFindStructure) WithShouldTrimFields(v bool) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.ShouldTrimFields = &v @@ -293,6 +308,7 @@ func (f TextStructureFindStructure) WithShouldTrimFields(v bool) func(*TextStruc } // WithTimeout - timeout after which the analysis will be aborted. +// func (f TextStructureFindStructure) WithTimeout(v time.Duration) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Timeout = v @@ -300,6 +316,7 @@ func (f TextStructureFindStructure) WithTimeout(v time.Duration) func(*TextStruc } // WithTimestampField - optional parameter to specify the timestamp field in the file. +// func (f TextStructureFindStructure) WithTimestampField(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.TimestampField = v @@ -307,6 +324,7 @@ func (f TextStructureFindStructure) WithTimestampField(v string) func(*TextStruc } // WithTimestampFormat - optional parameter to specify the timestamp format in the file - may be either a joda or java time format. +// func (f TextStructureFindStructure) WithTimestampFormat(v string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.TimestampFormat = v @@ -314,6 +332,7 @@ func (f TextStructureFindStructure) WithTimestampFormat(v string) func(*TextStru } // WithPretty makes the response body pretty-printed. +// func (f TextStructureFindStructure) WithPretty() func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Pretty = true @@ -321,6 +340,7 @@ func (f TextStructureFindStructure) WithPretty() func(*TextStructureFindStructur } // WithHuman makes statistical values human-readable. +// func (f TextStructureFindStructure) WithHuman() func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.Human = true @@ -328,6 +348,7 @@ func (f TextStructureFindStructure) WithHuman() func(*TextStructureFindStructure } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TextStructureFindStructure) WithErrorTrace() func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.ErrorTrace = true @@ -335,6 +356,7 @@ func (f TextStructureFindStructure) WithErrorTrace() func(*TextStructureFindStru } // WithFilterPath filters the properties of the response body. +// func (f TextStructureFindStructure) WithFilterPath(v ...string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { r.FilterPath = v @@ -342,6 +364,7 @@ func (f TextStructureFindStructure) WithFilterPath(v ...string) func(*TextStruct } // WithHeader adds the headers to the HTTP request. +// func (f TextStructureFindStructure) WithHeader(h map[string]string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { if r.Header == nil { @@ -354,6 +377,7 @@ func (f TextStructureFindStructure) WithHeader(h map[string]string) func(*TextSt } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TextStructureFindStructure) WithOpaqueID(s string) func(*TextStructureFindStructureRequest) { return func(r *TextStructureFindStructureRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.delete_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.delete_transform.go index ff3e7eb5f52..b6d02db1433 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.delete_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.delete_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newTransformDeleteTransformFunc(t Transport) TransformDeleteTransform { // TransformDeleteTransform - Deletes an existing transform. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html. +// type TransformDeleteTransform func(transform_id string, o ...func(*TransformDeleteTransformRequest)) (*Response, error) // TransformDeleteTransformRequest configures the Transform Delete Transform API request. +// type TransformDeleteTransformRequest struct { TransformID string @@ -62,6 +64,7 @@ type TransformDeleteTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -147,6 +150,7 @@ func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f TransformDeleteTransform) WithContext(v context.Context) func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.ctx = v @@ -154,6 +158,7 @@ func (f TransformDeleteTransform) WithContext(v context.Context) func(*Transform } // WithForce - when `true`, the transform is deleted regardless of its current state. the default value is `false`, meaning that the transform must be `stopped` before it can be deleted.. +// func (f TransformDeleteTransform) WithForce(v bool) func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.Force = &v @@ -161,6 +166,7 @@ func (f TransformDeleteTransform) WithForce(v bool) func(*TransformDeleteTransfo } // WithTimeout - controls the time to wait for the transform deletion. +// func (f TransformDeleteTransform) WithTimeout(v time.Duration) func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.Timeout = v @@ -168,6 +174,7 @@ func (f TransformDeleteTransform) WithTimeout(v time.Duration) func(*TransformDe } // WithPretty makes the response body pretty-printed. +// func (f TransformDeleteTransform) WithPretty() func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.Pretty = true @@ -175,6 +182,7 @@ func (f TransformDeleteTransform) WithPretty() func(*TransformDeleteTransformReq } // WithHuman makes statistical values human-readable. +// func (f TransformDeleteTransform) WithHuman() func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.Human = true @@ -182,6 +190,7 @@ func (f TransformDeleteTransform) WithHuman() func(*TransformDeleteTransformRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformDeleteTransform) WithErrorTrace() func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.ErrorTrace = true @@ -189,6 +198,7 @@ func (f TransformDeleteTransform) WithErrorTrace() func(*TransformDeleteTransfor } // WithFilterPath filters the properties of the response body. +// func (f TransformDeleteTransform) WithFilterPath(v ...string) func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { r.FilterPath = v @@ -196,6 +206,7 @@ func (f TransformDeleteTransform) WithFilterPath(v ...string) func(*TransformDel } // WithHeader adds the headers to the HTTP request. +// func (f TransformDeleteTransform) WithHeader(h map[string]string) func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { if r.Header == nil { @@ -208,6 +219,7 @@ func (f TransformDeleteTransform) WithHeader(h map[string]string) func(*Transfor } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformDeleteTransform) WithOpaqueID(s string) func(*TransformDeleteTransformRequest) { return func(r *TransformDeleteTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform.go index edd14ede5b6..4753fc91b54 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newTransformGetTransformFunc(t Transport) TransformGetTransform { // TransformGetTransform - Retrieves configuration information for transforms. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html. +// type TransformGetTransform func(o ...func(*TransformGetTransformRequest)) (*Response, error) // TransformGetTransformRequest configures the Transform Get Transform API request. +// type TransformGetTransformRequest struct { TransformID string @@ -63,6 +65,7 @@ type TransformGetTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -158,6 +161,7 @@ func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f TransformGetTransform) WithContext(v context.Context) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.ctx = v @@ -165,6 +169,7 @@ func (f TransformGetTransform) WithContext(v context.Context) func(*TransformGet } // WithTransformID - the ID or comma delimited list of ID expressions of the transforms to get, '_all' or '*' implies get all transforms. +// func (f TransformGetTransform) WithTransformID(v string) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.TransformID = v @@ -172,6 +177,7 @@ func (f TransformGetTransform) WithTransformID(v string) func(*TransformGetTrans } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f TransformGetTransform) WithAllowNoMatch(v bool) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.AllowNoMatch = &v @@ -179,6 +185,7 @@ func (f TransformGetTransform) WithAllowNoMatch(v bool) func(*TransformGetTransf } // WithExcludeGenerated - omits fields that are illegal to set on transform put. +// func (f TransformGetTransform) WithExcludeGenerated(v bool) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.ExcludeGenerated = &v @@ -186,6 +193,7 @@ func (f TransformGetTransform) WithExcludeGenerated(v bool) func(*TransformGetTr } // WithFrom - skips a number of transform configs, defaults to 0. +// func (f TransformGetTransform) WithFrom(v int) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.From = &v @@ -193,6 +201,7 @@ func (f TransformGetTransform) WithFrom(v int) func(*TransformGetTransformReques } // WithSize - specifies a max number of transforms to get, defaults to 100. +// func (f TransformGetTransform) WithSize(v int) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.Size = &v @@ -200,6 +209,7 @@ func (f TransformGetTransform) WithSize(v int) func(*TransformGetTransformReques } // WithPretty makes the response body pretty-printed. +// func (f TransformGetTransform) WithPretty() func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.Pretty = true @@ -207,6 +217,7 @@ func (f TransformGetTransform) WithPretty() func(*TransformGetTransformRequest) } // WithHuman makes statistical values human-readable. +// func (f TransformGetTransform) WithHuman() func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.Human = true @@ -214,6 +225,7 @@ func (f TransformGetTransform) WithHuman() func(*TransformGetTransformRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformGetTransform) WithErrorTrace() func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.ErrorTrace = true @@ -221,6 +233,7 @@ func (f TransformGetTransform) WithErrorTrace() func(*TransformGetTransformReque } // WithFilterPath filters the properties of the response body. +// func (f TransformGetTransform) WithFilterPath(v ...string) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { r.FilterPath = v @@ -228,6 +241,7 @@ func (f TransformGetTransform) WithFilterPath(v ...string) func(*TransformGetTra } // WithHeader adds the headers to the HTTP request. +// func (f TransformGetTransform) WithHeader(h map[string]string) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { if r.Header == nil { @@ -240,6 +254,7 @@ func (f TransformGetTransform) WithHeader(h map[string]string) func(*TransformGe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformGetTransform) WithOpaqueID(s string) func(*TransformGetTransformRequest) { return func(r *TransformGetTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform_stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform_stats.go index bcf33e6f4d4..530eab1e0e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.get_transform_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newTransformGetTransformStatsFunc(t Transport) TransformGetTransformStats { // TransformGetTransformStats - Retrieves usage information for transforms. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html. +// type TransformGetTransformStats func(transform_id string, o ...func(*TransformGetTransformStatsRequest)) (*Response, error) // TransformGetTransformStatsRequest configures the Transform Get Transform Stats API request. +// type TransformGetTransformStatsRequest struct { TransformID string @@ -62,6 +64,7 @@ type TransformGetTransformStatsRequest struct { } // Do executes the request and returns response or error. +// func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -153,6 +156,7 @@ func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f TransformGetTransformStats) WithContext(v context.Context) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.ctx = v @@ -160,6 +164,7 @@ func (f TransformGetTransformStats) WithContext(v context.Context) func(*Transfo } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f TransformGetTransformStats) WithAllowNoMatch(v bool) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.AllowNoMatch = &v @@ -167,6 +172,7 @@ func (f TransformGetTransformStats) WithAllowNoMatch(v bool) func(*TransformGetT } // WithFrom - skips a number of transform stats, defaults to 0. +// func (f TransformGetTransformStats) WithFrom(v int) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.From = &v @@ -174,6 +180,7 @@ func (f TransformGetTransformStats) WithFrom(v int) func(*TransformGetTransformS } // WithSize - specifies a max number of transform stats to get, defaults to 100. +// func (f TransformGetTransformStats) WithSize(v int) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.Size = &v @@ -181,6 +188,7 @@ func (f TransformGetTransformStats) WithSize(v int) func(*TransformGetTransformS } // WithPretty makes the response body pretty-printed. +// func (f TransformGetTransformStats) WithPretty() func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.Pretty = true @@ -188,6 +196,7 @@ func (f TransformGetTransformStats) WithPretty() func(*TransformGetTransformStat } // WithHuman makes statistical values human-readable. +// func (f TransformGetTransformStats) WithHuman() func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.Human = true @@ -195,6 +204,7 @@ func (f TransformGetTransformStats) WithHuman() func(*TransformGetTransformStats } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformGetTransformStats) WithErrorTrace() func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.ErrorTrace = true @@ -202,6 +212,7 @@ func (f TransformGetTransformStats) WithErrorTrace() func(*TransformGetTransform } // WithFilterPath filters the properties of the response body. +// func (f TransformGetTransformStats) WithFilterPath(v ...string) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { r.FilterPath = v @@ -209,6 +220,7 @@ func (f TransformGetTransformStats) WithFilterPath(v ...string) func(*TransformG } // WithHeader adds the headers to the HTTP request. +// func (f TransformGetTransformStats) WithHeader(h map[string]string) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { if r.Header == nil { @@ -221,6 +233,7 @@ func (f TransformGetTransformStats) WithHeader(h map[string]string) func(*Transf } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformGetTransformStats) WithOpaqueID(s string) func(*TransformGetTransformStatsRequest) { return func(r *TransformGetTransformStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.preview_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.preview_transform.go index ff5772329a2..4cdff6390aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.preview_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.preview_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newTransformPreviewTransformFunc(t Transport) TransformPreviewTransform { // TransformPreviewTransform - Previews a transform. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html. +// type TransformPreviewTransform func(o ...func(*TransformPreviewTransformRequest)) (*Response, error) // TransformPreviewTransformRequest configures the Transform Preview Transform API request. +// type TransformPreviewTransformRequest struct { Body io.Reader @@ -63,6 +65,7 @@ type TransformPreviewTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -117,6 +120,10 @@ func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Tran 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 @@ -129,10 +136,6 @@ func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Tran } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -152,6 +155,7 @@ func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Tran } // WithContext sets the request context. +// func (f TransformPreviewTransform) WithContext(v context.Context) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.ctx = v @@ -159,6 +163,7 @@ func (f TransformPreviewTransform) WithContext(v context.Context) func(*Transfor } // WithBody - The definition for the transform to preview. +// func (f TransformPreviewTransform) WithBody(v io.Reader) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.Body = v @@ -166,6 +171,7 @@ func (f TransformPreviewTransform) WithBody(v io.Reader) func(*TransformPreviewT } // WithTransformID - the ID of the transform to preview.. +// func (f TransformPreviewTransform) WithTransformID(v string) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.TransformID = v @@ -173,6 +179,7 @@ func (f TransformPreviewTransform) WithTransformID(v string) func(*TransformPrev } // WithTimeout - controls the time to wait for the preview. +// func (f TransformPreviewTransform) WithTimeout(v time.Duration) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.Timeout = v @@ -180,6 +187,7 @@ func (f TransformPreviewTransform) WithTimeout(v time.Duration) func(*TransformP } // WithPretty makes the response body pretty-printed. +// func (f TransformPreviewTransform) WithPretty() func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.Pretty = true @@ -187,6 +195,7 @@ func (f TransformPreviewTransform) WithPretty() func(*TransformPreviewTransformR } // WithHuman makes statistical values human-readable. +// func (f TransformPreviewTransform) WithHuman() func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.Human = true @@ -194,6 +203,7 @@ func (f TransformPreviewTransform) WithHuman() func(*TransformPreviewTransformRe } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformPreviewTransform) WithErrorTrace() func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.ErrorTrace = true @@ -201,6 +211,7 @@ func (f TransformPreviewTransform) WithErrorTrace() func(*TransformPreviewTransf } // WithFilterPath filters the properties of the response body. +// func (f TransformPreviewTransform) WithFilterPath(v ...string) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { r.FilterPath = v @@ -208,6 +219,7 @@ func (f TransformPreviewTransform) WithFilterPath(v ...string) func(*TransformPr } // WithHeader adds the headers to the HTTP request. +// func (f TransformPreviewTransform) WithHeader(h map[string]string) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { if r.Header == nil { @@ -220,6 +232,7 @@ func (f TransformPreviewTransform) WithHeader(h map[string]string) func(*Transfo } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformPreviewTransform) WithOpaqueID(s string) func(*TransformPreviewTransformRequest) { return func(r *TransformPreviewTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.put_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.put_transform.go index 82fbb557031..ad47811e57a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.put_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.put_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newTransformPutTransformFunc(t Transport) TransformPutTransform { // TransformPutTransform - Instantiates a transform. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html. +// type TransformPutTransform func(body io.Reader, transform_id string, o ...func(*TransformPutTransformRequest)) (*Response, error) // TransformPutTransformRequest configures the Transform Put Transform API request. +// type TransformPutTransformRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type TransformPutTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -119,6 +122,10 @@ func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transpor 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 @@ -131,10 +138,6 @@ func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transpor } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -154,6 +157,7 @@ func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. +// func (f TransformPutTransform) WithContext(v context.Context) func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f TransformPutTransform) WithContext(v context.Context) func(*TransformPut } // WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// func (f TransformPutTransform) WithDeferValidation(v bool) func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.DeferValidation = &v @@ -168,6 +173,7 @@ func (f TransformPutTransform) WithDeferValidation(v bool) func(*TransformPutTra } // WithTimeout - controls the time to wait for the transform to start. +// func (f TransformPutTransform) WithTimeout(v time.Duration) func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.Timeout = v @@ -175,6 +181,7 @@ func (f TransformPutTransform) WithTimeout(v time.Duration) func(*TransformPutTr } // WithPretty makes the response body pretty-printed. +// func (f TransformPutTransform) WithPretty() func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.Pretty = true @@ -182,6 +189,7 @@ func (f TransformPutTransform) WithPretty() func(*TransformPutTransformRequest) } // WithHuman makes statistical values human-readable. +// func (f TransformPutTransform) WithHuman() func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.Human = true @@ -189,6 +197,7 @@ func (f TransformPutTransform) WithHuman() func(*TransformPutTransformRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformPutTransform) WithErrorTrace() func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.ErrorTrace = true @@ -196,6 +205,7 @@ func (f TransformPutTransform) WithErrorTrace() func(*TransformPutTransformReque } // WithFilterPath filters the properties of the response body. +// func (f TransformPutTransform) WithFilterPath(v ...string) func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { r.FilterPath = v @@ -203,6 +213,7 @@ func (f TransformPutTransform) WithFilterPath(v ...string) func(*TransformPutTra } // WithHeader adds the headers to the HTTP request. +// func (f TransformPutTransform) WithHeader(h map[string]string) func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { if r.Header == nil { @@ -215,6 +226,7 @@ func (f TransformPutTransform) WithHeader(h map[string]string) func(*TransformPu } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformPutTransform) WithOpaqueID(s string) func(*TransformPutTransformRequest) { return func(r *TransformPutTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.start_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.start_transform.go index 0056c8cf17d..fcbe95a36ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.start_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.start_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newTransformStartTransformFunc(t Transport) TransformStartTransform { // TransformStartTransform - Starts one or more transforms. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html. +// type TransformStartTransform func(transform_id string, o ...func(*TransformStartTransformRequest)) (*Response, error) // TransformStartTransformRequest configures the Transform Start Transform API request. +// type TransformStartTransformRequest struct { TransformID string @@ -60,6 +62,7 @@ type TransformStartTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transp } // WithContext sets the request context. +// func (f TransformStartTransform) WithContext(v context.Context) func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f TransformStartTransform) WithContext(v context.Context) func(*TransformS } // WithTimeout - controls the time to wait for the transform to start. +// func (f TransformStartTransform) WithTimeout(v time.Duration) func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { r.Timeout = v @@ -157,6 +162,7 @@ func (f TransformStartTransform) WithTimeout(v time.Duration) func(*TransformSta } // WithPretty makes the response body pretty-printed. +// func (f TransformStartTransform) WithPretty() func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f TransformStartTransform) WithPretty() func(*TransformStartTransformReque } // WithHuman makes statistical values human-readable. +// func (f TransformStartTransform) WithHuman() func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f TransformStartTransform) WithHuman() func(*TransformStartTransformReques } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformStartTransform) WithErrorTrace() func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f TransformStartTransform) WithErrorTrace() func(*TransformStartTransformR } // WithFilterPath filters the properties of the response body. +// func (f TransformStartTransform) WithFilterPath(v ...string) func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f TransformStartTransform) WithFilterPath(v ...string) func(*TransformStar } // WithHeader adds the headers to the HTTP request. +// func (f TransformStartTransform) WithHeader(h map[string]string) func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f TransformStartTransform) WithHeader(h map[string]string) func(*Transform } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformStartTransform) WithOpaqueID(s string) func(*TransformStartTransformRequest) { return func(r *TransformStartTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.stop_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.stop_transform.go index 2ba919dd786..2ac5924b1e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.stop_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.stop_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newTransformStopTransformFunc(t Transport) TransformStopTransform { // TransformStopTransform - Stops one or more transforms. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html. +// type TransformStopTransform func(transform_id string, o ...func(*TransformStopTransformRequest)) (*Response, error) // TransformStopTransformRequest configures the Transform Stop Transform API request. +// type TransformStopTransformRequest struct { TransformID string @@ -65,6 +67,7 @@ type TransformStopTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -164,6 +167,7 @@ func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f TransformStopTransform) WithContext(v context.Context) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.ctx = v @@ -171,6 +175,7 @@ func (f TransformStopTransform) WithContext(v context.Context) func(*TransformSt } // WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// func (f TransformStopTransform) WithAllowNoMatch(v bool) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.AllowNoMatch = &v @@ -178,6 +183,7 @@ func (f TransformStopTransform) WithAllowNoMatch(v bool) func(*TransformStopTran } // WithForce - whether to force stop a failed transform or not. default to false. +// func (f TransformStopTransform) WithForce(v bool) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.Force = &v @@ -185,6 +191,7 @@ func (f TransformStopTransform) WithForce(v bool) func(*TransformStopTransformRe } // WithTimeout - controls the time to wait until the transform has stopped. default to 30 seconds. +// func (f TransformStopTransform) WithTimeout(v time.Duration) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.Timeout = v @@ -192,6 +199,7 @@ func (f TransformStopTransform) WithTimeout(v time.Duration) func(*TransformStop } // WithWaitForCheckpoint - whether to wait for the transform to reach a checkpoint before stopping. default to false. +// func (f TransformStopTransform) WithWaitForCheckpoint(v bool) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.WaitForCheckpoint = &v @@ -199,6 +207,7 @@ func (f TransformStopTransform) WithWaitForCheckpoint(v bool) func(*TransformSto } // WithWaitForCompletion - whether to wait for the transform to fully stop before returning or not. default to false. +// func (f TransformStopTransform) WithWaitForCompletion(v bool) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.WaitForCompletion = &v @@ -206,6 +215,7 @@ func (f TransformStopTransform) WithWaitForCompletion(v bool) func(*TransformSto } // WithPretty makes the response body pretty-printed. +// func (f TransformStopTransform) WithPretty() func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.Pretty = true @@ -213,6 +223,7 @@ func (f TransformStopTransform) WithPretty() func(*TransformStopTransformRequest } // WithHuman makes statistical values human-readable. +// func (f TransformStopTransform) WithHuman() func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.Human = true @@ -220,6 +231,7 @@ func (f TransformStopTransform) WithHuman() func(*TransformStopTransformRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformStopTransform) WithErrorTrace() func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.ErrorTrace = true @@ -227,6 +239,7 @@ func (f TransformStopTransform) WithErrorTrace() func(*TransformStopTransformReq } // WithFilterPath filters the properties of the response body. +// func (f TransformStopTransform) WithFilterPath(v ...string) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { r.FilterPath = v @@ -234,6 +247,7 @@ func (f TransformStopTransform) WithFilterPath(v ...string) func(*TransformStopT } // WithHeader adds the headers to the HTTP request. +// func (f TransformStopTransform) WithHeader(h map[string]string) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { if r.Header == nil { @@ -246,6 +260,7 @@ func (f TransformStopTransform) WithHeader(h map[string]string) func(*TransformS } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformStopTransform) WithOpaqueID(s string) func(*TransformStopTransformRequest) { return func(r *TransformStopTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.update_transform.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.update_transform.go index 46ae018dc71..aa46498b50a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.update_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.update_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -43,9 +43,11 @@ func newTransformUpdateTransformFunc(t Transport) TransformUpdateTransform { // TransformUpdateTransform - Updates certain properties of a transform. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html. +// type TransformUpdateTransform func(body io.Reader, transform_id string, o ...func(*TransformUpdateTransformRequest)) (*Response, error) // TransformUpdateTransformRequest configures the Transform Update Transform API request. +// type TransformUpdateTransformRequest struct { Body io.Reader @@ -65,6 +67,7 @@ type TransformUpdateTransformRequest struct { } // Do executes the request and returns response or error. +// func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -121,6 +124,10 @@ func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Trans 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 @@ -133,10 +140,6 @@ func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Trans } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -156,6 +159,7 @@ func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Trans } // WithContext sets the request context. +// func (f TransformUpdateTransform) WithContext(v context.Context) func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.ctx = v @@ -163,6 +167,7 @@ func (f TransformUpdateTransform) WithContext(v context.Context) func(*Transform } // WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// func (f TransformUpdateTransform) WithDeferValidation(v bool) func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.DeferValidation = &v @@ -170,6 +175,7 @@ func (f TransformUpdateTransform) WithDeferValidation(v bool) func(*TransformUpd } // WithTimeout - controls the time to wait for the update. +// func (f TransformUpdateTransform) WithTimeout(v time.Duration) func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.Timeout = v @@ -177,6 +183,7 @@ func (f TransformUpdateTransform) WithTimeout(v time.Duration) func(*TransformUp } // WithPretty makes the response body pretty-printed. +// func (f TransformUpdateTransform) WithPretty() func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.Pretty = true @@ -184,6 +191,7 @@ func (f TransformUpdateTransform) WithPretty() func(*TransformUpdateTransformReq } // WithHuman makes statistical values human-readable. +// func (f TransformUpdateTransform) WithHuman() func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.Human = true @@ -191,6 +199,7 @@ func (f TransformUpdateTransform) WithHuman() func(*TransformUpdateTransformRequ } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformUpdateTransform) WithErrorTrace() func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.ErrorTrace = true @@ -198,6 +207,7 @@ func (f TransformUpdateTransform) WithErrorTrace() func(*TransformUpdateTransfor } // WithFilterPath filters the properties of the response body. +// func (f TransformUpdateTransform) WithFilterPath(v ...string) func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { r.FilterPath = v @@ -205,6 +215,7 @@ func (f TransformUpdateTransform) WithFilterPath(v ...string) func(*TransformUpd } // WithHeader adds the headers to the HTTP request. +// func (f TransformUpdateTransform) WithHeader(h map[string]string) func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { if r.Header == nil { @@ -217,6 +228,7 @@ func (f TransformUpdateTransform) WithHeader(h map[string]string) func(*Transfor } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformUpdateTransform) WithOpaqueID(s string) func(*TransformUpdateTransformRequest) { return func(r *TransformUpdateTransformRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.upgrade_transforms.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.upgrade_transforms.go index f6709edf18b..47cd4f84d6e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.upgrade_transforms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.transform.upgrade_transforms.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newTransformUpgradeTransformsFunc(t Transport) TransformUpgradeTransforms { // TransformUpgradeTransforms - Upgrades all transforms. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html. +// type TransformUpgradeTransforms func(o ...func(*TransformUpgradeTransformsRequest)) (*Response, error) // TransformUpgradeTransformsRequest configures the Transform Upgrade Transforms API request. +// type TransformUpgradeTransformsRequest struct { DryRun *bool Timeout time.Duration @@ -60,6 +62,7 @@ type TransformUpgradeTransformsRequest struct { } // Do executes the request and returns response or error. +// func (r TransformUpgradeTransformsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -142,6 +145,7 @@ func (r TransformUpgradeTransformsRequest) Do(ctx context.Context, transport Tra } // WithContext sets the request context. +// func (f TransformUpgradeTransforms) WithContext(v context.Context) func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.ctx = v @@ -149,6 +153,7 @@ func (f TransformUpgradeTransforms) WithContext(v context.Context) func(*Transfo } // WithDryRun - whether to only check for updates but don't execute. +// func (f TransformUpgradeTransforms) WithDryRun(v bool) func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.DryRun = &v @@ -156,6 +161,7 @@ func (f TransformUpgradeTransforms) WithDryRun(v bool) func(*TransformUpgradeTra } // WithTimeout - controls the time to wait for the upgrade. +// func (f TransformUpgradeTransforms) WithTimeout(v time.Duration) func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.Timeout = v @@ -163,6 +169,7 @@ func (f TransformUpgradeTransforms) WithTimeout(v time.Duration) func(*Transform } // WithPretty makes the response body pretty-printed. +// func (f TransformUpgradeTransforms) WithPretty() func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.Pretty = true @@ -170,6 +177,7 @@ func (f TransformUpgradeTransforms) WithPretty() func(*TransformUpgradeTransform } // WithHuman makes statistical values human-readable. +// func (f TransformUpgradeTransforms) WithHuman() func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.Human = true @@ -177,6 +185,7 @@ func (f TransformUpgradeTransforms) WithHuman() func(*TransformUpgradeTransforms } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f TransformUpgradeTransforms) WithErrorTrace() func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.ErrorTrace = true @@ -184,6 +193,7 @@ func (f TransformUpgradeTransforms) WithErrorTrace() func(*TransformUpgradeTrans } // WithFilterPath filters the properties of the response body. +// func (f TransformUpgradeTransforms) WithFilterPath(v ...string) func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { r.FilterPath = v @@ -191,6 +201,7 @@ func (f TransformUpgradeTransforms) WithFilterPath(v ...string) func(*TransformU } // WithHeader adds the headers to the HTTP request. +// func (f TransformUpgradeTransforms) WithHeader(h map[string]string) func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { if r.Header == nil { @@ -203,6 +214,7 @@ func (f TransformUpgradeTransforms) WithHeader(h map[string]string) func(*Transf } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f TransformUpgradeTransforms) WithOpaqueID(s string) func(*TransformUpgradeTransformsRequest) { return func(r *TransformUpgradeTransformsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.ack_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.ack_watch.go index b2fba6b8298..38ccada2333 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.ack_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.ack_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherAckWatchFunc(t Transport) WatcherAckWatch { // WatcherAckWatch - Acknowledges a watch, manually throttling the execution of the watch's actions. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html. +// type WatcherAckWatch func(watch_id string, o ...func(*WatcherAckWatchRequest)) (*Response, error) // WatcherAckWatchRequest configures the Watcher Ack Watch API request. +// type WatcherAckWatchRequest struct { ActionID []string WatchID string @@ -58,6 +60,7 @@ type WatcherAckWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -143,6 +146,7 @@ func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f WatcherAckWatch) WithContext(v context.Context) func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { r.ctx = v @@ -150,6 +154,7 @@ func (f WatcherAckWatch) WithContext(v context.Context) func(*WatcherAckWatchReq } // WithActionID - a list of the action ids to be acked. +// func (f WatcherAckWatch) WithActionID(v ...string) func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { r.ActionID = v @@ -157,6 +162,7 @@ func (f WatcherAckWatch) WithActionID(v ...string) func(*WatcherAckWatchRequest) } // WithPretty makes the response body pretty-printed. +// func (f WatcherAckWatch) WithPretty() func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { r.Pretty = true @@ -164,6 +170,7 @@ func (f WatcherAckWatch) WithPretty() func(*WatcherAckWatchRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherAckWatch) WithHuman() func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { r.Human = true @@ -171,6 +178,7 @@ func (f WatcherAckWatch) WithHuman() func(*WatcherAckWatchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherAckWatch) WithErrorTrace() func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { r.ErrorTrace = true @@ -178,6 +186,7 @@ func (f WatcherAckWatch) WithErrorTrace() func(*WatcherAckWatchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherAckWatch) WithFilterPath(v ...string) func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { r.FilterPath = v @@ -185,6 +194,7 @@ func (f WatcherAckWatch) WithFilterPath(v ...string) func(*WatcherAckWatchReques } // WithHeader adds the headers to the HTTP request. +// func (f WatcherAckWatch) WithHeader(h map[string]string) func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { if r.Header == nil { @@ -197,6 +207,7 @@ func (f WatcherAckWatch) WithHeader(h map[string]string) func(*WatcherAckWatchRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherAckWatch) WithOpaqueID(s string) func(*WatcherAckWatchRequest) { return func(r *WatcherAckWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.activate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.activate_watch.go index fc1bef6ff06..922ac27e668 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.activate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.activate_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherActivateWatchFunc(t Transport) WatcherActivateWatch { // WatcherActivateWatch - Activates a currently inactive watch. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html. +// type WatcherActivateWatch func(watch_id string, o ...func(*WatcherActivateWatchRequest)) (*Response, error) // WatcherActivateWatchRequest configures the Watcher Activate Watch API request. +// type WatcherActivateWatchRequest struct { WatchID string @@ -57,6 +59,7 @@ type WatcherActivateWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport } // WithContext sets the request context. +// func (f WatcherActivateWatch) WithContext(v context.Context) func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f WatcherActivateWatch) WithContext(v context.Context) func(*WatcherActiva } // WithPretty makes the response body pretty-printed. +// func (f WatcherActivateWatch) WithPretty() func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f WatcherActivateWatch) WithPretty() func(*WatcherActivateWatchRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherActivateWatch) WithHuman() func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f WatcherActivateWatch) WithHuman() func(*WatcherActivateWatchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherActivateWatch) WithErrorTrace() func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f WatcherActivateWatch) WithErrorTrace() func(*WatcherActivateWatchRequest } // WithFilterPath filters the properties of the response body. +// func (f WatcherActivateWatch) WithFilterPath(v ...string) func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f WatcherActivateWatch) WithFilterPath(v ...string) func(*WatcherActivateW } // WithHeader adds the headers to the HTTP request. +// func (f WatcherActivateWatch) WithHeader(h map[string]string) func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f WatcherActivateWatch) WithHeader(h map[string]string) func(*WatcherActiv } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherActivateWatch) WithOpaqueID(s string) func(*WatcherActivateWatchRequest) { return func(r *WatcherActivateWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.deactivate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.deactivate_watch.go index 141735b0074..fc9e15c14ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.deactivate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.deactivate_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherDeactivateWatchFunc(t Transport) WatcherDeactivateWatch { // WatcherDeactivateWatch - Deactivates a currently active watch. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html. +// type WatcherDeactivateWatch func(watch_id string, o ...func(*WatcherDeactivateWatchRequest)) (*Response, error) // WatcherDeactivateWatchRequest configures the Watcher Deactivate Watch API request. +// type WatcherDeactivateWatchRequest struct { WatchID string @@ -57,6 +59,7 @@ type WatcherDeactivateWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -138,6 +141,7 @@ func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transpo } // WithContext sets the request context. +// func (f WatcherDeactivateWatch) WithContext(v context.Context) func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { r.ctx = v @@ -145,6 +149,7 @@ func (f WatcherDeactivateWatch) WithContext(v context.Context) func(*WatcherDeac } // WithPretty makes the response body pretty-printed. +// func (f WatcherDeactivateWatch) WithPretty() func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { r.Pretty = true @@ -152,6 +157,7 @@ func (f WatcherDeactivateWatch) WithPretty() func(*WatcherDeactivateWatchRequest } // WithHuman makes statistical values human-readable. +// func (f WatcherDeactivateWatch) WithHuman() func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { r.Human = true @@ -159,6 +165,7 @@ func (f WatcherDeactivateWatch) WithHuman() func(*WatcherDeactivateWatchRequest) } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherDeactivateWatch) WithErrorTrace() func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { r.ErrorTrace = true @@ -166,6 +173,7 @@ func (f WatcherDeactivateWatch) WithErrorTrace() func(*WatcherDeactivateWatchReq } // WithFilterPath filters the properties of the response body. +// func (f WatcherDeactivateWatch) WithFilterPath(v ...string) func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { r.FilterPath = v @@ -173,6 +181,7 @@ func (f WatcherDeactivateWatch) WithFilterPath(v ...string) func(*WatcherDeactiv } // WithHeader adds the headers to the HTTP request. +// func (f WatcherDeactivateWatch) WithHeader(h map[string]string) func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { if r.Header == nil { @@ -185,6 +194,7 @@ func (f WatcherDeactivateWatch) WithHeader(h map[string]string) func(*WatcherDea } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherDeactivateWatch) WithOpaqueID(s string) func(*WatcherDeactivateWatchRequest) { return func(r *WatcherDeactivateWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.delete_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.delete_watch.go index ab428712a96..f9d9ec5adcc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.delete_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.delete_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { // WatcherDeleteWatch - Removes a watch from Watcher. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html. +// type WatcherDeleteWatch func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) // WatcherDeleteWatchRequest configures the Watcher Delete Watch API request. +// type WatcherDeleteWatchRequest struct { WatchID string @@ -57,6 +59,7 @@ type WatcherDeleteWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f WatcherDeleteWatch) WithContext(v context.Context) func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f WatcherDeleteWatch) WithContext(v context.Context) func(*WatcherDeleteWa } // WithPretty makes the response body pretty-printed. +// func (f WatcherDeleteWatch) WithPretty() func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f WatcherDeleteWatch) WithPretty() func(*WatcherDeleteWatchRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherDeleteWatch) WithHuman() func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f WatcherDeleteWatch) WithHuman() func(*WatcherDeleteWatchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherDeleteWatch) WithErrorTrace() func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f WatcherDeleteWatch) WithErrorTrace() func(*WatcherDeleteWatchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherDeleteWatch) WithFilterPath(v ...string) func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f WatcherDeleteWatch) WithFilterPath(v ...string) func(*WatcherDeleteWatch } // WithHeader adds the headers to the HTTP request. +// func (f WatcherDeleteWatch) WithHeader(h map[string]string) func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f WatcherDeleteWatch) WithHeader(h map[string]string) func(*WatcherDeleteW } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherDeleteWatch) WithOpaqueID(s string) func(*WatcherDeleteWatchRequest) { return func(r *WatcherDeleteWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.execute_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.execute_watch.go index 064e5fc4f88..0a2eda683b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.execute_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.execute_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newWatcherExecuteWatchFunc(t Transport) WatcherExecuteWatch { // WatcherExecuteWatch - Forces the execution of a stored watch. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html. +// type WatcherExecuteWatch func(o ...func(*WatcherExecuteWatchRequest)) (*Response, error) // WatcherExecuteWatchRequest configures the Watcher Execute Watch API request. +// type WatcherExecuteWatchRequest struct { WatchID string @@ -63,6 +65,7 @@ type WatcherExecuteWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -119,6 +122,10 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) 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 @@ -131,10 +138,6 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -154,6 +157,7 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f WatcherExecuteWatch) WithContext(v context.Context) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.ctx = v @@ -161,6 +165,7 @@ func (f WatcherExecuteWatch) WithContext(v context.Context) func(*WatcherExecute } // WithBody - Execution control. +// func (f WatcherExecuteWatch) WithBody(v io.Reader) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.Body = v @@ -168,6 +173,7 @@ func (f WatcherExecuteWatch) WithBody(v io.Reader) func(*WatcherExecuteWatchRequ } // WithWatchID - watch ID. +// func (f WatcherExecuteWatch) WithWatchID(v string) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.WatchID = v @@ -175,6 +181,7 @@ func (f WatcherExecuteWatch) WithWatchID(v string) func(*WatcherExecuteWatchRequ } // WithDebug - indicates whether the watch should execute in debug mode. +// func (f WatcherExecuteWatch) WithDebug(v bool) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.Debug = &v @@ -182,6 +189,7 @@ func (f WatcherExecuteWatch) WithDebug(v bool) func(*WatcherExecuteWatchRequest) } // WithPretty makes the response body pretty-printed. +// func (f WatcherExecuteWatch) WithPretty() func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.Pretty = true @@ -189,6 +197,7 @@ func (f WatcherExecuteWatch) WithPretty() func(*WatcherExecuteWatchRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherExecuteWatch) WithHuman() func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.Human = true @@ -196,6 +205,7 @@ func (f WatcherExecuteWatch) WithHuman() func(*WatcherExecuteWatchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherExecuteWatch) WithErrorTrace() func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.ErrorTrace = true @@ -203,6 +213,7 @@ func (f WatcherExecuteWatch) WithErrorTrace() func(*WatcherExecuteWatchRequest) } // WithFilterPath filters the properties of the response body. +// func (f WatcherExecuteWatch) WithFilterPath(v ...string) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { r.FilterPath = v @@ -210,6 +221,7 @@ func (f WatcherExecuteWatch) WithFilterPath(v ...string) func(*WatcherExecuteWat } // WithHeader adds the headers to the HTTP request. +// func (f WatcherExecuteWatch) WithHeader(h map[string]string) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { if r.Header == nil { @@ -222,6 +234,7 @@ func (f WatcherExecuteWatch) WithHeader(h map[string]string) func(*WatcherExecut } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherExecuteWatch) WithOpaqueID(s string) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.get_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.get_watch.go index 5fdf12f6f26..0ae5bbc2ccd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.get_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.get_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { // WatcherGetWatch - Retrieves a watch by its ID. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html. +// type WatcherGetWatch func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) // WatcherGetWatchRequest configures the Watcher Get Watch API request. +// type WatcherGetWatchRequest struct { WatchID string @@ -57,6 +59,7 @@ type WatcherGetWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f WatcherGetWatch) WithContext(v context.Context) func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f WatcherGetWatch) WithContext(v context.Context) func(*WatcherGetWatchReq } // WithPretty makes the response body pretty-printed. +// func (f WatcherGetWatch) WithPretty() func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { r.Pretty = true @@ -150,6 +155,7 @@ func (f WatcherGetWatch) WithPretty() func(*WatcherGetWatchRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherGetWatch) WithHuman() func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { r.Human = true @@ -157,6 +163,7 @@ func (f WatcherGetWatch) WithHuman() func(*WatcherGetWatchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherGetWatch) WithErrorTrace() func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { r.ErrorTrace = true @@ -164,6 +171,7 @@ func (f WatcherGetWatch) WithErrorTrace() func(*WatcherGetWatchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherGetWatch) WithFilterPath(v ...string) func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { r.FilterPath = v @@ -171,6 +179,7 @@ func (f WatcherGetWatch) WithFilterPath(v ...string) func(*WatcherGetWatchReques } // WithHeader adds the headers to the HTTP request. +// func (f WatcherGetWatch) WithHeader(h map[string]string) func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { if r.Header == nil { @@ -183,6 +192,7 @@ func (f WatcherGetWatch) WithHeader(h map[string]string) func(*WatcherGetWatchRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherGetWatch) WithOpaqueID(s string) func(*WatcherGetWatchRequest) { return func(r *WatcherGetWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.put_watch.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.put_watch.go index 4fbff21f3a6..d8cfd051972 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.put_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.put_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -42,9 +42,11 @@ func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { // WatcherPutWatch - Creates a new watch, or updates an existing one. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html. +// type WatcherPutWatch func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) // WatcherPutWatchRequest configures the Watcher Put Watch API request. +// type WatcherPutWatchRequest struct { WatchID string @@ -66,6 +68,7 @@ type WatcherPutWatchRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -130,6 +133,10 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R 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 @@ -142,10 +149,6 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -165,6 +168,7 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R } // WithContext sets the request context. +// func (f WatcherPutWatch) WithContext(v context.Context) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.ctx = v @@ -172,6 +176,7 @@ func (f WatcherPutWatch) WithContext(v context.Context) func(*WatcherPutWatchReq } // WithBody - The watch. +// func (f WatcherPutWatch) WithBody(v io.Reader) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.Body = v @@ -179,6 +184,7 @@ func (f WatcherPutWatch) WithBody(v io.Reader) func(*WatcherPutWatchRequest) { } // WithActive - specify whether the watch is in/active by default. +// func (f WatcherPutWatch) WithActive(v bool) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.Active = &v @@ -186,6 +192,7 @@ func (f WatcherPutWatch) WithActive(v bool) func(*WatcherPutWatchRequest) { } // WithIfPrimaryTerm - only update the watch if the last operation that has changed the watch has the specified primary term. +// func (f WatcherPutWatch) WithIfPrimaryTerm(v int) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.IfPrimaryTerm = &v @@ -193,6 +200,7 @@ func (f WatcherPutWatch) WithIfPrimaryTerm(v int) func(*WatcherPutWatchRequest) } // WithIfSeqNo - only update the watch if the last operation that has changed the watch has the specified sequence number. +// func (f WatcherPutWatch) WithIfSeqNo(v int) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.IfSeqNo = &v @@ -200,6 +208,7 @@ func (f WatcherPutWatch) WithIfSeqNo(v int) func(*WatcherPutWatchRequest) { } // WithVersion - explicit version number for concurrency control. +// func (f WatcherPutWatch) WithVersion(v int) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.Version = &v @@ -207,6 +216,7 @@ func (f WatcherPutWatch) WithVersion(v int) func(*WatcherPutWatchRequest) { } // WithPretty makes the response body pretty-printed. +// func (f WatcherPutWatch) WithPretty() func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.Pretty = true @@ -214,6 +224,7 @@ func (f WatcherPutWatch) WithPretty() func(*WatcherPutWatchRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherPutWatch) WithHuman() func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.Human = true @@ -221,6 +232,7 @@ func (f WatcherPutWatch) WithHuman() func(*WatcherPutWatchRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherPutWatch) WithErrorTrace() func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.ErrorTrace = true @@ -228,6 +240,7 @@ func (f WatcherPutWatch) WithErrorTrace() func(*WatcherPutWatchRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherPutWatch) WithFilterPath(v ...string) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { r.FilterPath = v @@ -235,6 +248,7 @@ func (f WatcherPutWatch) WithFilterPath(v ...string) func(*WatcherPutWatchReques } // WithHeader adds the headers to the HTTP request. +// func (f WatcherPutWatch) WithHeader(h map[string]string) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { if r.Header == nil { @@ -247,6 +261,7 @@ func (f WatcherPutWatch) WithHeader(h map[string]string) func(*WatcherPutWatchRe } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherPutWatch) WithOpaqueID(s string) func(*WatcherPutWatchRequest) { return func(r *WatcherPutWatchRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.query_watches.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.query_watches.go index bb532b811a3..9da992d5b0e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.query_watches.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.query_watches.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newWatcherQueryWatchesFunc(t Transport) WatcherQueryWatches { // WatcherQueryWatches - Retrieves stored watches. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html. +// type WatcherQueryWatches func(o ...func(*WatcherQueryWatchesRequest)) (*Response, error) // WatcherQueryWatchesRequest configures the Watcher Query Watches API request. +// type WatcherQueryWatchesRequest struct { Body io.Reader @@ -58,6 +60,7 @@ type WatcherQueryWatchesRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -101,6 +104,10 @@ func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) 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 @@ -113,10 +120,6 @@ func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) } } - if r.Body != nil && req.Header.Get(headerContentType) == "" { - req.Header[headerContentType] = headerContentTypeJSON - } - if ctx != nil { req = req.WithContext(ctx) } @@ -136,6 +139,7 @@ func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. +// func (f WatcherQueryWatches) WithContext(v context.Context) func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f WatcherQueryWatches) WithContext(v context.Context) func(*WatcherQueryWa } // WithBody - From, size, query, sort and search_after. +// func (f WatcherQueryWatches) WithBody(v io.Reader) func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { r.Body = v @@ -150,6 +155,7 @@ func (f WatcherQueryWatches) WithBody(v io.Reader) func(*WatcherQueryWatchesRequ } // WithPretty makes the response body pretty-printed. +// func (f WatcherQueryWatches) WithPretty() func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f WatcherQueryWatches) WithPretty() func(*WatcherQueryWatchesRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherQueryWatches) WithHuman() func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f WatcherQueryWatches) WithHuman() func(*WatcherQueryWatchesRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherQueryWatches) WithErrorTrace() func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f WatcherQueryWatches) WithErrorTrace() func(*WatcherQueryWatchesRequest) } // WithFilterPath filters the properties of the response body. +// func (f WatcherQueryWatches) WithFilterPath(v ...string) func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f WatcherQueryWatches) WithFilterPath(v ...string) func(*WatcherQueryWatch } // WithHeader adds the headers to the HTTP request. +// func (f WatcherQueryWatches) WithHeader(h map[string]string) func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f WatcherQueryWatches) WithHeader(h map[string]string) func(*WatcherQueryW } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherQueryWatches) WithOpaqueID(s string) func(*WatcherQueryWatchesRequest) { return func(r *WatcherQueryWatchesRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.start.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.start.go index 8e63fe21cea..99a8653d32a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.start.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherStartFunc(t Transport) WatcherStart { // WatcherStart - Starts Watcher if it is not already running. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html. +// type WatcherStart func(o ...func(*WatcherStartRequest)) (*Response, error) // WatcherStartRequest configures the Watcher Start API request. +// type WatcherStartRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type WatcherStartRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f WatcherStart) WithContext(v context.Context) func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f WatcherStart) WithContext(v context.Context) func(*WatcherStartRequest) } // WithPretty makes the response body pretty-printed. +// func (f WatcherStart) WithPretty() func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f WatcherStart) WithPretty() func(*WatcherStartRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherStart) WithHuman() func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f WatcherStart) WithHuman() func(*WatcherStartRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherStart) WithErrorTrace() func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f WatcherStart) WithErrorTrace() func(*WatcherStartRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherStart) WithFilterPath(v ...string) func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f WatcherStart) WithFilterPath(v ...string) func(*WatcherStartRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f WatcherStart) WithHeader(h map[string]string) func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f WatcherStart) WithHeader(h map[string]string) func(*WatcherStartRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherStart) WithOpaqueID(s string) func(*WatcherStartRequest) { return func(r *WatcherStartRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stats.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stats.go index 143a2cfe272..13de00a3b1f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newWatcherStatsFunc(t Transport) WatcherStats { // WatcherStats - Retrieves the current Watcher metrics. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html. +// type WatcherStats func(o ...func(*WatcherStatsRequest)) (*Response, error) // WatcherStatsRequest configures the Watcher Stats API request. +// type WatcherStatsRequest struct { Metric []string @@ -60,6 +62,7 @@ type WatcherStatsRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -149,6 +152,7 @@ func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Resp } // WithContext sets the request context. +// func (f WatcherStats) WithContext(v context.Context) func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.ctx = v @@ -156,6 +160,7 @@ func (f WatcherStats) WithContext(v context.Context) func(*WatcherStatsRequest) } // WithMetric - controls what additional stat metrics should be include in the response. +// func (f WatcherStats) WithMetric(v ...string) func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.Metric = v @@ -163,6 +168,7 @@ func (f WatcherStats) WithMetric(v ...string) func(*WatcherStatsRequest) { } // WithEmitStacktraces - emits stack traces of currently running watches. +// func (f WatcherStats) WithEmitStacktraces(v bool) func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.EmitStacktraces = &v @@ -170,6 +176,7 @@ func (f WatcherStats) WithEmitStacktraces(v bool) func(*WatcherStatsRequest) { } // WithPretty makes the response body pretty-printed. +// func (f WatcherStats) WithPretty() func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.Pretty = true @@ -177,6 +184,7 @@ func (f WatcherStats) WithPretty() func(*WatcherStatsRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherStats) WithHuman() func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.Human = true @@ -184,6 +192,7 @@ func (f WatcherStats) WithHuman() func(*WatcherStatsRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherStats) WithErrorTrace() func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.ErrorTrace = true @@ -191,6 +200,7 @@ func (f WatcherStats) WithErrorTrace() func(*WatcherStatsRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherStats) WithFilterPath(v ...string) func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { r.FilterPath = v @@ -198,6 +208,7 @@ func (f WatcherStats) WithFilterPath(v ...string) func(*WatcherStatsRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f WatcherStats) WithHeader(h map[string]string) func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { if r.Header == nil { @@ -210,6 +221,7 @@ func (f WatcherStats) WithHeader(h map[string]string) func(*WatcherStatsRequest) } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherStats) WithOpaqueID(s string) func(*WatcherStatsRequest) { return func(r *WatcherStatsRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stop.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stop.go index c8201fb1f68..9f6c4a4ae9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.watcher.stop.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -40,9 +40,11 @@ func newWatcherStopFunc(t Transport) WatcherStop { // WatcherStop - Stops Watcher if it is running. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html. +// type WatcherStop func(o ...func(*WatcherStopRequest)) (*Response, error) // WatcherStopRequest configures the Watcher Stop API request. +// type WatcherStopRequest struct { Pretty bool Human bool @@ -55,6 +57,7 @@ type WatcherStopRequest struct { } // Do executes the request and returns response or error. +// func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -129,6 +132,7 @@ func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Respo } // WithContext sets the request context. +// func (f WatcherStop) WithContext(v context.Context) func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { r.ctx = v @@ -136,6 +140,7 @@ func (f WatcherStop) WithContext(v context.Context) func(*WatcherStopRequest) { } // WithPretty makes the response body pretty-printed. +// func (f WatcherStop) WithPretty() func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { r.Pretty = true @@ -143,6 +148,7 @@ func (f WatcherStop) WithPretty() func(*WatcherStopRequest) { } // WithHuman makes statistical values human-readable. +// func (f WatcherStop) WithHuman() func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { r.Human = true @@ -150,6 +156,7 @@ func (f WatcherStop) WithHuman() func(*WatcherStopRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f WatcherStop) WithErrorTrace() func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { r.ErrorTrace = true @@ -157,6 +164,7 @@ func (f WatcherStop) WithErrorTrace() func(*WatcherStopRequest) { } // WithFilterPath filters the properties of the response body. +// func (f WatcherStop) WithFilterPath(v ...string) func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { r.FilterPath = v @@ -164,6 +172,7 @@ func (f WatcherStop) WithFilterPath(v ...string) func(*WatcherStopRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f WatcherStop) WithHeader(h map[string]string) func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { if r.Header == nil { @@ -176,6 +185,7 @@ func (f WatcherStop) WithHeader(h map[string]string) func(*WatcherStopRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f WatcherStop) WithOpaqueID(s string) func(*WatcherStopRequest) { return func(r *WatcherStopRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.info.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.info.go index f30a23fe06e..7f4ea4388fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newXPackInfoFunc(t Transport) XPackInfo { // XPackInfo - Retrieves information about the installed X-Pack features. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html. +// type XPackInfo func(o ...func(*XPackInfoRequest)) (*Response, error) // XPackInfoRequest configures the X Pack Info API request. +// type XPackInfoRequest struct { AcceptEnterprise *bool Categories []string @@ -59,6 +61,7 @@ type XPackInfoRequest struct { } // Do executes the request and returns response or error. +// func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -141,6 +144,7 @@ func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. +// func (f XPackInfo) WithContext(v context.Context) func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.ctx = v @@ -148,6 +152,7 @@ func (f XPackInfo) WithContext(v context.Context) func(*XPackInfoRequest) { } // WithAcceptEnterprise - if an enterprise license is installed, return the type and mode as 'enterprise' (default: false). +// func (f XPackInfo) WithAcceptEnterprise(v bool) func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.AcceptEnterprise = &v @@ -155,6 +160,7 @@ func (f XPackInfo) WithAcceptEnterprise(v bool) func(*XPackInfoRequest) { } // WithCategories - comma-separated list of info categories. can be any of: build, license, features. +// func (f XPackInfo) WithCategories(v ...string) func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.Categories = v @@ -162,6 +168,7 @@ func (f XPackInfo) WithCategories(v ...string) func(*XPackInfoRequest) { } // WithPretty makes the response body pretty-printed. +// func (f XPackInfo) WithPretty() func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.Pretty = true @@ -169,6 +176,7 @@ func (f XPackInfo) WithPretty() func(*XPackInfoRequest) { } // WithHuman makes statistical values human-readable. +// func (f XPackInfo) WithHuman() func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.Human = true @@ -176,6 +184,7 @@ func (f XPackInfo) WithHuman() func(*XPackInfoRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f XPackInfo) WithErrorTrace() func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.ErrorTrace = true @@ -183,6 +192,7 @@ func (f XPackInfo) WithErrorTrace() func(*XPackInfoRequest) { } // WithFilterPath filters the properties of the response body. +// func (f XPackInfo) WithFilterPath(v ...string) func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { r.FilterPath = v @@ -190,6 +200,7 @@ func (f XPackInfo) WithFilterPath(v ...string) func(*XPackInfoRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f XPackInfo) WithHeader(h map[string]string) func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { if r.Header == nil { @@ -202,6 +213,7 @@ func (f XPackInfo) WithHeader(h map[string]string) func(*XPackInfoRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f XPackInfo) WithOpaqueID(s string) func(*XPackInfoRequest) { return func(r *XPackInfoRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.usage.go b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.usage.go index 56b327760a9..3183d35a946 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.xpack.xpack.usage.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 7.17.7: DO NOT EDIT +// Code generated from specification version 7.17.1: DO NOT EDIT package esapi @@ -41,9 +41,11 @@ func newXPackUsageFunc(t Transport) XPackUsage { // XPackUsage - Retrieves usage information about the installed X-Pack features. // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html. +// type XPackUsage func(o ...func(*XPackUsageRequest)) (*Response, error) // XPackUsageRequest configures the X Pack Usage API request. +// type XPackUsageRequest struct { MasterTimeout time.Duration @@ -58,6 +60,7 @@ type XPackUsageRequest struct { } // Do executes the request and returns response or error. +// func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -136,6 +139,7 @@ func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Respon } // WithContext sets the request context. +// func (f XPackUsage) WithContext(v context.Context) func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { r.ctx = v @@ -143,6 +147,7 @@ func (f XPackUsage) WithContext(v context.Context) func(*XPackUsageRequest) { } // WithMasterTimeout - specify timeout for watch write operation. +// func (f XPackUsage) WithMasterTimeout(v time.Duration) func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { r.MasterTimeout = v @@ -150,6 +155,7 @@ func (f XPackUsage) WithMasterTimeout(v time.Duration) func(*XPackUsageRequest) } // WithPretty makes the response body pretty-printed. +// func (f XPackUsage) WithPretty() func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { r.Pretty = true @@ -157,6 +163,7 @@ func (f XPackUsage) WithPretty() func(*XPackUsageRequest) { } // WithHuman makes statistical values human-readable. +// func (f XPackUsage) WithHuman() func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { r.Human = true @@ -164,6 +171,7 @@ func (f XPackUsage) WithHuman() func(*XPackUsageRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. +// func (f XPackUsage) WithErrorTrace() func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { r.ErrorTrace = true @@ -171,6 +179,7 @@ func (f XPackUsage) WithErrorTrace() func(*XPackUsageRequest) { } // WithFilterPath filters the properties of the response body. +// func (f XPackUsage) WithFilterPath(v ...string) func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { r.FilterPath = v @@ -178,6 +187,7 @@ func (f XPackUsage) WithFilterPath(v ...string) func(*XPackUsageRequest) { } // WithHeader adds the headers to the HTTP request. +// func (f XPackUsage) WithHeader(h map[string]string) func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { if r.Header == nil { @@ -190,6 +200,7 @@ func (f XPackUsage) WithHeader(h map[string]string) func(*XPackUsageRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// func (f XPackUsage) WithOpaqueID(s string) func(*XPackUsageRequest) { return func(r *XPackUsageRequest) { if r.Header == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/estransport/logger.go b/vendor/github.com/elastic/go-elasticsearch/v7/estransport/logger.go index 6ebfcbd90f9..fb368c30ade 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/estransport/logger.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/estransport/logger.go @@ -239,10 +239,7 @@ func (l *CurlLogger) LogRoundTrip(req *http.Request, res *http.Response, err err } } - b.WriteString(" '") - b.WriteString(req.URL.Scheme) - b.WriteString("://") - b.WriteString(req.URL.Host) + b.WriteString(" 'http://localhost:9200") b.WriteString(req.URL.Path) b.WriteString("?pretty") if query != "" { diff --git a/vendor/github.com/elastic/go-elasticsearch/v7/internal/version/version.go b/vendor/github.com/elastic/go-elasticsearch/v7/internal/version/version.go index eef00a56531..623ddb481ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v7/internal/version/version.go +++ b/vendor/github.com/elastic/go-elasticsearch/v7/internal/version/version.go @@ -18,4 +18,5 @@ package version // Client returns the client version as a string. -const Client = "7.17.7" +// +const Client = "7.17.1" diff --git a/vendor/github.com/go-kivik/couchdb/v3/.gitignore b/vendor/github.com/go-kivik/couchdb/v3/.gitignore new file mode 100644 index 00000000000..a3204f676ec --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/.gitignore @@ -0,0 +1,3 @@ +Gopkg.lock +vendor/ +*~ diff --git a/vendor/github.com/go-kivik/couchdb/v3/.gitlab-ci.yml b/vendor/github.com/go-kivik/couchdb/v3/.gitlab-ci.yml new file mode 100644 index 00000000000..4f421cc6ee0 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/.gitlab-ci.yml @@ -0,0 +1,95 @@ +stages: + - test + +variables: + SRCDIR: /go/src/github.com/go-kivik/couchdb + GO111MODULE: "on" + +.test: &test_template + stage: test + services: + - name: couchdb:1.7.2 + alias: couch17 + - name: couchdb:2.2.0 + alias: couch22 + - name: apache/couchdb:2.3.1 + alias: couch23 + - name: couchdb:3.0.0 + alias: couch30 + variables: + COUCHDB_USER: admin + COUCHDB_PASSWORD: abc123 + KIVIK_TEST_DSN_COUCH17: http://admin:abc123@couch17:5984/ + KIVIK_TEST_DSN_COUCH22: http://admin:abc123@couch22:5984/ + KIVIK_TEST_DSN_COUCH23: http://admin:abc123@couch23:5984/ + KIVIK_TEST_DSN_COUCH30: http://admin:abc123@couch30:5984/ + before_script: + - ./script/complete_couch1.sh ${KIVIK_TEST_DSN_COUCH17} + - ./script/complete_couch2.sh ${KIVIK_TEST_DSN_COUCH22} + - ./script/complete_couch2.sh ${KIVIK_TEST_DSN_COUCH23} + - ./script/complete_couch2.sh ${KIVIK_TEST_DSN_COUCH30} + script: + - go mod download + - ./script/test_version.sh + - go test -race -tags=livetest ./... + +.nomod: &nomod_template + <<: *test_template + script: + - mkdir -p /go/src + - ln -s /builds /go/src/github.com + - cd ${SRCDIR} + - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + - dep ensure && dep status + - ./script/test_version.sh + - go test -race -tags=livetest ./... + +linter: + stage: test + image: golangci/golangci-lint:v1.43 + script: + - go mod download + - golangci-lint run ./... + +coverage: + stage: test + image: golang:1.15 + services: [] + before_script: + - '' + script: + - go mod download + - ./script/coverage.sh + +go-1.11: + <<: *test_template + image: golang:1.11 + +go-1.12: + <<: *test_template + image: golang:1.12 + +go-1.13: + <<: *test_template + image: golang:1.13 + +go-1.14: + <<: *test_template + image: golang:1.14 + +go-1.15: + <<: *test_template + image: golang:1.15 + +go-1.16: + <<: *test_template + image: golang:1.16 + +go-1.17: + <<: *test_template + image: golang:1.17 + +go-rc: + <<: *test_template + image: golang:rc + allow_failure: true diff --git a/vendor/github.com/go-kivik/couchdb/v3/.golangci.toml b/vendor/github.com/go-kivik/couchdb/v3/.golangci.toml new file mode 100644 index 00000000000..d55b300b7d1 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/.golangci.toml @@ -0,0 +1,9 @@ +[output] +format = "colored-line-number" + +[linters] +enable = [ + "gocyclo", "unconvert", "goimports", "unused", "varcheck", + "vetshadow", "misspell", "nakedret", "errcheck", "revive", "ineffassign", + "deadcode", "goconst", "vet", "unparam", "gofmt" +] diff --git a/vendor/github.com/go-kivik/couchdb/v3/LICENSE.md b/vendor/github.com/go-kivik/couchdb/v3/LICENSE.md new file mode 100644 index 00000000000..0a2865e5495 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/LICENSE.md @@ -0,0 +1,13 @@ +Copyright (c) 2017 Jonathan Hall + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/github.com/go-kivik/couchdb/v3/README.md b/vendor/github.com/go-kivik/couchdb/v3/README.md new file mode 100644 index 00000000000..970c7ba5e5c --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/README.md @@ -0,0 +1,35 @@ +[![Build Status](https://travis-ci.org/go-kivik/couchdb.svg?branch=master)](https://travis-ci.org/go-kivik/couchdb) [![Codecov](https://img.shields.io/codecov/c/github/go-kivik/couchdb.svg?style=flat)](https://codecov.io/gh/go-kivik/couchdb) [![GoDoc](https://godoc.org/github.com/go-kivik/couchdb?status.svg)](http://godoc.org/github.com/go-kivik/couchdb) + +# Kivik CouchDB + +CouchDB driver for [Kivik](https://github.com/go-kivik/kivik). + +## Usage + +This package provides an implementation of the +[`github.com/go-kivik/kivik/v3/driver`](http://godoc.org/github.com/go-kivik/kivik/driver) +interface. You must import the driver and can then use the full +[`Kivik`](http://godoc.org/github.com/go-kivik/kivik) API. Please consult the +[Kivik wiki](https://github.com/go-kivik/kivik/wiki) for complete documentation +and coding examples. + +```go +package main + +import ( + "context" + + kivik "github.com/go-kivik/kivik/v3" + _ "github.com/go-kivik/couchdb/v3" // The CouchDB driver +) + +func main() { + client, err := kivik.New(context.TODO(), "couch", "") + // ... +} +``` + +## License + +This software is released under the terms of the Apache 2.0 license. See +LICENCE.md, or read the [full license](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/vendor/github.com/go-kivik/couchdb/v3/attachments.go b/vendor/github.com/go-kivik/couchdb/v3/attachments.go new file mode 100644 index 00000000000..145f84e960d --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/attachments.go @@ -0,0 +1,171 @@ +package couchdb + +import ( + "context" + "errors" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +func (d *db) PutAttachment(ctx context.Context, docID, rev string, att *driver.Attachment, options map[string]interface{}) (newRev string, err error) { + if docID == "" { + return "", missingArg("docID") + } + if att == nil { + return "", missingArg("att") + } + if att.Filename == "" { + return "", missingArg("att.Filename") + } + if att.Content == nil { + return "", missingArg("att.Content") + } + + fullCommit, err := fullCommit(options) + if err != nil { + return "", err + } + + query, err := optionsToParams(options) + if err != nil { + return "", err + } + if rev != "" { + query.Set("rev", rev) + } + var response struct { + Rev string `json:"rev"` + } + opts := &chttp.Options{ + Body: att.Content, + ContentType: att.ContentType, + FullCommit: fullCommit, + Query: query, + } + _, err = d.Client.DoJSON(ctx, http.MethodPut, d.path(chttp.EncodeDocID(docID)+"/"+att.Filename), opts, &response) + if err != nil { + return "", err + } + return response.Rev, nil +} + +func (d *db) GetAttachmentMeta(ctx context.Context, docID, filename string, options map[string]interface{}) (*driver.Attachment, error) { + resp, err := d.fetchAttachment(ctx, http.MethodHead, docID, filename, options) + if err != nil { + return nil, err + } + att, err := decodeAttachment(resp) + return att, err +} + +func (d *db) GetAttachment(ctx context.Context, docID, filename string, options map[string]interface{}) (*driver.Attachment, error) { + resp, err := d.fetchAttachment(ctx, http.MethodGet, docID, filename, options) + if err != nil { + return nil, err + } + return decodeAttachment(resp) +} + +func (d *db) fetchAttachment(ctx context.Context, method, docID, filename string, options map[string]interface{}) (*http.Response, error) { + if method == "" { + return nil, errors.New("method required") + } + if docID == "" { + return nil, missingArg("docID") + } + if filename == "" { + return nil, missingArg("filename") + } + + inm, err := ifNoneMatch(options) + if err != nil { + return nil, err + } + + query, err := optionsToParams(options) + if err != nil { + return nil, err + } + opts := &chttp.Options{ + IfNoneMatch: inm, + Query: query, + } + resp, err := d.Client.DoReq(ctx, method, d.path(chttp.EncodeDocID(docID)+"/"+filename), opts) + if err != nil { + return nil, err + } + return resp, chttp.ResponseError(resp) +} + +func decodeAttachment(resp *http.Response) (*driver.Attachment, error) { + cType, err := getContentType(resp) + if err != nil { + return nil, err + } + digest, err := getDigest(resp) + if err != nil { + return nil, err + } + + return &driver.Attachment{ + ContentType: cType, + Digest: digest, + Size: resp.ContentLength, + Content: resp.Body, + }, nil +} + +func getContentType(resp *http.Response) (string, error) { + ctype := resp.Header.Get("Content-Type") + if _, ok := resp.Header["Content-Type"]; !ok { + return "", &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: errors.New("no Content-Type in response")} + } + return ctype, nil +} + +func getDigest(resp *http.Response) (string, error) { + etag, ok := chttp.ETag(resp) + if !ok { + return "", &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: errors.New("ETag header not found")} + } + return etag, nil +} + +func (d *db) DeleteAttachment(ctx context.Context, docID, rev, filename string, options map[string]interface{}) (newRev string, err error) { + if docID == "" { + return "", missingArg("docID") + } + if rev == "" { + return "", missingArg("rev") + } + if filename == "" { + return "", missingArg("filename") + } + + fullCommit, err := fullCommit(options) + if err != nil { + return "", err + } + + query, err := optionsToParams(options) + if err != nil { + return "", err + } + query.Set("rev", rev) + var response struct { + Rev string `json:"rev"` + } + + opts := &chttp.Options{ + FullCommit: fullCommit, + Query: query, + } + _, err = d.Client.DoJSON(ctx, http.MethodDelete, d.path(chttp.EncodeDocID(docID)+"/"+filename), opts, &response) + if err != nil { + return "", err + } + return response.Rev, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/auth.go b/vendor/github.com/go-kivik/couchdb/v3/auth.go new file mode 100644 index 00000000000..21015e5b32b --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/auth.go @@ -0,0 +1,151 @@ +package couchdb + +import ( + "context" + "errors" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3" +) + +func (c *client) Authenticate(ctx context.Context, a interface{}) error { + if auth, ok := a.(chttp.Authenticator); ok { + return auth.Authenticate(c.Client) + } + if auth, ok := a.(Authenticator); ok { + return auth.auth(ctx, c) + } + return &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: errors.New("kivik: invalid authenticator")} +} + +// Authenticator is a CouchDB authenticator. Direct use of the Authenticator +// interface is for advanced usage. Typically, it is sufficient to provide +// a username and password in the connecting DSN to perform authentication. +// Only use one of these provided authenticators if you have specific, special +// needs. +type Authenticator interface { + auth(context.Context, *client) error +} + +type xportAuth struct { + http.RoundTripper +} + +var _ Authenticator = &xportAuth{} + +func (a *xportAuth) auth(_ context.Context, c *client) error { + if c.Client.Client.Transport != nil { + return &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: errors.New("kivik: HTTP client transport already set")} + } + c.Client.Client.Transport = a.RoundTripper + return nil +} + +// SetTransport returns an authenticator that can be used to set a client +// connection's HTTP Transport. This can be used to control proxies, TLS +// configuration, keep-alives, compression, etc. +// +// Example: +// +// setXport := couchdb.SetTransport(&http.Transport{ +// // .. custom config +// }) +// client, _ := kivik.New( ... ) +// client.Authenticate(setXport) +func SetTransport(t http.RoundTripper) Authenticator { + return &xportAuth{t} +} + +type authFunc func(context.Context, *client) error + +func (a authFunc) auth(ctx context.Context, c *client) error { + return a(ctx, c) +} + +// BasicAuth provides support for HTTP Basic authentication. +func BasicAuth(user, password string) Authenticator { + auth := chttp.BasicAuth{Username: user, Password: password} + return authFunc(func(ctx context.Context, c *client) error { + return auth.Authenticate(c.Client) + }) +} + +// CookieAuth provides support for CouchDB cookie-based authentication. +func CookieAuth(user, password string) Authenticator { + auth := chttp.CookieAuth{Username: user, Password: password} + return authFunc(func(ctx context.Context, c *client) error { + return auth.Authenticate(c.Client) + }) +} + +// JWTAuth provides support for CouchDB JWT-based authentication. Kivik does +// no validation on the JWT token; it is passed verbatim to the server. +// +// See https://docs.couchdb.org/en/latest/api/server/authn.html#jwt-authentication +func JWTAuth(token string) Authenticator { + auth := chttp.JWTAuth{Token: token} + return authFunc(func(ctx context.Context, c *client) error { + return auth.Authenticate(c.Client) + }) +} + +// ProxyAuth provides support for Proxy authentication. +// +// The `secret` argument represents the `couch_httpd_auth/secret` value +// configured on the CouchDB server. See https://docs.couchdb.org/en/stable/config/auth.html#couch_httpd_auth/secret +// If `secret` is the empty string, the X-Auth-CouchDB-Token header will not be +// set, to support disabling the `proxy_use_secret` server setting. See https://docs.couchdb.org/en/stable/config/auth.html#couch_httpd_auth/proxy_use_secret +// +// The optional `headers` map may be passed to use non-standard header names. +// For instance, to use `X-User` in place of the `X-Auth-CouchDB-Username` +// header, pass a value of {"X-Auth-CouchDB-UserName": "X-User"}. +// The relevant headers are X-Auth-CouchDB-UserName, X-Auth-CouchDB-Roles, and +// X-Auth-CouchDB-Token. +// +// See https://docs.couchdb.org/en/stable/api/server/authn.html?highlight=proxy%20auth#proxy-authentication +func ProxyAuth(user, secret string, roles []string, headers ...map[string]string) Authenticator { + headerOverrides := http.Header{} + for _, h := range headers { + for k, v := range h { + headerOverrides.Set(k, v) + } + } + auth := chttp.ProxyAuth{Username: user, Secret: secret, Roles: roles, Headers: headerOverrides} + return authFunc(func(ctx context.Context, c *client) error { + return auth.Authenticate(c.Client) + }) +} + +type rawCookie struct { + cookie *http.Cookie + next http.RoundTripper +} + +var ( + _ Authenticator = &rawCookie{} + _ http.RoundTripper = &rawCookie{} +) + +func (a *rawCookie) auth(_ context.Context, c *client) error { + if c.Client.Client.Transport != nil { + return &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: errors.New("kivik: HTTP client transport already set")} + } + a.next = c.Client.Client.Transport + if a.next == nil { + a.next = http.DefaultTransport + } + c.Client.Client.Transport = a + return nil +} + +func (a *rawCookie) RoundTrip(r *http.Request) (*http.Response, error) { + r.AddCookie(a.cookie) + return a.next.RoundTrip(r) +} + +// SetCookie adds cookie to all outbound requests. This is useful when using +// kivik as a proxy. +func SetCookie(cookie *http.Cookie) Authenticator { + return &rawCookie{cookie: cookie} +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/bulk.go b/vendor/github.com/go-kivik/couchdb/v3/bulk.go new file mode 100644 index 00000000000..8081cd11691 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/bulk.go @@ -0,0 +1,106 @@ +package couchdb + +import ( + "context" + "encoding/json" + "errors" + "io" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +type bulkResults struct { + body io.ReadCloser + dec *json.Decoder +} + +var _ driver.BulkResults = &bulkResults{} + +func newBulkResults(body io.ReadCloser) (*bulkResults, error) { + dec := json.NewDecoder(body) + // Consume the opening '[' char + if err := consumeDelim(dec, json.Delim('[')); err != nil { + return nil, err + } + return &bulkResults{ + body: body, + dec: dec, + }, nil +} + +func (r *bulkResults) Next(update *driver.BulkResult) error { + if !r.dec.More() { + if err := consumeDelim(r.dec, json.Delim(']')); err != nil { + return err + } + return io.EOF + } + var updateResult struct { + ID string `json:"id"` + Rev string `json:"rev"` + Error string `json:"error"` + Reason string `json:"reason"` + } + if err := r.dec.Decode(&updateResult); err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + update.ID = updateResult.ID + update.Rev = updateResult.Rev + update.Error = nil + if updateResult.Error != "" { + var status int + switch updateResult.Error { + case "conflict": + status = http.StatusConflict + default: + status = http.StatusInternalServerError + } + update.Error = &kivik.Error{HTTPStatus: status, FromServer: true, Err: errors.New(updateResult.Reason)} + } + return nil +} + +func (r *bulkResults) Close() error { + return r.body.Close() +} + +func (d *db) BulkDocs(ctx context.Context, docs []interface{}, options map[string]interface{}) (driver.BulkResults, error) { + if options == nil { + options = make(map[string]interface{}) + } + fullCommit, err := fullCommit(options) + if err != nil { + return nil, err + } + options["docs"] = docs + opts := &chttp.Options{ + GetBody: chttp.BodyEncoder(options), + FullCommit: fullCommit, + } + resp, err := d.Client.DoReq(ctx, http.MethodPost, d.path("_bulk_docs"), opts) + if err != nil { + return nil, err + } + switch resp.StatusCode { + case http.StatusCreated: + // Nothing to do + case http.StatusExpectationFailed: + err = &chttp.HTTPError{ + Response: resp, + Reason: "one or more document was rejected", + } + default: + // All other errors can consume the response body and return immediately + if e := chttp.ResponseError(resp); e != nil { + return nil, e + } + } + results, bulkErr := newBulkResults(resp.Body) + if bulkErr != nil { + return nil, bulkErr + } + return results, err +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/bulkget.go b/vendor/github.com/go-kivik/couchdb/v3/bulkget.go new file mode 100644 index 00000000000..5c9fb8c456d --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/bulkget.go @@ -0,0 +1,61 @@ +package couchdb + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3/driver" +) + +func (d *db) BulkGet(ctx context.Context, docs []driver.BulkGetReference, opts map[string]interface{}) (driver.Rows, error) { + query, err := optionsToParams(opts) + if err != nil { + return nil, err + } + body := map[string]interface{}{ + "docs": docs, + } + options := &chttp.Options{ + Query: query, + GetBody: chttp.BodyEncoder(body), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + resp, err := d.Client.DoReq(ctx, http.MethodPost, d.path("_bulk_get"), options) + if err != nil { + return nil, err + } + if err = chttp.ResponseError(resp); err != nil { + return nil, err + } + return newBulkGetRows(ctx, resp.Body), nil +} + +// BulkGetError represents an error for a single document returned by a +// GetBulk call. +type BulkGetError struct { + ID string `json:"id"` + Rev string `json:"rev"` + Err string `json:"error"` + Reason string `json:"reason"` +} + +var _ error = &BulkGetError{} + +func (e *BulkGetError) Error() string { + return fmt.Sprintf("%s: %s", e.Err, e.Reason) +} + +type bulkResultDoc struct { + Doc json.RawMessage `json:"ok,omitempty"` + Error *BulkGetError `json:"error,omitempty"` +} + +type bulkResult struct { + ID string `json:"id"` + Docs []bulkResultDoc `json:"docs"` +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/changes.go b/vendor/github.com/go-kivik/couchdb/v3/changes.go new file mode 100644 index 00000000000..1e742257026 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/changes.go @@ -0,0 +1,121 @@ +package couchdb + +import ( + "context" + "encoding/json" + "errors" + "io" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +// Changes returns the changes stream for the database. +func (d *db) Changes(ctx context.Context, opts map[string]interface{}) (driver.Changes, error) { + key := "results" + if f, ok := opts["feed"]; ok { + if f == "eventsource" { + return nil, &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: errors.New("kivik: eventsource feed not supported, use 'continuous'")} + } + if f == "continuous" { + key = "" + } + } + query, err := optionsToParams(opts) + if err != nil { + return nil, err + } + options := &chttp.Options{ + Query: query, + } + resp, err := d.Client.DoReq(ctx, http.MethodGet, d.path("_changes"), options) + if err != nil { + return nil, err + } + if err = chttp.ResponseError(resp); err != nil { + return nil, err + } + etag, _ := chttp.ETag(resp) + return newChangesRows(ctx, key, resp.Body, etag), nil +} + +type continuousChangesParser struct{} + +func (p *continuousChangesParser) parseMeta(i interface{}, dec *json.Decoder, key string) error { + meta := i.(*changesMeta) + return meta.parseMeta(key, dec) +} + +func (p *continuousChangesParser) decodeItem(i interface{}, dec *json.Decoder) error { + row := i.(*driver.Change) + ch := &change{Change: row} + if err := dec.Decode(ch); err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + ch.Change.Seq = string(ch.Seq) + return nil +} + +type changesMeta struct { + lastSeq sequenceID + pending int64 +} + +// parseMeta parses result metadata +func (m *changesMeta) parseMeta(key string, dec *json.Decoder) error { + switch key { + case "last_seq": + return dec.Decode(&m.lastSeq) + case "pending": + return dec.Decode(&m.pending) + default: + // Just consume the value, since we don't know what it means. + var discard json.RawMessage + return dec.Decode(&discard) + } +} + +type changesRows struct { + *iter + etag string +} + +func newChangesRows(ctx context.Context, key string, r io.ReadCloser, etag string) *changesRows { + var meta *changesMeta + if key != "" { + meta = &changesMeta{} + } + return &changesRows{ + iter: newIter(ctx, meta, key, r, &continuousChangesParser{}), + etag: etag, + } +} + +var _ driver.Changes = &changesRows{} + +type change struct { + *driver.Change + Seq sequenceID `json:"seq"` +} + +func (r *changesRows) Next(row *driver.Change) error { + row.Deleted = false + return r.iter.next(row) +} + +// LastSeq returns the last sequence ID. +func (r *changesRows) LastSeq() string { + return string(r.iter.meta.(*changesMeta).lastSeq) +} + +// Pending returns the pending count. +func (r *changesRows) Pending() int64 { + return r.iter.meta.(*changesMeta).pending +} + +// ETag returns the unquoted ETag header for the CouchDB response, if any. +func (r *changesRows) ETag() string { + return r.etag +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/auth.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/auth.go new file mode 100644 index 00000000000..d69c5a82f95 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/auth.go @@ -0,0 +1,22 @@ +package chttp + +import ( + "net/http/cookiejar" + + "golang.org/x/net/publicsuffix" +) + +// Authenticator is an interface that provides authentication to a server. +type Authenticator interface { + Authenticate(*Client) error +} + +func (a *CookieAuth) setCookieJar() { + // If a jar is already set, just use it + if a.client.Jar != nil { + return + } + // cookiejar.New never returns an error + jar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List}) + a.client.Jar = jar +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/basicauth.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/basicauth.go new file mode 100644 index 00000000000..f927c557624 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/basicauth.go @@ -0,0 +1,55 @@ +package chttp + +import ( + "net/http" +) + +// BasicAuth provides HTTP Basic Auth for a client. +type BasicAuth struct { + Username string + Password string + + // transport stores the original transport that is overridden by this auth + // mechanism + transport http.RoundTripper +} + +var _ Authenticator = &BasicAuth{} + +// RoundTrip fulfills the http.RoundTripper interface. It sets HTTP Basic Auth +// on outbound requests. +func (a *BasicAuth) RoundTrip(req *http.Request) (*http.Response, error) { + req.SetBasicAuth(a.Username, a.Password) + return a.transport.RoundTrip(req) +} + +// Authenticate sets HTTP Basic Auth headers for the client. +func (a *BasicAuth) Authenticate(c *Client) error { + a.transport = c.Transport + if a.transport == nil { + a.transport = http.DefaultTransport + } + c.Transport = a + return nil +} + +// JWTAuth provides JWT based auth for a client. +type JWTAuth struct { + Token string + + transport http.RoundTripper +} + +func (a *JWTAuth) RoundTrip(req *http.Request) (*http.Response, error) { + req.Header.Set("Authorization", "Bearer "+a.Token) + return a.transport.RoundTrip(req) +} + +func (a *JWTAuth) Authenticate(c *Client) error { + a.transport = c.Transport + if a.transport == nil { + a.transport = http.DefaultTransport + } + c.Transport = a + return nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/chttp.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/chttp.go new file mode 100644 index 00000000000..929c5aa7ec6 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/chttp.go @@ -0,0 +1,535 @@ +// Package chttp provides a minimal HTTP driver backend for communicating with +// CouchDB servers. +package chttp + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/url" + "os" + "regexp" + "runtime" + "strings" + "sync" + "syscall" + + "github.com/go-kivik/kivik/v3" +) + +const typeJSON = "application/json" + +// The default UserAgent values +const ( + UserAgent = "Kivik chttp" + Version = "3.3.0" +) + +// Client represents a client connection. It embeds an *http.Client +type Client struct { + // UserAgents is appended to set the User-Agent header. Typically it should + // contain pairs of product name and version. + UserAgents []string + + *http.Client + + rawDSN string + dsn *url.URL + auth Authenticator + authMU sync.Mutex +} + +// New returns a connection to a remote CouchDB server. If credentials are +// included in the URL, requests will be authenticated using Cookie Auth. To +// use HTTP BasicAuth or some other authentication mechanism, do not specify +// credentials in the URL, and instead call the Auth() method later. +func New(dsn string) (*Client, error) { + return NewWithClient(&http.Client{}, dsn) +} + +// NewWithClient works the same as New(), but allows providing a custom +// *http.Client for all network connections. +func NewWithClient(client *http.Client, dsn string) (*Client, error) { + dsnURL, err := parseDSN(dsn) + if err != nil { + return nil, err + } + user := dsnURL.User + dsnURL.User = nil + c := &Client{ + Client: client, + dsn: dsnURL, + rawDSN: dsn, + } + if user != nil { + password, _ := user.Password() + err := c.Auth(&CookieAuth{ + Username: user.Username(), + Password: password, + }) + if err != nil { + return nil, err + } + } + return c, nil +} + +func parseDSN(dsn string) (*url.URL, error) { + if dsn == "" { + return nil, &curlError{ + httpStatus: http.StatusBadRequest, + curlStatus: ExitFailedToInitialize, + error: errors.New("no URL specified"), + } + } + if !strings.HasPrefix(dsn, "http://") && !strings.HasPrefix(dsn, "https://") { + dsn = "http://" + dsn + } + dsnURL, err := url.Parse(dsn) + if err != nil { + return nil, fullError(http.StatusBadRequest, ExitStatusURLMalformed, err) + } + if dsnURL.Path == "" { + dsnURL.Path = "/" + } + return dsnURL, nil +} + +// DSN returns the unparsed DSN used to connect. +func (c *Client) DSN() string { + return c.rawDSN +} + +// Auth authenticates using the provided Authenticator. +func (c *Client) Auth(a Authenticator) error { + if c.auth != nil { + return errors.New("auth already set") + } + if err := a.Authenticate(c); err != nil { + return err + } + c.auth = a + return nil +} + +// Options are optional parameters which may be sent with a request. +type Options struct { + // Accept sets the request's Accept header. Defaults to "application/json". + // To specify any, use "*/*". + Accept string + + // ContentType sets the requests's Content-Type header. Defaults to "application/json". + ContentType string + + // ContentLength, if set, sets the ContentLength of the request + ContentLength int64 + + // Body sets the body of the request. + Body io.ReadCloser + + // GetBody is a function to set the body, and can be used on retries. If + // set, Body is ignored. + GetBody func() (io.ReadCloser, error) + + // JSON is an arbitrary data type which is marshaled to the request's body. + // It an error to set both Body and JSON on the same request. When this is + // set, ContentType is unconditionally set to 'application/json'. Note that + // for large JSON payloads, it can be beneficial to do your own JSON stream + // encoding, so that the request can be live on the wire during JSON + // encoding. + JSON interface{} + + // FullCommit adds the X-Couch-Full-Commit: true header to requests + FullCommit bool + + // IfNoneMatch adds the If-None-Match header. The value will be quoted if + // it is not already. + IfNoneMatch string + + // Query is appended to the exiting url, if present. If the passed url + // already contains query parameters, the values in Query are appended. + // No merging takes place. + Query url.Values + + // Header is a list of default headers to be set on the request. + Header http.Header +} + +// Response represents a response from a CouchDB server. +type Response struct { + *http.Response + + // ContentType is the base content type, parsed from the response headers. + ContentType string +} + +// DecodeJSON unmarshals the response body into i. This method consumes and +// closes the response body. +func DecodeJSON(r *http.Response, i interface{}) error { + defer r.Body.Close() // nolint: errcheck + if err := json.NewDecoder(r.Body).Decode(i); err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + return nil +} + +// DoJSON combines DoReq() and, ResponseError(), and (*Response).DecodeJSON(), and +// closes the response body. +func (c *Client) DoJSON(ctx context.Context, method, path string, opts *Options, i interface{}) (*http.Response, error) { + res, err := c.DoReq(ctx, method, path, opts) + if err != nil { + return res, err + } + if err = ResponseError(res); err != nil { + return res, err + } + err = DecodeJSON(res, i) + return res, err +} + +// NewRequest returns a new *http.Request to the CouchDB server, and the +// specified path. The host, schema, etc, of the specified path are ignored. +func (c *Client) NewRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error) { + fullPath := path + if cPath := strings.TrimSuffix(c.dsn.Path, "/"); cPath != "" { + fullPath = cPath + "/" + strings.TrimPrefix(path, "/") + } + reqPath, err := url.Parse(fullPath) + if err != nil { + return nil, fullError(http.StatusBadRequest, ExitStatusURLMalformed, err) + } + u := *c.dsn // Make a copy + u.Path = reqPath.Path + u.RawQuery = reqPath.RawQuery + req, err := http.NewRequest(method, u.String(), body) + if err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + req.Header.Add("User-Agent", c.userAgent()) + return req.WithContext(ctx), nil +} + +// DoReq does an HTTP request. An error is returned only if there was an error +// processing the request. In particular, an error status code, such as 400 +// or 500, does _not_ cause an error to be returned. +func (c *Client) DoReq(ctx context.Context, method, path string, opts *Options) (*http.Response, error) { + if method == "" { + return nil, errors.New("chttp: method required") + } + var body io.Reader + if opts != nil { + if opts.GetBody != nil { + var err error + opts.Body, err = opts.GetBody() + if err != nil { + return nil, err + } + } + if opts.Body != nil { + body = opts.Body + defer opts.Body.Close() // nolint: errcheck + } + } + req, err := c.NewRequest(ctx, method, path, body) + if err != nil { + return nil, err + } + fixPath(req, path) + setHeaders(req, opts) + setQuery(req, opts) + if opts != nil { + req.GetBody = opts.GetBody + } + + trace := ContextClientTrace(ctx) + if trace != nil { + trace.httpRequest(req) + trace.httpRequestBody(req) + } + + response, err := c.Do(req) + if trace != nil { + trace.httpResponse(response) + trace.httpResponseBody(response) + } + return response, netError(err) +} + +func netError(err error) error { + if err == nil { + return nil + } + if urlErr, ok := err.(*url.Error); ok { + // If this error was generated by EncodeBody, it may have an emedded + // status code (!= 500), which we should honor. + status := kivik.StatusCode(urlErr.Err) + if status == http.StatusInternalServerError { + status = http.StatusBadGateway + } + return fullError(status, curlStatus(err), err) + } + if status := kivik.StatusCode(err); status != http.StatusInternalServerError { + return err + } + return fullError(http.StatusBadGateway, ExitUnknownFailure, err) +} + +var tooManyRecirectsRE = regexp.MustCompile(`stopped after \d+ redirect`) + +func curlStatus(err error) int { + if urlErr, ok := err.(*url.Error); ok { + // Timeout error + if urlErr.Timeout() { + return ExitOperationTimeout + } + // Host lookup failure + if opErr, ok := urlErr.Err.(*net.OpError); ok { + if _, ok := opErr.Err.(*net.DNSError); ok { + return ExitHostNotResolved + } + if scErr, ok := opErr.Err.(*os.SyscallError); ok { + if errno, ok := scErr.Err.(syscall.Errno); ok { + if errno == syscall.ECONNREFUSED { + return ExitFailedToConnect + } + } + } + } + + if tooManyRecirectsRE.MatchString(urlErr.Err.Error()) { + return ExitTooManyRedirects + } + } + return 0 +} + +// fixPath sets the request's URL.RawPath to work with escaped characters in +// paths. +func fixPath(req *http.Request, path string) { + // Remove any query parameters + parts := strings.SplitN(path, "?", 2) + req.URL.RawPath = "/" + strings.TrimPrefix(parts[0], "/") +} + +// BodyEncoder returns a function which returns the encoded body. It is meant +// to be used as a http.Request.GetBody value. +func BodyEncoder(i interface{}) func() (io.ReadCloser, error) { + return func() (io.ReadCloser, error) { + return EncodeBody(i), nil + } +} + +// EncodeBody JSON encodes i to an io.ReadCloser. If an encoding error +// occurs, it will be returned on the next read. +func EncodeBody(i interface{}) io.ReadCloser { + done := make(chan struct{}) + r, w := io.Pipe() + go func() { + defer close(done) + var err error + switch t := i.(type) { + case []byte: + _, err = w.Write(t) + case json.RawMessage: // Only needed for Go 1.7 + _, err = w.Write(t) + case string: + _, err = w.Write([]byte(t)) + default: + err = json.NewEncoder(w).Encode(i) + switch err.(type) { + case *json.MarshalerError, *json.UnsupportedTypeError, *json.UnsupportedValueError: + err = &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + } + _ = w.CloseWithError(err) + }() + return &ebReader{ + ReadCloser: r, + done: done, + } +} + +type ebReader struct { + io.ReadCloser + done <-chan struct{} +} + +var _ io.ReadCloser = &ebReader{} + +func (r *ebReader) Close() error { + err := r.ReadCloser.Close() + <-r.done + return err +} + +func setHeaders(req *http.Request, opts *Options) { + accept := typeJSON + contentType := typeJSON + if opts != nil { + if opts.Accept != "" { + accept = opts.Accept + } + if opts.ContentType != "" { + contentType = opts.ContentType + } + if opts.FullCommit { + req.Header.Add("X-Couch-Full-Commit", "true") + } + if opts.IfNoneMatch != "" { + inm := "\"" + strings.Trim(opts.IfNoneMatch, "\"") + "\"" + req.Header.Set("If-None-Match", inm) + } + if opts.ContentLength != 0 { + req.ContentLength = opts.ContentLength + } + for k, v := range opts.Header { + if _, ok := req.Header[k]; !ok { + req.Header[k] = v + } + } + } + req.Header.Add("Accept", accept) + req.Header.Add("Content-Type", contentType) +} + +func setQuery(req *http.Request, opts *Options) { + if opts == nil || len(opts.Query) == 0 { + return + } + if req.URL.RawQuery == "" { + req.URL.RawQuery = opts.Query.Encode() + return + } + req.URL.RawQuery = strings.Join([]string{req.URL.RawQuery, opts.Query.Encode()}, "&") +} + +// DoError is the same as DoReq(), followed by checking the response error. This +// method is meant for cases where the only information you need from the +// response is the status code. It unconditionally closes the response body. +func (c *Client) DoError(ctx context.Context, method, path string, opts *Options) (*http.Response, error) { + res, err := c.DoReq(ctx, method, path, opts) + if err != nil { + return res, err + } + if res.Body != nil { + defer res.Body.Close() // nolint: errcheck + } + err = ResponseError(res) + return res, err +} + +// ETag returns the unquoted ETag value, and a bool indicating whether it was +// found. +func ETag(resp *http.Response) (string, bool) { + if resp == nil { + return "", false + } + etag, ok := resp.Header["Etag"] + if !ok { + etag, ok = resp.Header["ETag"] // nolint: staticcheck + } + if !ok { + return "", false + } + return strings.Trim(etag[0], `"`), ok +} + +// GetRev extracts the revision from the response's Etag header +func GetRev(resp *http.Response) (rev string, err error) { + if err = ResponseError(resp); err != nil { + return "", err + } + rev, ok := ETag(resp) + if ok { + return rev, nil + } + return extractRev(resp) +} + +// When the ETag header is missing, which can happen, for example, when doing +// a request with revs_info=true. This means we need to look through the +// body of the request for the revision. Fortunately, CouchDB tends to send +// the _id and _rev fields first, so we shouldn't need to parse the entire +// body. The important thing is that resp.Body must be restored, so that the +// normal document scanning can take place as usual. +func extractRev(resp *http.Response) (string, error) { + if resp.Request.Method == http.MethodHead { + return "", errors.New("unable to determine document revision") + } + buf := &bytes.Buffer{} + r := io.TeeReader(resp.Body, buf) + defer func() { + // Restore the original resp.Body + resp.Body = struct { + io.Reader + io.Closer + }{ + Reader: io.MultiReader(buf, resp.Body), + Closer: resp.Body, + } + }() + rev, err := readRev(r) + if err != nil { + return "", fmt.Errorf("unable to determine document revision: %s", err) + } + return rev, nil +} + +// readRev searches r for a `_rev` field, and returns its value without reading +// the rest of the JSON stream. +func readRev(r io.Reader) (string, error) { + dec := json.NewDecoder(r) + tk, err := dec.Token() + if err != nil { + return "", err + } + if tk != json.Delim('{') { + return "", fmt.Errorf("Expected %q token, found %q", '{', tk) + } + for dec.More() { + tk, err = dec.Token() + if err != nil { + return "", err + } + if tk == "_rev" { + tk, err = dec.Token() + if err != nil { + return "", err + } + if value, ok := tk.(string); ok { + return value, nil + } + return "", fmt.Errorf("found %q in place of _rev value", tk) + } + } + + return "", errors.New("_rev key not found in response body") +} + +type exitStatuser interface { + ExitStatus() int +} + +// ExitStatus returns the curl exit status embedded in the error, or 1 (unknown +// error), if there was no specified exit status. If err is nil, ExitStatus +// returns 0. +func ExitStatus(err error) int { + if err == nil { + return 0 + } + if statuser, ok := err.(exitStatuser); ok { // nolint: misspell + return statuser.ExitStatus() + } + return 0 +} + +func (c *Client) userAgent() string { + ua := fmt.Sprintf("%s/%s (Language=%s; Platform=%s/%s)", + UserAgent, Version, runtime.Version(), runtime.GOARCH, runtime.GOOS) + return strings.Join(append([]string{ua}, c.UserAgents...), " ") +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/constants.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/constants.go new file mode 100644 index 00000000000..b56077d34f0 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/constants.go @@ -0,0 +1,7 @@ +package chttp + +// Standard headers used by CouchDB. +const ( + HeaderDestination = "Destination" + HeaderIdempotencyKey = "X-Idempotency-Key" +) diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/cookieauth.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/cookieauth.go new file mode 100644 index 00000000000..b55a3404842 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/cookieauth.go @@ -0,0 +1,127 @@ +package chttp + +import ( + "context" + "net/http" + "time" + + kivik "github.com/go-kivik/kivik/v3" +) + +// CookieAuth provides CouchDB Cookie auth services as described at +// http://docs.couchdb.org/en/2.0.0/api/server/authn.html#cookie-authentication +// +// CookieAuth stores authentication state after use, so should not be re-used. +type CookieAuth struct { + Username string `json:"name"` + Password string `json:"password"` + + client *Client + // transport stores the original transport that is overridden by this auth + // mechanism + transport http.RoundTripper +} + +var _ Authenticator = &CookieAuth{} + +// Authenticate initiates a session with the CouchDB server. +func (a *CookieAuth) Authenticate(c *Client) error { + a.client = c + a.setCookieJar() + a.transport = c.Transport + if a.transport == nil { + a.transport = http.DefaultTransport + } + c.Transport = a + return nil +} + +// shouldAuth returns true if there is no cookie set, or if it has expired. +func (a *CookieAuth) shouldAuth(req *http.Request) bool { + if _, err := req.Cookie(kivik.SessionCookieName); err == nil { + return false + } + cookie := a.Cookie() + if cookie == nil { + return true + } + if !cookie.Expires.IsZero() { + return cookie.Expires.Before(time.Now().Add(time.Minute)) + } + // If we get here, it means the server did not include an expiry time in + // the session cookie. Some CouchDB configurations do this, but rather than + // re-authenticating for every request, we'll let the session expire. A + // future change might be to make a client-configurable option to set the + // re-authentication timeout. + return false +} + +// Cookie returns the current session cookie if found, or nil if not. +func (a *CookieAuth) Cookie() *http.Cookie { + if a.client == nil { + return nil + } + for _, cookie := range a.client.Jar.Cookies(a.client.dsn) { + if cookie.Name == kivik.SessionCookieName { + return cookie + } + } + return nil +} + +var authInProgress = &struct{ name string }{"in progress"} + +// RoundTrip fulfills the http.RoundTripper interface. It sets +// (re-)authenticates when the cookie has expired or is not yet set. +// It also drops the auth cookie if we receive a 401 response to ensure +// that follow up requests can try to authenticate again. +func (a *CookieAuth) RoundTrip(req *http.Request) (*http.Response, error) { + if err := a.authenticate(req); err != nil { + return nil, err + } + + res, err := a.transport.RoundTrip(req) + if err != nil { + return res, err + } + + if res != nil && res.StatusCode == http.StatusUnauthorized { + if cookie := a.Cookie(); cookie != nil { + // set to expire yesterday to allow us to ditch it + cookie.Expires = time.Now().AddDate(0, 0, -1) + a.client.Jar.SetCookies(a.client.dsn, []*http.Cookie{cookie}) + } + } + return res, nil +} + +func (a *CookieAuth) authenticate(req *http.Request) error { + ctx := req.Context() + if inProg, _ := ctx.Value(authInProgress).(bool); inProg { + return nil + } + if !a.shouldAuth(req) { + return nil + } + a.client.authMU.Lock() + defer a.client.authMU.Unlock() + if c := a.Cookie(); c != nil { + // In case another simultaneous process authenticated successfully first + req.AddCookie(c) + return nil + } + ctx = context.WithValue(ctx, authInProgress, true) + opts := &Options{ + GetBody: BodyEncoder(a), + Header: http.Header{ + HeaderIdempotencyKey: []string{}, + }, + } + if _, err := a.client.DoError(ctx, http.MethodPost, "/_session", opts); err != nil { + return err + } + if c := a.Cookie(); c != nil { + req.AddCookie(c) + } + return nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/encode.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/encode.go new file mode 100644 index 00000000000..82e04ac3030 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/encode.go @@ -0,0 +1,31 @@ +package chttp + +import ( + "net/url" + "strings" +) + +const ( + prefixDesign = "_design/" + prefixLocal = "_local/" +) + +// EncodeDocID encodes a document ID according to CouchDB's path encoding rules. +// +// In particular: +// - '_design/' and '_local/' prefixes are unaltered. +// - The rest of the docID is Query-URL encoded, except that spaces are converted to %20. See https://github.com/apache/couchdb/issues/3565 for an +// explanation. +func EncodeDocID(docID string) string { + for _, prefix := range []string{prefixDesign, prefixLocal} { + if strings.HasPrefix(docID, prefix) { + return prefix + encodeDocID(strings.TrimPrefix(docID, prefix)) + } + } + return encodeDocID(docID) +} + +func encodeDocID(docID string) string { + docID = url.QueryEscape(docID) + return strings.Replace(docID, "+", "%20", -1) // Ensure space is encoded as %20, not '+', so that if CouchDB ever fixes the encoding, we won't break +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/errors.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/errors.go new file mode 100644 index 00000000000..49e6a346f87 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/errors.go @@ -0,0 +1,108 @@ +package chttp + +import ( + "encoding/json" + "fmt" + "mime" + "net/http" +) + +// HTTPError is an error that represents an HTTP transport error. +type HTTPError struct { + // Response is the HTTP response received by the client. Typically the + // response body has already been consumed, but the response and request + // headers and other metadata will typically be in tact for debugging + // purposes. + Response *http.Response `json:"-"` + + // Reason is the server-supplied error reason. + Reason string `json:"reason"` + + exitStatus int +} + +func (e *HTTPError) Error() string { + if e.Reason == "" { + return http.StatusText(e.StatusCode()) + } + if statusText := http.StatusText(e.StatusCode()); statusText != "" { + return fmt.Sprintf("%s: %s", statusText, e.Reason) + } + return e.Reason +} + +// StatusCode returns the embedded status code. +func (e *HTTPError) StatusCode() int { + return e.Response.StatusCode +} + +// ExitStatus returns the embedded exit status. +func (e *HTTPError) ExitStatus() int { + return e.exitStatus +} + +// Format implements fmt.Formatter +func (e *HTTPError) Format(f fmt.State, c rune) { + formatError(e, f, c) +} + +// FormatError satisfies the Go 1.13 errors.Formatter interface +// (golang.org/x/xerrors.Formatter for older versions of Go). +func (e *HTTPError) FormatError(p printer) error { + p.Print(e.Error()) + if p.Detail() { + p.Printf("REQUEST: %s %s (%d bytes)", e.Response.Request.Method, e.Response.Request.URL.String(), e.Response.Request.ContentLength) + p.Printf("\nRESPONSE: %d / %s (%d bytes)\n", e.Response.StatusCode, http.StatusText(e.Response.StatusCode), e.Response.ContentLength) + } + return nil +} + +// ResponseError returns an error from an *http.Response. +func ResponseError(resp *http.Response) error { + if resp.StatusCode < 400 { + return nil + } + if resp.Body != nil { + defer resp.Body.Close() // nolint: errcheck + } + httpErr := &HTTPError{ + Response: resp, + exitStatus: ExitNotRetrieved, + } + if resp.Request.Method != "HEAD" && resp.ContentLength != 0 { + if ct, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type")); ct == typeJSON { + _ = json.NewDecoder(resp.Body).Decode(httpErr) + } + } + return httpErr +} + +type curlError struct { + curlStatus int + httpStatus int + error +} + +func (e *curlError) ExitStatus() int { + return e.curlStatus +} + +func (e *curlError) StatusCode() int { + return e.httpStatus +} + +func fullError(httpStatus, curlStatus int, err error) error { + return &curlError{ + curlStatus: curlStatus, + httpStatus: httpStatus, + error: err, + } +} + +func (e *curlError) Cause() error { + return e.error +} + +func (e *curlError) Unwrap() error { + return e.error +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/exitstatus.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/exitstatus.go new file mode 100644 index 00000000000..44aa28df82f --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/exitstatus.go @@ -0,0 +1,63 @@ +package chttp + +// Exit statuses, borrowed from Curl. Not all Curl statuses are represented here. +const ( + // Exited with an unknown failure. + ExitUnknownFailure = 1 + // Failed to initialize. + ExitFailedToInitialize = 2 + // URL malformed. The syntax was not correct. + ExitStatusURLMalformed = 3 + // The given remote host was not resolved. + ExitHostNotResolved = 6 + // Failed to connect to host. + ExitFailedToConnect = 7 + // Weird server reply. The server sent data kouch couldn't parse. + ExitWeirdReply = 8 + // The requested url was not found or returned another error with the HTTP error code being 400 or above. + ExitNotRetrieved = 22 + // Write error. Kouch couldn't write data to a local filesystem or similar. + ExitWriteError = 23 + // Read error. Various reading problems. + ExitReadError = 26 + // The specified time-out period was reached according to the conditions. + ExitOperationTimeout = 28 + // Internal post request generation error. + ExitPostError = 34 + // When following redirects, curl hit the maximum amount. + ExitTooManyRedirects = 47 + +/* +5 Couldn't resolve proxy. The given proxy host could not be resolved. +18 Partial file. Only a part of the file was transferred. +27 Out of memory. A memory allocation request failed. +33 HTTP range error. The range "command" didn't work. +35 SSL connect error. The SSL handshaking failed. +37 FILE couldn't read file. Failed to open the file. Permissions? +43 Internal error. A function was called with a bad parameter. +45 Interface error. A specified outgoing interface could not be used. +51 The peer's SSL certificate or SSH MD5 fingerprint was not OK. +52 The server didn't reply anything, which here is considered an error. +53 SSL crypto engine not found. +54 Cannot set SSL crypto engine as default. +55 Failed sending network data. +56 Failure in receiving network data. +58 Problem with the local certificate. +59 Couldn't use specified SSL cipher. +60 Peer certificate cannot be authenticated with known CA certificates. +61 Unrecognized transfer encoding. +63 Maximum file size exceeded. +65 Sending the data requires a rewind that failed. +66 Failed to initialise SSL Engine. +67 The user name, password, or similar was not accepted and curl failed to log in. +75 Character conversion failed. +76 Character conversion functions required. +77 Problem with reading the SSL CA cert (path? access rights?). +78 The resource referenced in the URL does not exist. +80 Failed to shut down the SSL connection. +82 Could not load CRL file, missing or wrong format (added in 7.19.0). +83 Issuer check failed (added in 7.19.0). +89 No connection available, the session will be queued +90 SSL public key does not matched pinned public key +*/ +) diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/proxyauth.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/proxyauth.go new file mode 100644 index 00000000000..5f5b389158f --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/proxyauth.go @@ -0,0 +1,63 @@ +package chttp + +import ( + "crypto/hmac" + "crypto/sha1" + "encoding/hex" + "net/http" + "strings" +) + +type ProxyAuth struct { + Username string + Secret string + Roles []string + Headers http.Header + + transport http.RoundTripper + token string +} + +var _ Authenticator = &ProxyAuth{} + +func (a *ProxyAuth) header(header string) string { + if h := a.Headers.Get(header); h != "" { + return http.CanonicalHeaderKey(h) + } + return header +} + +func (a *ProxyAuth) genToken() string { + if a.Secret == "" { + return "" + } + if a.token != "" { + return a.token + } + // Generate auth token + // https://docs.couchdb.org/en/stable/config/auth.html#couch_httpd_auth/x_auth_token + h := hmac.New(sha1.New, []byte(a.Secret)) + _, _ = h.Write([]byte(a.Username)) + a.token = hex.EncodeToString(h.Sum(nil)) + return a.token +} + +func (a *ProxyAuth) RoundTrip(req *http.Request) (*http.Response, error) { + if token := a.genToken(); token != "" { + req.Header.Set(a.header("X-Auth-CouchDB-Token"), token) + } + + req.Header.Set(a.header("X-Auth-CouchDB-UserName"), a.Username) + req.Header.Set(a.header("X-Auth-CouchDB-Roles"), strings.Join(a.Roles, ",")) + + return a.transport.RoundTrip(req) +} + +func (a *ProxyAuth) Authenticate(c *Client) error { + a.transport = c.Transport + if a.transport == nil { + a.transport = http.DefaultTransport + } + c.Transport = a + return nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/trace.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/trace.go new file mode 100644 index 00000000000..39a9b20ba9e --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/trace.go @@ -0,0 +1,136 @@ +package chttp + +import ( + "bytes" + "context" + "io" + "io/ioutil" + "net/http" +) + +var clientTraceContextKey = &struct{ name string }{"client trace"} + +// ContextClientTrace returns the ClientTrace associated with the +// provided context. If none, it returns nil. +func ContextClientTrace(ctx context.Context) *ClientTrace { + trace, _ := ctx.Value(clientTraceContextKey).(*ClientTrace) + return trace +} + +// ClientTrace is a set of hooks to run at various stages of an outgoing +// HTTP request. Any particular hook may be nil. Functions may be +// called concurrently from different goroutines and some may be called +// after the request has completed or failed. +type ClientTrace struct { + // HTTPResponse returns a cloe of the *http.Response received from the + // server, with the body set to nil. If you need the body, use the more + // expensive HTTPResponseBody. + HTTPResponse func(*http.Response) + + // HTTPResponseBody returns a clone of the *http.Response received from the + // server, with the body cloned. This can be expensive for responses + // with large bodies. + HTTPResponseBody func(*http.Response) + + // HTTPRequest returns a clone of the *http.Request sent to the server, with + // the body set to nil. If you need the body, use the more expensive + // HTTPRequestBody. + HTTPRequest func(*http.Request) + + // HTTPRequestBody returns a clone of the *http.Request sent to the server, + // with the body cloned, if it is set. This can be expensive for requests + // with large bodies. + HTTPRequestBody func(*http.Request) +} + +// WithClientTrace returns a new context based on the provided parent +// ctx. HTTP client requests made with the returned context will use +// the provided trace hooks, in addition to any previous hooks +// registered with ctx. Any hooks defined in the provided trace will +// be called first. +func WithClientTrace(ctx context.Context, trace *ClientTrace) context.Context { + if trace == nil { + panic("nil trace") + } + return context.WithValue(ctx, clientTraceContextKey, trace) +} + +func (t *ClientTrace) httpResponse(r *http.Response) { + if t.HTTPResponse == nil || r == nil { + return + } + clone := new(http.Response) + *clone = *r + clone.Body = nil + t.HTTPResponse(clone) +} + +func (t *ClientTrace) httpResponseBody(r *http.Response) { + if t.HTTPResponseBody == nil || r == nil { + return + } + clone := new(http.Response) + *clone = *r + rBody := r.Body + body, readErr := ioutil.ReadAll(rBody) + closeErr := rBody.Close() + r.Body = newReplay(body, readErr, closeErr) + clone.Body = newReplay(body, readErr, closeErr) + t.HTTPResponseBody(clone) +} + +func (t *ClientTrace) httpRequest(r *http.Request) { + if t.HTTPRequest == nil { + return + } + clone := new(http.Request) + *clone = *r + clone.Body = nil + t.HTTPRequest(clone) +} + +func (t *ClientTrace) httpRequestBody(r *http.Request) { + if t.HTTPRequestBody == nil { + return + } + clone := new(http.Request) + *clone = *r + if r.Body != nil { + rBody := r.Body + body, readErr := ioutil.ReadAll(rBody) + closeErr := rBody.Close() + r.Body = newReplay(body, readErr, closeErr) + clone.Body = newReplay(body, readErr, closeErr) + } + t.HTTPRequestBody(clone) +} + +func newReplay(body []byte, readErr, closeErr error) io.ReadCloser { + if readErr == nil && closeErr == nil { + return ioutil.NopCloser(bytes.NewReader(body)) + } + return &replayReadCloser{ + Reader: ioutil.NopCloser(bytes.NewReader(body)), + readErr: readErr, + closeErr: closeErr, + } +} + +// replayReadCloser replays read and close errors +type replayReadCloser struct { + io.Reader + readErr error + closeErr error +} + +func (r *replayReadCloser) Read(p []byte) (int, error) { + c, err := r.Reader.Read(p) + if err == io.EOF && r.readErr != nil { + err = r.readErr + } + return c, err +} + +func (r *replayReadCloser) Close() error { + return r.closeErr +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/xerrors_13.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/xerrors_13.go new file mode 100644 index 00000000000..e98f2bd8db0 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/xerrors_13.go @@ -0,0 +1,7 @@ +// +build 1.13 + +package chttp + +type printer = errors.Printer + +var formatError = errors.FormatError diff --git a/vendor/github.com/go-kivik/couchdb/v3/chttp/xerrors_pre13.go b/vendor/github.com/go-kivik/couchdb/v3/chttp/xerrors_pre13.go new file mode 100644 index 00000000000..a91af06d1e4 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/chttp/xerrors_pre13.go @@ -0,0 +1,12 @@ +//go:build !1.13 +// +build !1.13 + +package chttp + +import ( + "golang.org/x/xerrors" +) + +type printer = xerrors.Printer + +var formatError = xerrors.FormatError diff --git a/vendor/github.com/go-kivik/couchdb/v3/client.go b/vendor/github.com/go-kivik/couchdb/v3/client.go new file mode 100644 index 00000000000..4497e31c5ee --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/client.go @@ -0,0 +1,104 @@ +package couchdb + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/url" + "strings" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +func (c *client) AllDBs(ctx context.Context, opts map[string]interface{}) ([]string, error) { + query, err := optionsToParams(opts) + if err != nil { + return nil, err + } + var allDBs []string + _, err = c.DoJSON(ctx, http.MethodGet, "/_all_dbs", &chttp.Options{Query: query}, &allDBs) + return allDBs, err +} + +func (c *client) DBExists(ctx context.Context, dbName string, _ map[string]interface{}) (bool, error) { + if dbName == "" { + return false, missingArg("dbName") + } + _, err := c.DoError(ctx, http.MethodHead, dbName, nil) + if kivik.StatusCode(err) == http.StatusNotFound { + return false, nil + } + return err == nil, err +} + +func (c *client) CreateDB(ctx context.Context, dbName string, opts map[string]interface{}) error { + if dbName == "" { + return missingArg("dbName") + } + query, err := optionsToParams(opts) + if err != nil { + return err + } + _, err = c.DoError(ctx, http.MethodPut, url.PathEscape(dbName), &chttp.Options{Query: query}) + return err +} + +func (c *client) DestroyDB(ctx context.Context, dbName string, _ map[string]interface{}) error { + if dbName == "" { + return missingArg("dbName") + } + _, err := c.DoError(ctx, http.MethodDelete, url.PathEscape(dbName), nil) + return err +} + +func (c *client) DBUpdates(ctx context.Context) (updates driver.DBUpdates, err error) { + resp, err := c.DoReq(ctx, http.MethodGet, "/_db_updates?feed=continuous&since=now", nil) + if err != nil { + return nil, err + } + if err := chttp.ResponseError(resp); err != nil { + return nil, err + } + return newUpdates(ctx, resp.Body), nil +} + +type couchUpdates struct { + *iter +} + +var _ driver.DBUpdates = &couchUpdates{} + +type updatesParser struct{} + +var _ parser = &updatesParser{} + +func (p *updatesParser) decodeItem(i interface{}, dec *json.Decoder) error { + return dec.Decode(i) +} + +func newUpdates(ctx context.Context, body io.ReadCloser) *couchUpdates { + return &couchUpdates{ + iter: newIter(ctx, nil, "", body, &updatesParser{}), + } +} + +func (u *couchUpdates) Next(update *driver.DBUpdate) error { + return u.iter.next(update) +} + +// Ping queries the /_up endpoint, and returns true if there are no errors, or +// if a 400 (Bad Request) is returned, and the Server: header indicates a server +// version prior to 2.x. +func (c *client) Ping(ctx context.Context) (bool, error) { + resp, err := c.DoError(ctx, http.MethodHead, "/_up", nil) + if kivik.StatusCode(err) == http.StatusBadRequest { + return strings.HasPrefix(resp.Header.Get("Server"), "CouchDB/1."), nil + } + if kivik.StatusCode(err) == http.StatusNotFound { + return false, nil + } + return err == nil, err +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/cluster.go b/vendor/github.com/go-kivik/couchdb/v3/cluster.go new file mode 100644 index 00000000000..399de1af8c9 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/cluster.go @@ -0,0 +1,35 @@ +package couchdb + +import ( + "context" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3/driver" +) + +func (c *client) ClusterStatus(ctx context.Context, opts map[string]interface{}) (string, error) { + var result struct { + State string `json:"state"` + } + query, err := optionsToParams(opts) + if err != nil { + return "", err + } + _, err = c.DoJSON(ctx, http.MethodGet, "/_cluster_setup", &chttp.Options{Query: query}, &result) + return result.State, err +} + +func (c *client) ClusterSetup(ctx context.Context, action interface{}) error { + options := &chttp.Options{ + Body: chttp.EncodeBody(action), + } + _, err := c.DoError(ctx, http.MethodPost, "/_cluster_setup", options) + return err +} + +func (c *client) Membership(ctx context.Context) (*driver.ClusterMembership, error) { + result := new(driver.ClusterMembership) + _, err := c.DoJSON(ctx, http.MethodGet, "/_membership", nil, &result) + return result, err +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/codecov.yml b/vendor/github.com/go-kivik/couchdb/v3/codecov.yml new file mode 100644 index 00000000000..b8a66592a95 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "test/.*" diff --git a/vendor/github.com/go-kivik/couchdb/v3/config.go b/vendor/github.com/go-kivik/couchdb/v3/config.go new file mode 100644 index 00000000000..a014368f30f --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/config.go @@ -0,0 +1,67 @@ +package couchdb + +import ( + "bytes" + "context" + "encoding/json" + "io/ioutil" + "net/http" + "strings" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3/driver" +) + +// Couch1ConfigNode can be passed to any of the Config-related methods as the +// node name, to query the /_config endpoint in a CouchDB 1.x-compatible way. +const Couch1ConfigNode = "" + +var _ driver.Configer = &client{} + +func configURL(node string, parts ...string) string { + var components []string + if node == Couch1ConfigNode { + components = append(make([]string, 0, len(parts)+1), + "_config") + } else { + components = append(make([]string, 0, len(parts)+3), + "_node", node, "_config", + ) + } + components = append(components, parts...) + return "/" + strings.Join(components, "/") +} + +func (c *client) Config(ctx context.Context, node string) (driver.Config, error) { + cf := driver.Config{} + _, err := c.Client.DoJSON(ctx, http.MethodGet, configURL(node), nil, &cf) + return cf, err +} + +func (c *client) ConfigSection(ctx context.Context, node, section string) (driver.ConfigSection, error) { + sec := driver.ConfigSection{} + _, err := c.Client.DoJSON(ctx, http.MethodGet, configURL(node, section), nil, &sec) + return sec, err +} + +func (c *client) ConfigValue(ctx context.Context, node, section, key string) (string, error) { + var value string + _, err := c.Client.DoJSON(ctx, http.MethodGet, configURL(node, section, key), nil, &value) + return value, err +} + +func (c *client) SetConfigValue(ctx context.Context, node, section, key, value string) (string, error) { + body, _ := json.Marshal(value) // Strings never cause JSON marshaling errors + var old string + opts := &chttp.Options{ + Body: ioutil.NopCloser(bytes.NewReader(body)), + } + _, err := c.Client.DoJSON(ctx, http.MethodPut, configURL(node, section, key), opts, &old) + return old, err +} + +func (c *client) DeleteConfigKey(ctx context.Context, node, section, key string) (string, error) { + var value string + _, err := c.Client.DoJSON(ctx, http.MethodDelete, configURL(node, section, key), nil, &value) + return value, err +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/constants.go b/vendor/github.com/go-kivik/couchdb/v3/constants.go new file mode 100644 index 00000000000..2aa1229aada --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/constants.go @@ -0,0 +1,44 @@ +package couchdb + +// Version is the current version of this package. +const Version = "3.3.0" + +const ( + // OptionFullCommit is the option key used to set the `X-Couch-Full-Commit` + // header in the request when set to true. + // + // Example: + // + // db.Put(ctx, "doc_id", doc, kivik.Options{couchdb.OptionFullCommit: true}) + OptionFullCommit = "X-Couch-Full-Commit" + + // OptionIfNoneMatch is an option key to set the If-None-Match header on + // the request. + // + // Example: + // + // row, err := db.Get(ctx, "doc_id", kivik.Options{couchdb.OptionIfNoneMatch: "1-xxx"}) + OptionIfNoneMatch = "If-None-Match" + + // OptionPartition instructs supporting methods to limit the query to the + // specified partition. Supported methods are: Query, AllDocs, Find, and + // Explain. Only supported by CouchDB 3.0.0 and newer. + // + // See https://docs.couchdb.org/en/stable/api/partitioned-dbs.html + OptionPartition = "kivik:partition" + + // NoMultipartPut instructs the Put() method not to use CouchDB's + // multipart/related upload capabilities. This only affects PUT requests that + // also include attachments. + NoMultipartPut = "kivik:no-multipart-put" + + // NoMultipartGet instructs the Get() method not to use CouchDB's ability to + // download attachments with the multipart/related media type. This only + // affects GET requests that request attachments. + NoMultipartGet = "kivik:no-multipart-get" +) + +const ( + typeJSON = "application/json" + typeMPRelated = "multipart/related" +) diff --git a/vendor/github.com/go-kivik/couchdb/v3/couchdb.go b/vendor/github.com/go-kivik/couchdb/v3/couchdb.go new file mode 100644 index 00000000000..0b7f636066d --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/couchdb.go @@ -0,0 +1,85 @@ +package couchdb + +import ( + "context" + "fmt" + "net/http" + "net/url" + "sync" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +// Couch represents the parent driver instance. +type Couch struct { + // If provided, UserAgent is appended to the User-Agent header on all + // outbound requests. + UserAgent string + + // If provided, HTTPClient will be used for requests to the CouchDB server. + HTTPClient *http.Client +} + +var _ driver.Driver = &Couch{} + +func init() { + kivik.Register("couch", &Couch{}) +} + +// Known vendor strings +const ( + VendorCouchDB = "The Apache Software Foundation" + VendorCloudant = "IBM Cloudant" +) + +type client struct { + *chttp.Client + + // schedulerDetected will be set once the scheduler has been detected. + // It should only be accessed through the schedulerSupported() method. + schedulerDetected *bool + sdMU sync.Mutex +} + +var ( + _ driver.Client = &client{} + _ driver.DBUpdater = &client{} +) + +// NewClient establishes a new connection to a CouchDB server instance. If +// auth credentials are included in the URL, they are used to authenticate using +// CookieAuth (or BasicAuth if compiled with GopherJS). If you wish to use a +// different auth mechanism, do not specify credentials here, and instead call +// Authenticate() later. +func (d *Couch) NewClient(dsn string) (driver.Client, error) { + httpClient := d.HTTPClient + if httpClient == nil { + httpClient = &http.Client{} + } + chttpClient, err := chttp.NewWithClient(httpClient, dsn) + if err != nil { + return nil, err + } + chttpClient.UserAgents = []string{ + fmt.Sprintf("Kivik/%s", kivik.KivikVersion), + fmt.Sprintf("Kivik CouchDB driver/%s", Version), + } + if d.UserAgent != "" { + chttpClient.UserAgents = append(chttpClient.UserAgents, d.UserAgent) + } + return &client{ + Client: chttpClient, + }, nil +} + +func (c *client) DB(_ context.Context, dbName string, _ map[string]interface{}) (driver.DB, error) { + if dbName == "" { + return nil, missingArg("dbName") + } + return &db{ + client: c, + dbName: url.PathEscape(dbName), + }, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/db.go b/vendor/github.com/go-kivik/couchdb/v3/db.go new file mode 100644 index 00000000000..7f55cdef486 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/db.go @@ -0,0 +1,914 @@ +package couchdb + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "mime" + "mime/multipart" + "net/http" + "net/textproto" + "net/url" + "os" + "path" + "path/filepath" + "reflect" + "sort" + "strconv" + "strings" + "sync" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +type db struct { + *client + dbName string +} + +var ( + _ driver.DB = &db{} + _ driver.OptsFinder = &db{} + _ driver.MetaGetter = &db{} + _ driver.AttachmentMetaGetter = &db{} + _ driver.PartitionedDB = &db{} +) + +func (d *db) path(path string) string { + url, err := url.Parse(d.dbName + "/" + strings.TrimPrefix(path, "/")) + if err != nil { + panic("THIS IS A BUG: d.path failed: " + err.Error()) + } + return url.String() +} + +func optionsToParams(opts ...map[string]interface{}) (url.Values, error) { + params := url.Values{} + for _, optsSet := range opts { + if err := encodeKeys(optsSet); err != nil { + return nil, err + } + for key, i := range optsSet { + var values []string + switch v := i.(type) { + case string: + values = []string{v} + case []string: + values = v + case bool: + values = []string{fmt.Sprintf("%t", v)} + case int, uint, uint8, uint16, uint32, uint64, int8, int16, int32, int64: + values = []string{fmt.Sprintf("%d", v)} + default: + return nil, &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: fmt.Errorf("kivik: invalid type %T for options", i)} + } + for _, value := range values { + params.Add(key, value) + } + } + } + return params, nil +} + +// rowsQuery performs a query that returns a rows iterator. +func (d *db) rowsQuery(ctx context.Context, path string, opts map[string]interface{}) (driver.Rows, error) { + payload := make(map[string]interface{}) + if keys := opts["keys"]; keys != nil { + delete(opts, "keys") + payload["keys"] = keys + } + rowsInit := newRows + if queries := opts["queries"]; queries != nil { + rowsInit = func(ctx context.Context, r io.ReadCloser) driver.Rows { + return newMultiQueriesRows(ctx, r) + } + delete(opts, "queries") + payload["queries"] = queries + // Funny that this works even in CouchDB 1.x. It seems 1.x just ignores + // extra path elements beyond the view name. So yay for accidental + // backward compatibility! + path = filepath.Join(path, "queries") + } + query, err := optionsToParams(opts) + if err != nil { + return nil, err + } + options := &chttp.Options{Query: query} + method := http.MethodGet + if len(payload) > 0 { + method = http.MethodPost + options.GetBody = chttp.BodyEncoder(payload) + options.Header = http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + } + } + resp, err := d.Client.DoReq(ctx, method, d.path(path), options) + if err != nil { + return nil, err + } + if err = chttp.ResponseError(resp); err != nil { + return nil, err + } + return rowsInit(ctx, resp.Body), nil +} + +// AllDocs returns all of the documents in the database. +func (d *db) AllDocs(ctx context.Context, opts map[string]interface{}) (driver.Rows, error) { + reqPath := "_all_docs" + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + return d.rowsQuery(ctx, reqPath, opts) +} + +// DesignDocs returns all of the documents in the database. +func (d *db) DesignDocs(ctx context.Context, opts map[string]interface{}) (driver.Rows, error) { + return d.rowsQuery(ctx, "_design_docs", opts) +} + +// LocalDocs returns all of the documents in the database. +func (d *db) LocalDocs(ctx context.Context, opts map[string]interface{}) (driver.Rows, error) { + return d.rowsQuery(ctx, "_local_docs", opts) +} + +// Query queries a view. +func (d *db) Query(ctx context.Context, ddoc, view string, opts map[string]interface{}) (driver.Rows, error) { + reqPath := fmt.Sprintf("_design/%s/_view/%s", chttp.EncodeDocID(ddoc), chttp.EncodeDocID(view)) + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + return d.rowsQuery(ctx, reqPath, opts) +} + +// Get fetches the requested document. +func (d *db) Get(ctx context.Context, docID string, options map[string]interface{}) (*driver.Document, error) { + resp, rev, err := d.get(ctx, http.MethodGet, docID, options) + if err != nil { + return nil, err + } + ct, params, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + switch ct { + case typeJSON: + return &driver.Document{ + Rev: rev, + ContentLength: resp.ContentLength, + Body: resp.Body, + }, nil + case typeMPRelated: + boundary := strings.Trim(params["boundary"], "\"") + if boundary == "" { + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: errors.New("kivik: boundary missing for multipart/related response")} + } + mpReader := multipart.NewReader(resp.Body, boundary) + body, err := mpReader.NextPart() + if err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + length := int64(-1) + if cl, e := strconv.ParseInt(body.Header.Get("Content-Length"), 10, 64); e == nil { + length = cl + } + + // TODO: Use a TeeReader here, to avoid slurping the entire body into memory at once + content, err := ioutil.ReadAll(body) + if err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + var metaDoc struct { + Attachments map[string]attMeta `json:"_attachments"` + } + if err := json.Unmarshal(content, &metaDoc); err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + + return &driver.Document{ + ContentLength: length, + Rev: rev, + Body: ioutil.NopCloser(bytes.NewBuffer(content)), + Attachments: &multipartAttachments{ + content: resp.Body, + mpReader: mpReader, + meta: metaDoc.Attachments, + }, + }, nil + default: + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: fmt.Errorf("kivik: invalid content type in response: %s", ct)} + } +} + +type attMeta struct { + ContentType string `json:"content_type"` + Size *int64 `json:"length"` + Follows bool `json:"follows"` +} + +type multipartAttachments struct { + content io.ReadCloser + mpReader *multipart.Reader + meta map[string]attMeta +} + +var _ driver.Attachments = &multipartAttachments{} + +func (a *multipartAttachments) Next(att *driver.Attachment) error { + part, err := a.mpReader.NextPart() + switch err { + case io.EOF: + return err + case nil: + // fall through + default: + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + + disp, dispositionParams, err := mime.ParseMediaType(part.Header.Get("Content-Disposition")) + if err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: fmt.Errorf("Content-Disposition: %s", err)} + } + if disp != "attachment" { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: fmt.Errorf("Unexpected Content-Disposition: %s", disp)} + } + filename := dispositionParams["filename"] + + meta := a.meta[filename] + if !meta.Follows { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: fmt.Errorf("File '%s' not in manifest", filename)} + } + + size := int64(-1) + if meta.Size != nil { + size = *meta.Size + } else if cl, e := strconv.ParseInt(part.Header.Get("Content-Length"), 10, 64); e == nil { + size = cl + } + + var cType string + if ctHeader, ok := part.Header["Content-Type"]; ok { + cType, _, err = mime.ParseMediaType(ctHeader[0]) + if err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + } else { + cType = meta.ContentType + } + + *att = driver.Attachment{ + Filename: filename, + Size: size, + ContentType: cType, + Content: part, + ContentEncoding: part.Header.Get("Content-Encoding"), + } + return nil +} + +func (a *multipartAttachments) Close() error { + return a.content.Close() +} + +// Rev returns the most current rev of the requested document. +func (d *db) GetMeta(ctx context.Context, docID string, options map[string]interface{}) (size int64, rev string, err error) { + resp, rev, err := d.get(ctx, http.MethodHead, docID, options) + if err != nil { + return 0, "", err + } + return resp.ContentLength, rev, err +} + +func (d *db) get(ctx context.Context, method, docID string, options map[string]interface{}) (*http.Response, string, error) { + if docID == "" { + return nil, "", missingArg("docID") + } + + inm, err := ifNoneMatch(options) + if err != nil { + return nil, "", err + } + + params, err := optionsToParams(options) + if err != nil { + return nil, "", err + } + opts := &chttp.Options{ + Accept: typeMPRelated + "," + typeJSON, + IfNoneMatch: inm, + Query: params, + } + if _, ok := options[NoMultipartGet]; ok { + opts.Accept = typeJSON + } + resp, err := d.Client.DoReq(ctx, method, d.path(chttp.EncodeDocID(docID)), opts) + if err != nil { + return nil, "", err + } + if respErr := chttp.ResponseError(resp); respErr != nil { + return nil, "", respErr + } + rev, err := chttp.GetRev(resp) + return resp, rev, err +} + +func (d *db) CreateDoc(ctx context.Context, doc interface{}, options map[string]interface{}) (docID, rev string, err error) { + result := struct { + ID string `json:"id"` + Rev string `json:"rev"` + }{} + + fullCommit, err := fullCommit(options) + if err != nil { + return "", "", err + } + + path := d.dbName + if len(options) > 0 { + params, e := optionsToParams(options) + if e != nil { + return "", "", e + } + path += "?" + params.Encode() + } + + opts := &chttp.Options{ + Body: chttp.EncodeBody(doc), + FullCommit: fullCommit, + } + _, err = d.Client.DoJSON(ctx, http.MethodPost, path, opts, &result) + return result.ID, result.Rev, err +} + +func putOpts(doc interface{}, options map[string]interface{}) (*chttp.Options, error) { + fullCommit, err := fullCommit(options) + if err != nil { + return nil, err + } + params, err := optionsToParams(options) + if err != nil { + return nil, err + } + if _, ok := options[NoMultipartPut]; !ok { + if atts, ok := extractAttachments(doc); ok { + boundary, size, multipartBody, e := newMultipartAttachments(chttp.EncodeBody(doc), atts) + if e != nil { + return nil, e + } + return &chttp.Options{ + Body: multipartBody, + FullCommit: fullCommit, + Query: params, + ContentLength: size, + ContentType: fmt.Sprintf(typeMPRelated+"; boundary=%q", boundary), + }, nil + } + } + return &chttp.Options{ + Body: chttp.EncodeBody(doc), + FullCommit: fullCommit, + Query: params, + }, nil +} + +func (d *db) Put(ctx context.Context, docID string, doc interface{}, options map[string]interface{}) (rev string, err error) { + if docID == "" { + return "", missingArg("docID") + } + opts, err := putOpts(doc, options) + if err != nil { + return "", err + } + var result struct { + ID string `json:"id"` + Rev string `json:"rev"` + } + _, err = d.Client.DoJSON(ctx, http.MethodPut, d.path(chttp.EncodeDocID(docID)), opts, &result) + if err != nil { + return "", err + } + return result.Rev, nil +} + +const attachmentsKey = "_attachments" + +func extractAttachments(doc interface{}) (*kivik.Attachments, bool) { + if doc == nil { + return nil, false + } + v := reflect.ValueOf(doc) + if v.Type().Kind() == reflect.Ptr { + return extractAttachments(v.Elem().Interface()) + } + if stdMap, ok := doc.(map[string]interface{}); ok { + return interfaceToAttachments(stdMap[attachmentsKey]) + } + if v.Kind() != reflect.Struct { + return nil, false + } + for i := 0; i < v.NumField(); i++ { + if v.Type().Field(i).Tag.Get("json") == attachmentsKey { + return interfaceToAttachments(v.Field(i).Interface()) + } + } + return nil, false +} + +func interfaceToAttachments(i interface{}) (*kivik.Attachments, bool) { + switch t := i.(type) { + case kivik.Attachments: + atts := make(kivik.Attachments, len(t)) + for k, v := range t { + atts[k] = v + delete(t, k) + } + return &atts, true + case *kivik.Attachments: + atts := new(kivik.Attachments) + *atts = *t + *t = nil + return atts, true + } + return nil, false +} + +// newMultipartAttachments reads a json stream on in, and produces a +// multipart/related output suitable for a PUT request. +func newMultipartAttachments(in io.ReadCloser, att *kivik.Attachments) (boundary string, size int64, content io.ReadCloser, err error) { + tmp, err := ioutil.TempFile("", "kivik-multipart-*") + if err != nil { + return "", 0, nil, err + } + body := multipart.NewWriter(tmp) + w := sync.WaitGroup{} + w.Add(1) + go func() { + err = createMultipart(body, in, att) + e := in.Close() + if err == nil { + err = e + } + w.Done() + }() + w.Wait() + if e := tmp.Sync(); err == nil { + err = e + } + if info, e := tmp.Stat(); e == nil { + size = info.Size() + } else { + if err == nil { + err = e + } + } + if _, e := tmp.Seek(0, 0); e != nil && err == nil { + err = e + } + return body.Boundary(), + size, + tmp, + err +} + +func createMultipart(w *multipart.Writer, r io.ReadCloser, atts *kivik.Attachments) error { + doc, err := w.CreatePart(textproto.MIMEHeader{ + "Content-Type": {typeJSON}, + }) + if err != nil { + return err + } + attJSON := replaceAttachments(r, atts) + if _, e := io.Copy(doc, attJSON); e != nil { + return e + } + + // Sort the filenames to ensure order consistent with json.Marshal's ordering + // of the stubs in the body + filenames := make([]string, 0, len(*atts)) + for filename := range *atts { + filenames = append(filenames, filename) + } + sort.Strings(filenames) + + for _, filename := range filenames { + att := (*atts)[filename] + file, err := w.CreatePart(textproto.MIMEHeader{ + // "Content-Type": {att.ContentType}, + // "Content-Disposition": {fmt.Sprintf(`attachment; filename=%q`, filename)}, + // "Content-Length": {strconv.FormatInt(att.Size, 10)}, + }) + if err != nil { + return err + } + if _, err := io.Copy(file, att.Content); err != nil { + return err + } + _ = att.Content.Close() + } + + return w.Close() +} + +type lener interface { + Len() int +} + +type stater interface { + Stat() (os.FileInfo, error) +} + +// attachmentSize determines the size of the `in` stream by reading the entire +// stream first. This method is a no-op if att.Size is already > , and sets the Size +// parameter accordingly. If Size is already set, this function does nothing. +// It attempts the following methods: +// +// 1. Calls `Len()`, if implemented by `in` (i.e. `*bytes.Buffer`) +// 2. Calls `Stat()`, if implemented by `in` (i.e. `*os.File`) then returns +// the file's size +// 3. Read the entire stream to determine the size, and replace att.Content +// to be replayed. +func attachmentSize(att *kivik.Attachment) error { + if att.Size > 0 { + return nil + } + size, r, err := readerSize(att.Content) + if err != nil { + return err + } + rc, ok := r.(io.ReadCloser) + if !ok { + rc = ioutil.NopCloser(r) + } + + att.Content = rc + att.Size = size + return nil +} + +func readerSize(in io.Reader) (int64, io.Reader, error) { + if ln, ok := in.(lener); ok { + return int64(ln.Len()), in, nil + } + if st, ok := in.(stater); ok { + info, err := st.Stat() + if err != nil { + return 0, nil, err + } + return info.Size(), in, nil + } + content, err := ioutil.ReadAll(in) + if err != nil { + return 0, nil, err + } + buf := bytes.NewBuffer(content) + return int64(buf.Len()), ioutil.NopCloser(buf), nil +} + +// NewAttachment is a convenience function, which sets the size of the attachment +// based on content. This is intended for creating attachments to be uploaded +// using multipart/related capabilities of Put(). The attachment size will be +// set to the first of the following found: +// +// 1. `size`, if present. Only the first value is considered +// 2. content.Len(), if implemented (i.e. *bytes.Buffer) +// 3. content.Stat().Size(), if implemented (i.e. *os.File) +// 4. Read the entire content into memory, to determine the size. This can +// use a lot of memory for large attachments. Please use a file, or +// specify the size directly instead. +func NewAttachment(filename, contentType string, content io.Reader, size ...int64) (*kivik.Attachment, error) { + var filesize int64 + if len(size) > 0 { + filesize = size[0] + } else { + var err error + filesize, content, err = readerSize(content) + if err != nil { + return nil, err + } + } + rc, ok := content.(io.ReadCloser) + if !ok { + rc = ioutil.NopCloser(content) + } + return &kivik.Attachment{ + Filename: filename, + ContentType: contentType, + Content: rc, + Size: filesize, + }, nil +} + +// replaceAttachments reads a json stream on in, looking for the _attachments +// key, then replaces its value with the marshaled version of att. +func replaceAttachments(in io.ReadCloser, atts *kivik.Attachments) io.ReadCloser { + r, w := io.Pipe() + go func() { + stubs, err := attachmentStubs(atts) + if err != nil { + _ = w.CloseWithError(err) + _ = in.Close() + return + } + err = copyWithAttachmentStubs(w, in, stubs) + e := in.Close() + if err == nil { + err = e + } + _ = w.CloseWithError(err) + }() + return r +} + +type stub struct { + ContentType string `json:"content_type"` + Size int64 `json:"length"` +} + +func (s *stub) MarshalJSON() ([]byte, error) { + type attJSON struct { + stub + Follows bool `json:"follows"` + } + att := attJSON{ + stub: *s, + Follows: true, + } + return json.Marshal(att) +} + +func attachmentStubs(atts *kivik.Attachments) (map[string]*stub, error) { + if atts == nil { + return nil, nil + } + result := make(map[string]*stub, len(*atts)) + for filename, att := range *atts { + if err := attachmentSize(att); err != nil { + return nil, err + } + result[filename] = &stub{ + ContentType: att.ContentType, + Size: att.Size, + } + } + return result, nil +} + +// copyWithAttachmentStubs copies r to w, replacing the _attachment value with the +// marshaled version of atts. +func copyWithAttachmentStubs(w io.Writer, r io.Reader, atts map[string]*stub) error { + dec := json.NewDecoder(r) + t, err := dec.Token() + if err == nil { + if t != json.Delim('{') { + return &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: fmt.Errorf("expected '{', found '%v'", t)} + } + } + if err != nil { + if err != io.EOF { + return err + } + } + if _, err := fmt.Fprintf(w, "%v", t); err != nil { + return err + } + first := true + for { + t, err := dec.Token() + if err == io.EOF { + break + } + if err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + switch tp := t.(type) { + case string: + if !first { + if _, e := w.Write([]byte(",")); e != nil { + return e + } + } + first = false + if _, e := fmt.Fprintf(w, `"%s":`, tp); e != nil { + return e + } + var val json.RawMessage + if e := dec.Decode(&val); e != nil { + return e + } + if tp == attachmentsKey { + if e := json.NewEncoder(w).Encode(atts); e != nil { + return e + } + // Once we're here, we can just stream the rest of the input + // unaltered. + if _, e := io.Copy(w, dec.Buffered()); e != nil { + return e + } + _, e := io.Copy(w, r) + return e + } + if _, e := w.Write(val); e != nil { + return e + } + case json.Delim: + if tp != json.Delim('}') { + return fmt.Errorf("expected '}', found '%v'", t) + } + if _, err := fmt.Fprintf(w, "%v", t); err != nil { + return err + } + } + } + return nil +} + +func (d *db) Delete(ctx context.Context, docID, rev string, options map[string]interface{}) (string, error) { + if docID == "" { + return "", missingArg("docID") + } + if rev == "" { + return "", missingArg("rev") + } + + fullCommit, err := fullCommit(options) + if err != nil { + return "", err + } + + query, err := optionsToParams(options) + if err != nil { + return "", err + } + if query.Get("rev") == "" { + query.Set("rev", rev) + } + opts := &chttp.Options{ + FullCommit: fullCommit, + Query: query, + } + resp, err := d.Client.DoReq(ctx, http.MethodDelete, d.path(chttp.EncodeDocID(docID)), opts) + if err != nil { + return "", err + } + defer resp.Body.Close() // nolint: errcheck + return chttp.GetRev(resp) +} + +func (d *db) Flush(ctx context.Context) error { + opts := &chttp.Options{ + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + _, err := d.Client.DoError(ctx, http.MethodPost, d.path("/_ensure_full_commit"), opts) + return err +} + +func (d *db) Compact(ctx context.Context) error { + opts := &chttp.Options{ + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + res, err := d.Client.DoReq(ctx, http.MethodPost, d.path("/_compact"), opts) + if err != nil { + return err + } + return chttp.ResponseError(res) +} + +func (d *db) CompactView(ctx context.Context, ddocID string) error { + if ddocID == "" { + return missingArg("ddocID") + } + opts := &chttp.Options{ + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + res, err := d.Client.DoReq(ctx, http.MethodPost, d.path("/_compact/"+ddocID), opts) + if err != nil { + return err + } + return chttp.ResponseError(res) +} + +func (d *db) ViewCleanup(ctx context.Context) error { + opts := &chttp.Options{ + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + res, err := d.Client.DoReq(ctx, http.MethodPost, d.path("/_view_cleanup"), opts) + if err != nil { + return err + } + return chttp.ResponseError(res) +} + +func (d *db) Security(ctx context.Context) (*driver.Security, error) { + var sec *driver.Security + _, err := d.Client.DoJSON(ctx, http.MethodGet, d.path("/_security"), nil, &sec) + return sec, err +} + +func (d *db) SetSecurity(ctx context.Context, security *driver.Security) error { + opts := &chttp.Options{ + GetBody: chttp.BodyEncoder(security), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + res, err := d.Client.DoReq(ctx, http.MethodPut, d.path("/_security"), opts) + if err != nil { + return err + } + defer res.Body.Close() // nolint: errcheck + return chttp.ResponseError(res) +} + +func (d *db) Copy(ctx context.Context, targetID, sourceID string, options map[string]interface{}) (targetRev string, err error) { + if sourceID == "" { + return "", missingArg("sourceID") + } + if targetID == "" { + return "", missingArg("targetID") + } + fullCommit, err := fullCommit(options) + if err != nil { + return "", err + } + params, err := optionsToParams(options) + if err != nil { + return "", err + } + opts := &chttp.Options{ + FullCommit: fullCommit, + Query: params, + Header: http.Header{ + chttp.HeaderDestination: []string{targetID}, + }, + } + resp, err := d.Client.DoReq(ctx, "COPY", d.path(chttp.EncodeDocID(sourceID)), opts) + if err != nil { + return "", err + } + defer resp.Body.Close() // nolint: errcheck + return chttp.GetRev(resp) +} + +func (d *db) Purge(ctx context.Context, docMap map[string][]string) (*driver.PurgeResult, error) { + result := &driver.PurgeResult{} + options := &chttp.Options{ + GetBody: chttp.BodyEncoder(docMap), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + _, err := d.Client.DoJSON(ctx, http.MethodPost, d.path("_purge"), options, &result) + return result, err +} + +var _ driver.RevsDiffer = &db{} + +func (d *db) RevsDiff(ctx context.Context, revMap interface{}) (driver.Rows, error) { + options := &chttp.Options{ + GetBody: chttp.BodyEncoder(revMap), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + resp, err := d.Client.DoReq(ctx, http.MethodPost, d.path("_revs_diff"), options) + if err != nil { + return nil, err + } + if err = chttp.ResponseError(resp); err != nil { + return nil, err + } + return newRevsDiffRows(ctx, resp.Body), nil +} + +type revsDiffParser struct{} + +func (p *revsDiffParser) decodeItem(i interface{}, dec *json.Decoder) error { + t, err := dec.Token() + if err != nil { + return err + } + row := i.(*driver.Row) + row.ID = t.(string) + return dec.Decode(&row.Value) +} + +func newRevsDiffRows(ctx context.Context, in io.ReadCloser) driver.Rows { + iter := newIter(ctx, nil, "", in, &revsDiffParser{}) + iter.objMode = true + return &rows{iter: iter} +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/dbstats.go b/vendor/github.com/go-kivik/couchdb/v3/dbstats.go new file mode 100644 index 00000000000..31af2d638bb --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/dbstats.go @@ -0,0 +1,129 @@ +package couchdb + +import ( + "bytes" + "context" + "encoding/json" + "net/http" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3/driver" +) + +type dbStats struct { + driver.DBStats + Sizes struct { + File int64 `json:"file"` + External int64 `json:"external"` + Active int64 `json:"active"` + } `json:"sizes"` + UpdateSeq json.RawMessage `json:"update_seq"` // nolint: govet + rawBody json.RawMessage +} + +func (s *dbStats) UnmarshalJSON(p []byte) error { + type dbStatsClone dbStats + c := dbStatsClone(*s) + if err := json.Unmarshal(p, &c); err != nil { + return err + } + *s = dbStats(c) + s.rawBody = p + return nil +} + +func (s *dbStats) driverStats() *driver.DBStats { + stats := &s.DBStats + if s.Sizes.File > 0 { + stats.DiskSize = s.Sizes.File + } + if s.Sizes.External > 0 { + stats.ExternalSize = s.Sizes.External + } + if s.Sizes.Active > 0 { + stats.ActiveSize = s.Sizes.Active + } + stats.UpdateSeq = string(bytes.Trim(s.UpdateSeq, `"`)) + stats.RawResponse = s.rawBody + return stats +} + +func (d *db) Stats(ctx context.Context) (*driver.DBStats, error) { + result := dbStats{} + if _, err := d.Client.DoJSON(ctx, http.MethodGet, d.dbName, nil, &result); err != nil { + return nil, err + } + return result.driverStats(), nil +} + +type dbsInfoRequest struct { + Keys []string `json:"keys"` +} + +type dbsInfoResponse struct { + Key string `json:"key"` + DBInfo dbStats `json:"info"` + Error string `json:"error"` +} + +func (c *client) DBsStats(ctx context.Context, dbnames []string) ([]*driver.DBStats, error) { + opts := &chttp.Options{ + GetBody: chttp.BodyEncoder(dbsInfoRequest{Keys: dbnames}), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + result := []dbsInfoResponse{} + _, err := c.DoJSON(context.Background(), http.MethodPost, "/_dbs_info", opts, &result) + if err != nil { + return nil, err + } + stats := make([]*driver.DBStats, len(result)) + for i := range result { + if result[i].Error == "" { + stats[i] = result[i].DBInfo.driverStats() + } + } + return stats, nil +} + +type partitionStats struct { + DBName string `json:"db_name"` + DocCount int64 `json:"doc_count"` + DocDelCount int64 `json:"doc_del_count"` + Partition string `json:"partition"` + Sizes struct { + Active int64 `json:"active"` + External int64 `json:"external"` + } + rawBody json.RawMessage +} + +func (s *partitionStats) UnmarshalJSON(p []byte) error { + c := struct { + partitionStats + UnmarshalJSON struct{} + }{} + if err := json.Unmarshal(p, &c); err != nil { + return err + } + *s = c.partitionStats + s.rawBody = p + return nil +} + +func (d *db) PartitionStats(ctx context.Context, name string) (*driver.PartitionStats, error) { + result := partitionStats{} + if _, err := d.Client.DoJSON(ctx, http.MethodGet, d.path("_partition/"+name), nil, &result); err != nil { + return nil, err + } + return &driver.PartitionStats{ + DBName: result.DBName, + DocCount: result.DocCount, + DeletedDocCount: result.DocDelCount, + Partition: result.Partition, + ActiveSize: result.Sizes.Active, + ExternalSize: result.Sizes.External, + RawResponse: result.rawBody, + }, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/doc.go b/vendor/github.com/go-kivik/couchdb/v3/doc.go new file mode 100644 index 00000000000..04d533c45eb --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/doc.go @@ -0,0 +1,106 @@ +/* +Package couchdb is a driver for connecting with a CouchDB server over HTTP. + +General Usage + +Use the `couch` driver name when using this driver. The DSN should be a full +URL, likely with login credentials: + + import ( + kivik "github.com/go-kivik/kivik/v3" + _ "github.com/go-kivik/couchdb/v3" // The CouchDB driver + ) + + client, err := kivik.New("couch", "http://username:password@127.0.0.1:5984/") + +Options + +The CouchDB driver generally interprets kivik.Options keys and values as URL +query parameters. Values of the following types will be converted to their +appropriate string representation when URL-encoded: + + - bool + - string + - []string + - int, uint, uint8, uint16, uint32, uint64, int8, int16, int32, int64 + +Passing any other type will return an error. + +The only exceptions to the above rule are: + + - the special option keys defined by the package constants `OptionFullCommit` + and `OptionIfNoneMatch`. These options set the appropriate HTTP request + headers rather than setting a URL parameter. + - the `keys` key, when passed to a view query, will result in a POST query + being done, rather than a GET, to accommodate an arbitrary number of keys. + - the 'NoMultipartPut' option is interpreted by the Kivik CouchDB driver to + disable multipart/related PUT uploads of attachments. + - the 'NoMultipartGet' option is interpreted by the Kivik CouchDB driver to + disable multipart/related GET downloads of attachments. + +Authentication + +The CouchDB driver supports a number of authentication methods. For most uses, +you don't need to worry about authentication at all--just include authentication +credentials in your connection DSN: + + client, _ := kivik.New("couch", "http://user:password@localhost:5984/") + +This will use Cookie authentication by default. + +To use one of the explicit authentication mechanisms, you'll need to use kivik's +Authenticate method. For example: + + client, _ := kivik.New("couch", "http://localhost:5984/") + err := client.Authenticate(ctx, couchdb.BasicAuth("bob", "abc123")) + +Multipart PUT + +Normally, to include an attachment in a CouchDB document, it must be base-64 +encoded, which leads to increased network traffic and higher CPU load. CouchDB +also supports the option to upload multiple attachments in a single request +using the 'multipart/related' content type. See +http://docs.couchdb.org/en/stable/api/document/common.html#creating-multiple-attachments + +As an experimental feature, this is now supported by the Kivik CouchDB driver as +well. To take advantage of this capability, the `doc` argument to the Put() +method must be either: + + - a map of type `map[string]interface{}`, with a key called `_attachments', + and value of type `kivik.Attachments` or `*kivik.Attachments` + - a struct, with a field having the tag `json:"_attachment"`, and the field + having the type `kivik.Attachments` or `*kivik.Attachments`. + +With this in place, the CouchDB driver will switch to `multipart/related` mode, +sending each attachment in binary format, rather than base-64 encoding it. + +To function properly, each attachment must have an accurate Size value. If the +Size value is unset, the entirely attachment may be read to determine its size, +prior to sending it over the network, leading to delays and unnecessary I/O and +CPU usage. The simplest way to ensure efficiency is to use the NewAttachment() +method, provided by this package. See the documentation on that method for +proper usage. + +Example: + + file, _ := os.Open("/path/to/photo.jpg") + atts := &kivik.Attachments{ + "photo.jpg": NewAttachment("photo.jpg", "image/jpeg", file), + } + doc := map[string]interface{}{ + "_id": "user123", + "_attachments": atts, + } + rev, err := db.Put(ctx, "user123", doc) + +To disable the `multipart/related` capabilities entirely, you may pass the +`NoMultipartPut` option, with any value. This will fallback to the default of +inline base-64 encoding the attachments. Example: + + rev, err := db.Put(ctx, "user123", doc", kivik.Options{couchdb.NoMultipartPut: "xxx"}) + +If you find yourself wanting to disable this feature, due to bugs or performance, +please consider filing a bug report against Kivik as well, so we can look for a +solution that will allow using this optimization. +*/ +package couchdb diff --git a/vendor/github.com/go-kivik/couchdb/v3/errors.go b/vendor/github.com/go-kivik/couchdb/v3/errors.go new file mode 100644 index 00000000000..96f13ac7d53 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/errors.go @@ -0,0 +1,12 @@ +package couchdb + +import ( + "fmt" + "net/http" + + kivik "github.com/go-kivik/kivik/v3" +) + +func missingArg(arg string) error { + return &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: fmt.Errorf("kivik: %s required", arg)} +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/find.go b/vendor/github.com/go-kivik/couchdb/v3/find.go new file mode 100644 index 00000000000..3cdfc846634 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/find.go @@ -0,0 +1,149 @@ +package couchdb + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "path" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3/driver" +) + +const ( + pathIndex = "_index" +) + +func (d *db) CreateIndex(ctx context.Context, ddoc, name string, index interface{}, opts map[string]interface{}) error { + reqPath := pathIndex + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + indexObj, err := deJSONify(index) + if err != nil { + return err + } + parameters := struct { + Index interface{} `json:"index"` + Ddoc string `json:"ddoc,omitempty"` + Name string `json:"name,omitempty"` + }{ + Index: indexObj, + Ddoc: ddoc, + Name: name, + } + options := &chttp.Options{ + Body: chttp.EncodeBody(parameters), + } + _, err = d.Client.DoError(ctx, http.MethodPost, d.path(reqPath), options) + return err +} + +func (d *db) GetIndexes(ctx context.Context, opts map[string]interface{}) ([]driver.Index, error) { + reqPath := pathIndex + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + var result struct { + Indexes []driver.Index `json:"indexes"` + } + _, err := d.Client.DoJSON(ctx, http.MethodGet, d.path(reqPath), nil, &result) + return result.Indexes, err +} + +func (d *db) DeleteIndex(ctx context.Context, ddoc, name string, opts map[string]interface{}) error { + if ddoc == "" { + return missingArg("ddoc") + } + if name == "" { + return missingArg("name") + } + reqPath := pathIndex + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + path := fmt.Sprintf("%s/%s/json/%s", reqPath, ddoc, name) + _, err := d.Client.DoError(ctx, http.MethodDelete, d.path(path), nil) + return err +} + +func (d *db) Find(ctx context.Context, query interface{}, opts map[string]interface{}) (driver.Rows, error) { + reqPath := "_find" + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + options := &chttp.Options{ + GetBody: chttp.BodyEncoder(query), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + resp, err := d.Client.DoReq(ctx, http.MethodPost, d.path(reqPath), options) + if err != nil { + return nil, err + } + if err = chttp.ResponseError(resp); err != nil { + return nil, err + } + return newFindRows(ctx, resp.Body), nil +} + +type queryPlan struct { + DBName string `json:"dbname"` + Index map[string]interface{} `json:"index"` + Selector map[string]interface{} `json:"selector"` + Options map[string]interface{} `json:"opts"` + Limit int64 `json:"limit"` + Skip int64 `json:"skip"` + Fields fields `json:"fields"` + Range map[string]interface{} `json:"range"` +} + +type fields []interface{} + +func (f *fields) UnmarshalJSON(data []byte) error { + if string(data) == `"all_fields"` { + return nil + } + var i []interface{} + if err := json.Unmarshal(data, &i); err != nil { + return err + } + newFields := make([]interface{}, len(i)) + copy(newFields, i) + *f = newFields + return nil +} + +func (d *db) Explain(ctx context.Context, query interface{}, opts map[string]interface{}) (*driver.QueryPlan, error) { + reqPath := "_explain" + if part, ok := opts[OptionPartition].(string); ok { + delete(opts, OptionPartition) + reqPath = path.Join("_partition", part, reqPath) + } + options := &chttp.Options{ + GetBody: chttp.BodyEncoder(query), + Header: http.Header{ + chttp.HeaderIdempotencyKey: []string{}, + }, + } + var plan queryPlan + if _, err := d.Client.DoJSON(ctx, http.MethodPost, d.path(reqPath), options, &plan); err != nil { + return nil, err + } + return &driver.QueryPlan{ + DBName: plan.DBName, + Index: plan.Index, + Selector: plan.Selector, + Options: plan.Options, + Limit: plan.Limit, + Skip: plan.Skip, + Fields: plan.Fields, + Range: plan.Range, + }, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/iter.go b/vendor/github.com/go-kivik/couchdb/v3/iter.go new file mode 100644 index 00000000000..07eaefa8ec4 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/iter.go @@ -0,0 +1,300 @@ +package couchdb + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "sync" + "sync/atomic" + + kivik "github.com/go-kivik/kivik/v3" +) + +type parser interface { + decodeItem(interface{}, *json.Decoder) error +} + +type metaParser interface { + parseMeta(interface{}, *json.Decoder, string) error +} + +type cancelableReadCloser struct { + ctx context.Context + rc io.ReadCloser + cancel func() + + mu sync.RWMutex + closed bool + err error +} + +var _ io.ReadCloser = &cancelableReadCloser{} + +func newCancelableReadCloser(ctx context.Context, rc io.ReadCloser) io.ReadCloser { + ctx, cancel := context.WithCancel(ctx) + return &cancelableReadCloser{ + ctx: ctx, + rc: rc, + cancel: cancel, + } +} + +func (r *cancelableReadCloser) readErr() error { + r.mu.RLock() + if !r.closed { + r.mu.RUnlock() + return nil + } + err := r.err + r.mu.RUnlock() + if err == nil { + err = errors.New("iterator closed") + } + return err +} + +func (r *cancelableReadCloser) Read(p []byte) (int, error) { + if err := r.readErr(); err != nil { + return 0, err + } + var c int + var err error + done := make(chan struct{}) + go func() { + c, err = r.rc.Read(p) + close(done) + }() + select { + case <-r.ctx.Done(): + var err error + if err = r.readErr(); err == nil { + err = r.ctx.Err() + } + return 0, r.close(err) + case <-done: + if err != nil { + e := r.close(err) + return c, e + } + return c, nil + } +} + +func (r *cancelableReadCloser) close(err error) error { + r.mu.Lock() + defer r.mu.Unlock() + if !r.closed { + r.cancel() + r.closed = true + e := r.rc.Close() + if err == nil { + err = e + } + r.err = err + } + return r.err +} + +func (r *cancelableReadCloser) Close() error { + err := r.close(nil) + if err == io.EOF { + return nil + } + return err +} + +type iter struct { + meta interface{} + expectedKey string + body io.ReadCloser + parser parser + + // objMode enables reading one object at a time, with the ID treated as the + // docid. This was added for the _revs_diff endpoint. + objMode bool + + dec *json.Decoder + closed int32 +} + +func newIter(ctx context.Context, meta interface{}, expectedKey string, body io.ReadCloser, parser parser) *iter { + return &iter{ + meta: meta, + expectedKey: expectedKey, + body: newCancelableReadCloser(ctx, body), + parser: parser, + } +} + +func (i *iter) next(row interface{}) error { + if atomic.LoadInt32(&i.closed) == 1 { + return io.EOF + } + if i.dec == nil { + // We haven't begun yet + i.dec = json.NewDecoder(i.body) + if err := i.begin(); err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + } + + err := i.nextRow(row) + if err != nil { + if err == io.EOF { + if e := i.finish(); e != nil { + err = e + } + return err + } + } + return err +} + +// begin parses the top-level of the result object; until rows +func (i *iter) begin() error { + if i.expectedKey == "" && !i.objMode { + return nil + } + // consume the first '{' + if err := consumeDelim(i.dec, json.Delim('{')); err != nil { + return err + } + if i.objMode { + return nil + } + for { + key, err := nextKey(i.dec) + if err != nil { + return err + } + if key == i.expectedKey { + // Consume the first '[' + return consumeDelim(i.dec, json.Delim('[')) + } + if err := i.parseMeta(key); err != nil { + return err + } + } +} + +func nextKey(dec *json.Decoder) (string, error) { + t, err := dec.Token() + if err != nil { + // I can't find a test case to trigger this, so it remains uncovered. + return "", err + } + key, ok := t.(string) + if !ok { + // The JSON parser should never permit this + return "", fmt.Errorf("Unexpected token: (%T) %v", t, t) + } + return key, nil +} + +func (i *iter) parseMeta(key string) error { + if i.meta == nil { + return nil + } + if mp, ok := i.parser.(metaParser); ok { + return mp.parseMeta(i.meta, i.dec, key) + } + return nil +} + +func (i *iter) finish() (err error) { + defer func() { + e2 := i.Close() + if err == nil { + err = e2 + } + }() + if i.expectedKey == "" && !i.objMode { + _, err := i.dec.Token() + if err != nil && err != io.EOF { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + return nil + } + if i.objMode { + err := consumeDelim(i.dec, json.Delim('}')) + if err != nil && err != io.EOF { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + return nil + } + if err := consumeDelim(i.dec, json.Delim(']')); err != nil { + return err + } + for i.dec.More() { + t, err := i.dec.Token() + if err != nil { + return err + } + switch v := t.(type) { + case json.Delim: + if v != json.Delim('}') { + // This should never happen, as the JSON parser should prevent it. + return fmt.Errorf("Unexpected JSON delimiter: %c", v) + } + case string: + if err := i.parseMeta(v); err != nil { + return err + } + default: + // This should never happen, as the JSON parser would never get + // this far. + return fmt.Errorf("Unexpected JSON token: (%T) '%s'", t, t) + } + } + return consumeDelim(i.dec, json.Delim('}')) + // return nil +} + +func (i *iter) nextRow(row interface{}) error { + if !i.dec.More() { + return io.EOF + } + return i.parser.decodeItem(row, i.dec) +} + +func (i *iter) Close() error { + atomic.StoreInt32(&i.closed, 1) + // body will be nil if we're iterating over a multi-query resultset. + if i.body == nil { + return nil + } + return i.body.Close() +} + +// consumeDelim consumes the expected delimiter from the stream, or returns an +// error if an unexpected token was found. +func consumeDelim(dec *json.Decoder, expectedDelim json.Delim) error { + t, err := dec.Token() + if err != nil { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + d, ok := t.(json.Delim) + if !ok { + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: fmt.Errorf("Unexpected token %T: %v", t, t)} + } + if d != expectedDelim { + return unexpectedDelim(d) + } + return nil +} + +// unexpectedDelim is used to indicate to the multiQueriesRows type that the +// end of input has been reached, while behaving as an unexpected delimter +// error to all other code. +type unexpectedDelim byte + +func (d unexpectedDelim) Error() string { + return fmt.Sprintf("Unexpected JSON delimiter: %c", d) +} + +func (d unexpectedDelim) StatusCode() int { + return http.StatusBadGateway +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/json.go b/vendor/github.com/go-kivik/couchdb/v3/json.go new file mode 100644 index 00000000000..e25377be58e --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/json.go @@ -0,0 +1,35 @@ +package couchdb + +import ( + "encoding/json" + "net/http" + + kivik "github.com/go-kivik/kivik/v3" +) + +// encodeKey encodes a key to a view query, or similar, to be passed to CouchDB. +func encodeKey(i interface{}) (string, error) { + if raw, ok := i.(json.RawMessage); ok { + return string(raw), nil + } + raw, err := json.Marshal(i) + if err != nil { + err = &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + return string(raw), err +} + +var jsonKeys = []string{"endkey", "end_key", "key", "startkey", "start_key", "keys", "doc_ids"} + +func encodeKeys(opts map[string]interface{}) error { + for _, key := range jsonKeys { + if v, ok := opts[key]; ok { + new, err := encodeKey(v) + if err != nil { + return err + } + opts[key] = new + } + } + return nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/options.go b/vendor/github.com/go-kivik/couchdb/v3/options.go new file mode 100644 index 00000000000..4ec33402359 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/options.go @@ -0,0 +1,37 @@ +package couchdb + +import ( + "fmt" + "net/http" + + kivik "github.com/go-kivik/kivik/v3" +) + +func fullCommit(opts map[string]interface{}) (bool, error) { + fc, ok := opts[OptionFullCommit] + if !ok { + return false, nil + } + fcBool, ok := fc.(bool) + if !ok { + return false, &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: fmt.Errorf("kivik: option '%s' must be bool, not %T", OptionFullCommit, fc)} + } + delete(opts, OptionFullCommit) + return fcBool, nil +} + +func ifNoneMatch(opts map[string]interface{}) (string, error) { + inm, ok := opts[OptionIfNoneMatch] + if !ok { + return "", nil + } + inmString, ok := inm.(string) + if !ok { + return "", &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: fmt.Errorf("kivik: option '%s' must be string, not %T", OptionIfNoneMatch, inm)} + } + delete(opts, OptionIfNoneMatch) + if inmString[0] != '"' { + return `"` + inmString + `"`, nil + } + return inmString, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/replication.go b/vendor/github.com/go-kivik/couchdb/v3/replication.go new file mode 100644 index 00000000000..8ae09f01e57 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/replication.go @@ -0,0 +1,319 @@ +package couchdb + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strconv" + "strings" + "sync" + "time" + + "github.com/go-kivik/couchdb/v3/chttp" + kivik "github.com/go-kivik/kivik/v3" + "github.com/go-kivik/kivik/v3/driver" +) + +type replicationError struct { + status int + reason string +} + +func (re *replicationError) Error() string { + return re.reason +} + +func (re *replicationError) StatusCode() int { + return re.status +} + +func (re *replicationError) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &re.reason); err != nil { + return err + } + switch (strings.SplitN(re.reason, ":", 2))[0] { + case "db_not_found": + re.status = http.StatusNotFound + case "timeout": + re.status = http.StatusRequestTimeout + case "unauthorized": + re.status = http.StatusUnauthorized + default: + re.status = http.StatusInternalServerError + } + return nil +} + +type replicationStateTime time.Time + +func (t *replicationStateTime) UnmarshalJSON(data []byte) error { + input := string(bytes.Trim(data, `"`)) + if ts, err := time.Parse(time.RFC3339, input); err == nil { + *t = replicationStateTime(ts) + return nil + } + // Fallback for really old versions of CouchDB + if seconds, err := strconv.ParseInt(input, 10, 64); err == nil { + epochTime := replicationStateTime(time.Unix(seconds, 0).UTC()) + *t = epochTime + return nil + } + return &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: fmt.Errorf("kivik: '%s' does not appear to be a valid timestamp", string(data))} +} + +type replication struct { + docID string + replicationID string + source string + target string + startTime time.Time + endTime time.Time + state string + err error + + // mu protects the above values + mu sync.RWMutex + + *db +} + +var _ driver.Replication = &replication{} + +func (c *client) fetchReplication(ctx context.Context, docID string) *replication { + rep := c.newReplication(docID) + rep.db = &db{client: c, dbName: "_replicator"} + // Do an update to get the initial state, but don't fail if there's an error + // at this stage, because we successfully created the replication doc. + _ = rep.updateMain(ctx) + return rep +} + +func (c *client) newReplication(docID string) *replication { + return &replication{ + docID: docID, + db: &db{ + client: c, + dbName: "_replicator", + }, + } +} + +func (r *replication) readLock() func() { + r.mu.RLock() + return r.mu.RUnlock +} + +func (r *replication) ReplicationID() string { defer r.readLock()(); return r.replicationID } +func (r *replication) Source() string { defer r.readLock()(); return r.source } +func (r *replication) Target() string { defer r.readLock()(); return r.target } +func (r *replication) StartTime() time.Time { defer r.readLock()(); return r.startTime } +func (r *replication) EndTime() time.Time { defer r.readLock()(); return r.endTime } +func (r *replication) State() string { defer r.readLock()(); return r.state } +func (r *replication) Err() error { defer r.readLock()(); return r.err } + +func (r *replication) Update(ctx context.Context, state *driver.ReplicationInfo) error { + if err := r.updateMain(ctx); err != nil { + return err + } + if r.State() == "complete" { + state.Progress = 100 + return nil + } + info, err := r.updateActiveTasks(ctx) + if err != nil { + if kivik.StatusCode(err) == http.StatusNotFound { + // not listed in _active_tasks (because the replication is done, or + // hasn't yet started), but this isn't an error + return nil + } + return err + } + state.DocWriteFailures = info.DocWriteFailures + state.DocsRead = info.DocsRead + state.DocsWritten = info.DocsWritten + // state.progress = info.Progress + return nil +} + +type activeTask struct { + Type string `json:"type"` + ReplicationID string `json:"replication_id"` + DocsWritten int64 `json:"docs_written"` + DocsRead int64 `json:"docs_read"` + DocWriteFailures int64 `json:"doc_write_failures"` +} + +func (r *replication) updateActiveTasks(ctx context.Context) (*activeTask, error) { + resp, err := r.client.DoReq(ctx, http.MethodGet, "/_active_tasks", nil) + if err != nil { + return nil, err + } + if err = chttp.ResponseError(resp); err != nil { + return nil, err + } + defer func() { _ = resp.Body.Close() }() + var tasks []*activeTask + if err = json.NewDecoder(resp.Body).Decode(&tasks); err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadGateway, Err: err} + } + for _, task := range tasks { + if task.Type != "replication" { + continue + } + repIDparts := strings.SplitN(task.ReplicationID, "+", 2) + if repIDparts[0] != r.replicationID { + continue + } + return task, nil + } + return nil, &kivik.Error{HTTPStatus: http.StatusNotFound, Err: errors.New("task not found")} +} + +// updateMain updates the "main" fields: those stored directly in r. +func (r *replication) updateMain(ctx context.Context) error { + doc, err := r.getReplicatorDoc(ctx) + if err != nil { + return err + } + r.setFromReplicatorDoc(doc) + return nil +} + +func (r *replication) getReplicatorDoc(ctx context.Context) (*replicatorDoc, error) { + row, err := r.db.Get(ctx, r.docID, nil) + if err != nil { + return nil, err + } + var doc replicatorDoc + err = json.NewDecoder(row.Body).Decode(&doc) + return &doc, err +} + +func (r *replication) setFromReplicatorDoc(doc *replicatorDoc) { + r.mu.Lock() + defer r.mu.Unlock() + switch kivik.ReplicationState(doc.State) { + case kivik.ReplicationStarted: + r.startTime = time.Time(doc.StateTime) + case kivik.ReplicationError, kivik.ReplicationComplete: + r.endTime = time.Time(doc.StateTime) + } + r.state = doc.State + if doc.Error != nil { + r.err = doc.Error + } else { + r.err = nil + } + if r.source == "" { + r.source = doc.Source + } + if r.target == "" { + r.target = doc.Target + } + if r.replicationID == "" { + r.replicationID = doc.ReplicationID + } +} + +func (r *replication) Delete(ctx context.Context) error { + _, rev, err := r.GetMeta(ctx, r.docID, nil) + if err != nil { + return err + } + _, err = r.db.Delete(ctx, r.docID, rev, nil) + return err +} + +type replicatorDoc struct { + DocID string `json:"_id"` + ReplicationID string `json:"_replication_id"` + Source string `json:"source"` + Target string `json:"target"` + State string `json:"_replication_state"` + StateTime replicationStateTime `json:"_replication_state_time"` + Error *replicationError `json:"_replication_state_reason,omitempty"` +} + +func (c *client) GetReplications(ctx context.Context, options map[string]interface{}) ([]driver.Replication, error) { + scheduler, err := c.schedulerSupported(ctx) + if err != nil { + return nil, err + } + if scheduler { + return c.getReplicationsFromScheduler(ctx, options) + } + return c.legacyGetReplications(ctx, options) +} + +func (c *client) legacyGetReplications(ctx context.Context, options map[string]interface{}) ([]driver.Replication, error) { + if options == nil { + options = map[string]interface{}{} + } + delete(options, "conflicts") + delete(options, "update_seq") + options["include_docs"] = true + params, err := optionsToParams(options) + if err != nil { + return nil, err + } + var result struct { + Rows []struct { + Doc replicatorDoc `json:"doc"` + } `json:"rows"` + } + path := "/_replicator/_all_docs?" + params.Encode() + if _, err = c.DoJSON(ctx, http.MethodGet, path, nil, &result); err != nil { + return nil, err + } + reps := make([]driver.Replication, 0, len(result.Rows)) + for _, row := range result.Rows { + if row.Doc.DocID == "_design/_replicator" { + continue + } + rep := c.newReplication(row.Doc.DocID) + rep.setFromReplicatorDoc(&row.Doc) + reps = append(reps, rep) + } + return reps, nil +} + +func (c *client) Replicate(ctx context.Context, targetDSN, sourceDSN string, options map[string]interface{}) (driver.Replication, error) { + if options == nil { + options = make(map[string]interface{}) + } + // Allow overriding source and target with options, i.e. for auth options + if _, ok := options["source"]; !ok { + options["source"] = sourceDSN + } + if _, ok := options["target"]; !ok { + options["target"] = targetDSN + } + if t := options["target"]; t == "" { + return nil, missingArg("targetDSN") + } + if s := options["source"]; s == "" { + return nil, missingArg("sourceDSN") + } + + scheduler, err := c.schedulerSupported(ctx) + if err != nil { + return nil, err + } + opts := &chttp.Options{ + Body: chttp.EncodeBody(options), + } + + var repStub struct { + ID string `json:"id"` + } + if _, e := c.Client.DoJSON(ctx, http.MethodPost, "/_replicator", opts, &repStub); e != nil { + return nil, e + } + if scheduler { + return c.fetchSchedulerReplication(ctx, repStub.ID) + } + return c.fetchReplication(ctx, repStub.ID), nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/rows.go b/vendor/github.com/go-kivik/couchdb/v3/rows.go new file mode 100644 index 00000000000..771e1b1e31f --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/rows.go @@ -0,0 +1,281 @@ +package couchdb + +import ( + "bytes" + "context" + "encoding/json" + "io" + "io/ioutil" + "strings" + "sync/atomic" + + "github.com/go-kivik/kivik/v3/driver" +) + +type rowsMeta struct { + offset int64 + totalRows int64 + updateSeq sequenceID + warning string + bookmark string +} + +type rows struct { + *iter + *rowsMeta +} + +var _ driver.Rows = &rows{} + +type rowsMetaParser struct{} + +func (p *rowsMetaParser) parseMeta(i interface{}, dec *json.Decoder, key string) error { + meta := i.(*rowsMeta) + return meta.parseMeta(key, dec) +} + +type rowParser struct { + rowsMetaParser +} + +var _ parser = &rowParser{} + +func (p *rowParser) decodeItem(i interface{}, dec *json.Decoder) error { + return dec.Decode(i) +} + +func newRows(ctx context.Context, in io.ReadCloser) driver.Rows { + meta := &rowsMeta{} + return &rows{ + iter: newIter(ctx, meta, "rows", in, &rowParser{}), + rowsMeta: meta, + } +} + +type findParser struct { + rowsMetaParser +} + +var _ parser = &findParser{} + +func (p *findParser) decodeItem(i interface{}, dec *json.Decoder) error { + row := i.(*driver.Row) + return dec.Decode(&row.Doc) +} + +func newFindRows(ctx context.Context, in io.ReadCloser) driver.Rows { + meta := &rowsMeta{} + return &rows{ + iter: newIter(ctx, meta, "docs", in, &findParser{}), + rowsMeta: meta, + } +} + +type bulkParser struct { + rowsMetaParser +} + +var _ parser = &bulkParser{} + +func (p *bulkParser) decodeItem(i interface{}, dec *json.Decoder) error { + row := i.(*driver.Row) + var result bulkResult + if err := dec.Decode(&result); err != nil { + return err + } + row.ID = result.ID + row.Doc = result.Docs[0].Doc + row.Error = nil + if err := result.Docs[0].Error; err != nil { + row.Error = err + } + return nil +} + +func newBulkGetRows(ctx context.Context, in io.ReadCloser) driver.Rows { + meta := &rowsMeta{} + return &rows{ + iter: newIter(ctx, meta, "results", in, &bulkParser{}), + rowsMeta: meta, + } +} + +func (r *rows) Offset() int64 { + return r.offset +} + +func (r *rows) TotalRows() int64 { + return r.totalRows +} + +func (r *rows) Warning() string { + return r.warning +} + +func (r *rows) Bookmark() string { + return r.bookmark +} + +func (r *rows) UpdateSeq() string { + return string(r.updateSeq) +} + +func (r *rows) Next(row *driver.Row) error { + row.Error = nil + return r.iter.next(row) +} + +// parseMeta parses result metadata +func (r *rowsMeta) parseMeta(key string, dec *json.Decoder) error { + switch key { + case "update_seq": + return dec.Decode(&r.updateSeq) + case "offset": + return dec.Decode(&r.offset) + case "total_rows": + return dec.Decode(&r.totalRows) + case "warning": + return dec.Decode(&r.warning) + case "bookmark": + return dec.Decode(&r.bookmark) + default: + // Just consume the value, since we don't know what it means. + var discard json.RawMessage + return dec.Decode(&discard) + } +} + +func newMultiQueriesRows(ctx context.Context, in io.ReadCloser) driver.Rows { + return &multiQueriesRows{ + ctx: ctx, + r: in, + } +} + +type multiQueriesRows struct { + *rows + ctx context.Context + r io.ReadCloser + dec *json.Decoder + queryIndex int + closed int32 + + // legacy indicates this is an old-style iterator, and won't have more than + // one resultset. + legacy int32 +} + +func (r *multiQueriesRows) Next(row *driver.Row) error { + if atomic.LoadInt32(&r.closed) == 1 { + return io.EOF + } + if r.rows != nil && atomic.LoadInt32(&r.rows.closed) == 1 { + if err := r.nextQuery(); err != nil { + return err + } + } + if r.dec == nil { + if err := r.begin(); err != nil { + return err + } + } + if err := r.rows.Next(row); err != nil { + if err == io.EOF && atomic.LoadInt32(&r.legacy) == 0 { + return driver.EOQ + } + return err + } + return nil +} + +func (r *multiQueriesRows) begin() error { + r.dec = json.NewDecoder(r.r) + // consume the first '{' + if err := consumeDelim(r.dec, json.Delim('{')); err != nil { + return err + } + key, err := nextKey(r.dec) + if err != nil { + return err + } + if key != "results" { + // These indicate the server does not support multiple queries; probably + // an old version. Fall back to the standard iterator. + atomic.StoreInt32(&r.legacy, 1) + keyJSON, _ := json.Marshal(key) + var in io.ReadCloser = struct { + io.Reader + io.Closer + }{ + Reader: io.MultiReader( + strings.NewReader("{"), + bytes.NewReader(keyJSON), + r.dec.Buffered(), + r.r), + Closer: r.r, + } + r.rows = newRows(r.ctx, in).(*rows) + r.rows.body = nil + r.rows.dec = json.NewDecoder(in) + return r.rows.begin() + } + // consume the opening '[' + if err := consumeDelim(r.dec, json.Delim('[')); err != nil { + return err + } + r.rows = newRows(r.ctx, r.r).(*rows) + r.rows.body = nil + r.rows.iter.dec = r.dec + return r.rows.iter.begin() +} + +func (r *multiQueriesRows) nextQuery() error { + if atomic.LoadInt32(&r.legacy) == 1 { + if err := r.Close(); err != nil { + return err + } + return io.EOF + } + rows := newRows(r.ctx, r.r).(*rows) + rows.iter.dec = r.dec + if err := rows.iter.begin(); err != nil { + // I'd normally use errors.As, but I want to retain backward + // compatibility to at least Go 1.11. + if ud, _ := err.(unexpectedDelim); ud == unexpectedDelim(']') { + if err := r.Close(); err != nil { + return err + } + return io.EOF + } + return err + } + r.queryIndex++ + r.rows = rows + r.rows.body = nil + return nil +} + +func (r *multiQueriesRows) Close() error { + if atomic.AddInt32(&r.closed, 1) > 1 { + return nil + } + r.dec = nil + if r.rows != nil { + defer r.rows.Close() // nolint:errcheck + } + defer r.r.Close() // nolint:errcheck + if _, err := ioutil.ReadAll(r.r); err != nil { + return err + } + if err := r.r.Close(); err != nil { + return err + } + if r.rows == nil { + return nil + } + return r.rows.Close() +} + +func (r *multiQueriesRows) QueryIndex() int { + return r.queryIndex +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/scheduler.go b/vendor/github.com/go-kivik/couchdb/v3/scheduler.go new file mode 100644 index 00000000000..9f41fbf25c9 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/scheduler.go @@ -0,0 +1,235 @@ +package couchdb + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/http" + "time" + + "github.com/go-kivik/couchdb/v3/chttp" + "github.com/go-kivik/kivik/v3/driver" +) + +type schedulerDoc struct { + Database string `json:"database"` + DocID string `json:"doc_id"` + ReplicationID string `json:"id"` + Source string `json:"source"` + Target string `json:"target"` + StartTime time.Time `json:"start_time"` + LastUpdated time.Time `json:"last_updated"` + State string `json:"state"` + Info repInfo `json:"info"` +} + +type repInfo struct { + Error error + DocsRead int64 `json:"docs_read"` + DocsWritten int64 `json:"docs_written"` + DocWriteFailures int64 `json:"doc_write_failures"` + Pending int64 `json:"changes_pending"` +} + +func (i *repInfo) UnmarshalJSON(data []byte) error { + switch { + case string(data) == "null": + return nil + case bytes.HasPrefix(data, []byte(`{"error":`)): + var e struct { + Error *replicationError `json:"error"` + } + if err := json.Unmarshal(data, &e); err != nil { + return err + } + i.Error = e.Error + case data[0] == '{': + type repInfoClone repInfo + var x repInfoClone + if err := json.Unmarshal(data, &x); err != nil { + return err + } + *i = repInfo(x) + default: + var e replicationError + if err := json.Unmarshal(data, &e); err != nil { + return err + } + i.Error = &e + } + return nil +} + +type schedulerReplication struct { + docID string + database string + replicationID string + source string + target string + startTime time.Time + lastUpdated time.Time + state string + info repInfo + + *db +} + +var _ driver.Replication = &schedulerReplication{} + +func (c *client) schedulerSupported(ctx context.Context) (bool, error) { + c.sdMU.Lock() + defer c.sdMU.Unlock() + if c.schedulerDetected != nil { + return *c.schedulerDetected, nil + } + resp, err := c.DoReq(ctx, http.MethodHead, "_scheduler/jobs", nil) + if err != nil { + return false, err + } + var supported bool + switch resp.StatusCode { + case http.StatusBadRequest: + // 1.6.x, 1.7.x + supported = false + case http.StatusNotFound: + // 2.0.x + supported = false + case http.StatusOK, http.StatusUnauthorized: + // 2.1.x + + supported = true + default: + // Assume not supported + supported = false + } + c.schedulerDetected = &supported + return supported, nil +} + +func (c *client) newSchedulerReplication(doc *schedulerDoc) *schedulerReplication { + rep := &schedulerReplication{ + db: &db{ + client: c, + dbName: doc.Database, + }, + } + rep.setFromDoc(doc) + return rep +} + +func (r *schedulerReplication) setFromDoc(doc *schedulerDoc) { + if r.source == "" { + r.docID = doc.DocID + r.database = doc.Database + r.replicationID = doc.ReplicationID + r.source = doc.Source + r.target = doc.Target + r.startTime = doc.StartTime + } + r.lastUpdated = doc.LastUpdated + r.state = doc.State + r.info = doc.Info +} + +func (c *client) fetchSchedulerReplication(ctx context.Context, docID string) (*schedulerReplication, error) { + rep := &schedulerReplication{ + docID: docID, + database: "_replicator", + db: &db{ + client: c, + dbName: "_replicator", + }, + } + for rep.source == "" { + if err := rep.update(ctx); err != nil { + return rep, err + } + time.Sleep(100 * time.Millisecond) + } + return rep, nil +} + +func (r *schedulerReplication) StartTime() time.Time { return r.startTime } +func (r *schedulerReplication) EndTime() time.Time { + if r.state == "failed" || r.state == "completed" { + return r.lastUpdated + } + return time.Time{} +} +func (r *schedulerReplication) Err() error { return r.info.Error } +func (r *schedulerReplication) ReplicationID() string { return r.replicationID } +func (r *schedulerReplication) Source() string { return r.source } +func (r *schedulerReplication) Target() string { return r.target } +func (r *schedulerReplication) State() string { return r.state } + +func (r *schedulerReplication) Update(ctx context.Context, rep *driver.ReplicationInfo) error { + if err := r.update(ctx); err != nil { + return err + } + rep.DocWriteFailures = r.info.DocWriteFailures + rep.DocsRead = r.info.DocsRead + rep.DocsWritten = r.info.DocsWritten + return nil +} + +func (r *schedulerReplication) Delete(ctx context.Context) error { + _, rev, err := r.GetMeta(ctx, r.docID, nil) + if err != nil { + return err + } + _, err = r.db.Delete(ctx, r.docID, rev, nil) + return err +} + +// isBug1000 detects a race condition bug in CouchDB 2.1.x so the attempt can +// be retried. See https://github.com/apache/couchdb/issues/1000 +func isBug1000(err error) bool { + if err == nil { + return false + } + cerr, ok := err.(*chttp.HTTPError) + if !ok { + // should never happen + return false + } + if cerr.Response.StatusCode != http.StatusInternalServerError { + return false + } + return cerr.Reason == "function_clause" +} + +func (r *schedulerReplication) update(ctx context.Context) error { + path := fmt.Sprintf("/_scheduler/docs/%s/%s", r.database, chttp.EncodeDocID(r.docID)) + var doc schedulerDoc + if _, err := r.db.Client.DoJSON(ctx, http.MethodGet, path, nil, &doc); err != nil { + if isBug1000(err) { + return r.update(ctx) + } + return err + } + r.setFromDoc(&doc) + return nil +} + +func (c *client) getReplicationsFromScheduler(ctx context.Context, options map[string]interface{}) ([]driver.Replication, error) { + params, err := optionsToParams(options) + if err != nil { + return nil, err + } + var result struct { + Docs []schedulerDoc `json:"docs"` + } + path := "/_scheduler/docs" + if params != nil { + path = path + "?" + params.Encode() + } + if _, err = c.DoJSON(ctx, http.MethodGet, path, nil, &result); err != nil { + return nil, err + } + reps := make([]driver.Replication, 0, len(result.Docs)) + for _, row := range result.Docs { + rep := c.newSchedulerReplication(&row) + reps = append(reps, rep) + } + return reps, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/seqid.go b/vendor/github.com/go-kivik/couchdb/v3/seqid.go new file mode 100644 index 00000000000..189285ed4fc --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/seqid.go @@ -0,0 +1,15 @@ +package couchdb + +import "bytes" + +// sequenceID is a CouchDB update sequence ID. This is just a string, but has +// a special JSON unmarshaler to work with both CouchDB 2.0.0 (which uses +// normal) strings for sequence IDs, and earlier versions (which use integers) +type sequenceID string + +// UnmarshalJSON satisfies the json.Unmarshaler interface. +func (id *sequenceID) UnmarshalJSON(data []byte) error { + sid := sequenceID(bytes.Trim(data, `""`)) + *id = sid + return nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/session.go b/vendor/github.com/go-kivik/couchdb/v3/session.go new file mode 100644 index 00000000000..6ccb9d75a6d --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/session.go @@ -0,0 +1,50 @@ +package couchdb + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +type session struct { + Data json.RawMessage + Info authInfo `json:"info"` + UserCtx userContext `json:"userCtx"` +} + +type authInfo struct { + AuthenticationMethod string `json:"authenticated"` + AuthenticationDB string `json:"authentiation_db"` + AuthenticationHandlers []string `json:"authentication_handlers"` +} + +type userContext struct { + Name string `json:"name"` + Roles []string `json:"roles"` +} + +func (s *session) UnmarshalJSON(data []byte) error { + type alias session + var a alias + if err := json.Unmarshal(data, &a); err != nil { + return err + } + *s = session(a) + s.Data = data + return nil +} + +func (c *client) Session(ctx context.Context) (*driver.Session, error) { + s := &session{} + _, err := c.DoJSON(ctx, http.MethodGet, "/_session", nil, s) + return &driver.Session{ + RawResponse: s.Data, + Name: s.UserCtx.Name, + Roles: s.UserCtx.Roles, + AuthenticationMethod: s.Info.AuthenticationMethod, + AuthenticationDB: s.Info.AuthenticationDB, + AuthenticationHandlers: s.Info.AuthenticationHandlers, + }, err +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/util.go b/vendor/github.com/go-kivik/couchdb/v3/util.go new file mode 100644 index 00000000000..e7a672bfea4 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/util.go @@ -0,0 +1,29 @@ +package couchdb + +import ( + "encoding/json" + "net/http" + + kivik "github.com/go-kivik/kivik/v3" +) + +// deJSONify unmarshals a string, []byte, or json.RawMessage. All other types +// are returned as-is. +func deJSONify(i interface{}) (interface{}, error) { + var data []byte + switch t := i.(type) { + case string: + data = []byte(t) + case []byte: + data = t + case json.RawMessage: + data = []byte(t) + default: + return i, nil + } + var x interface{} + if err := json.Unmarshal(data, &x); err != nil { + return nil, &kivik.Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + return x, nil +} diff --git a/vendor/github.com/go-kivik/couchdb/v3/version.go b/vendor/github.com/go-kivik/couchdb/v3/version.go new file mode 100644 index 00000000000..d29b139c470 --- /dev/null +++ b/vendor/github.com/go-kivik/couchdb/v3/version.go @@ -0,0 +1,43 @@ +package couchdb + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +// Version returns the server's version info. +func (c *client) Version(ctx context.Context) (*driver.Version, error) { + i := &info{} + _, err := c.DoJSON(ctx, http.MethodGet, "/", nil, i) + return &driver.Version{ + Version: i.Version, + Vendor: i.Vendor.Name, + Features: i.Features, + RawResponse: i.Data, + }, err +} + +type info struct { + Data json.RawMessage + Version string `json:"version"` + Features []string `json:"features"` + Vendor struct { + Name string `json:"name"` + } `json:"vendor"` +} + +func (i *info) UnmarshalJSON(data []byte) error { + type alias info + var a alias + if err := json.Unmarshal(data, &a); err != nil { + return err + } + i.Data = data + i.Version = a.Version + i.Vendor = a.Vendor + i.Features = a.Features + return nil +} diff --git a/vendor/github.com/go-kivik/kivik/v3/.codecov.yml b/vendor/github.com/go-kivik/kivik/v3/.codecov.yml new file mode 100644 index 00000000000..52cd7a41789 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/.codecov.yml @@ -0,0 +1,2 @@ +ignore: + - test/**/* diff --git a/vendor/github.com/go-kivik/kivik/v3/.gitignore b/vendor/github.com/go-kivik/kivik/v3/.gitignore new file mode 100644 index 00000000000..a918b00d84c --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/.gitignore @@ -0,0 +1,6 @@ +test/pouch__all_dbs__/ +vendor +test.* +Gopkg.lock +node_modules +coverage.txt diff --git a/vendor/github.com/go-kivik/kivik/v3/.gitlab-ci.yml b/vendor/github.com/go-kivik/kivik/v3/.gitlab-ci.yml new file mode 100644 index 00000000000..ed57f79381a --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/.gitlab-ci.yml @@ -0,0 +1,83 @@ +stages: + - test + +variables: + GO111MODULE: "on" + COUCHDB_USER: admin + COUCHDB_PASSWORD: abc123 + KIVIK_TEST_DSN_COUCH23: http://admin:abc123@couch23:5984/ + KIVIK_TEST_DSN_COUCH30: http://admin:abc123@couch30:5984/ + +.test: &test_template + stage: test + services: + - name: apache/couchdb:2.3.1 + alias: couch23 + - name: apache/couchdb:3.0.0 + alias: couch30 + before_script: + - ./script/complete_couch2.sh ${KIVIK_TEST_DSN_COUCH23} + - ./script/complete_couch2.sh ${KIVIK_TEST_DSN_COUCH30} + script: + - go mod download + - ./script/test_version.sh + - go test -race -tags=livetest ./... + +linter: + stage: test + image: golangci/golangci-lint:v1.33 + script: + - go mod download + - golangci-lint run ./... + +go-1.11: + <<: *test_template + image: golang:1.11 + +go-1.12: + <<: *test_template + image: golang:1.12 + +go-1.13: + <<: *test_template + image: golang:1.13 + +go-1.14: + <<: *test_template + image: golang:1.14 + +go-1.15: + <<: *test_template + image: golang:1.15 + +gopherjs-1.12: + <<: *test_template + image: golang:1.14 + variables: + SRCDIR: /go/src/github.com/go-kivik/kivik/v3 + script: + - go get golang.org/dl/go1.12.16 + - go1.12.16 download + - mkdir -p ${SRCDIR} + - mv ${CI_PROJECT_DIR}/* ${SRCDIR} + - cd ${SRCDIR} + - go mod vendor + - curl -sL https://deb.nodesource.com/setup_12.x | bash - + - apt-get update -qq && apt-get install -y nodejs + - npm install + - GO111MODULE=off go get -u github.com/gopherjs/gopherjs + - npm install source-map-support + - | + ( + cd $GOPATH/src/github.com/gopherjs/gopherjs/node-syscall/ + npm install --global node-gyp + node-gyp rebuild + mkdir -p ~/.node_libraries/ + cp build/Release/syscall.node ~/.node_libraries/syscall.node + ) + - GOPHERJS_GOROOT="$(go1.12.16 env GOROOT)" gopherjs test ./... + +go-rc: + <<: *test_template + image: golang:rc + allow_failure: true diff --git a/vendor/github.com/go-kivik/kivik/v3/.golangci.toml b/vendor/github.com/go-kivik/kivik/v3/.golangci.toml new file mode 100644 index 00000000000..44a20fe9d67 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/.golangci.toml @@ -0,0 +1,12 @@ +[output] +format = "colored-line-number" + +[linters] +enable = [ + "interfacer", "gocyclo", "unconvert", "goimports", "unused", "varcheck", + "vetshadow", "misspell", "nakedret", "errcheck", "golint", "ineffassign", + "deadcode", "goconst", "vet", "unparam", "gofumpt" +] + +[issues] +exclude-use-default = false \ No newline at end of file diff --git a/vendor/github.com/go-kivik/kivik/v3/CONTRIBUTING.md b/vendor/github.com/go-kivik/kivik/v3/CONTRIBUTING.md new file mode 100644 index 00000000000..fa05cdd8590 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing + +Kivik is an open source project, and contributions are always welcome. + +Contributing to Kivik involves very little formal procedure. Anyone is +encouraged to file bug reports, feature requests, or submit PRs. PRs are not +guaranteed to be accepted, but they are guaranteed to be reviewed and discussed. +For any large-scale change, opening an issue to discuss the change prior to +submitting a PR is probably appropriate, to avoid possibly wasting time on an +implementation that may not be accepted. + +## Licensing + +Kivik is licensed under the Apache license, version 2.0. All code contributions +to this project are therefore also contributed under the same license. **If you +are uncomfortable with, or unable to comply with this** (perhaps due to legal +limitations imposed by your employer), **DO NOT SUBMIT CODE**! You are still +welcome to participate in bug reports and discussions. diff --git a/vendor/github.com/go-kivik/kivik/v3/ISSUE_TEMPLATE.md b/vendor/github.com/go-kivik/kivik/v3/ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..a6650972da7 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ +## Bug Report Checklist (remove this template if submitting a feature request) + +1. Which version of Kivik are you using? + +2. Which version of Go are you using? (Output of `go version`) -- Kivik 1.x aims to support all versions of Go from 1.7. The master branch aims to support Go 1.8 and later. + +3. What did you do? (Include your code if possible) + +4. What did you expect to see? + +5. What did you see instead? diff --git a/vendor/github.com/go-kivik/kivik/v3/LICENSE.md b/vendor/github.com/go-kivik/kivik/v3/LICENSE.md new file mode 100644 index 00000000000..0a2865e5495 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/LICENSE.md @@ -0,0 +1,13 @@ +Copyright (c) 2017 Jonathan Hall + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/github.com/go-kivik/kivik/v3/README.md b/vendor/github.com/go-kivik/kivik/v3/README.md new file mode 100644 index 00000000000..eca6028ae5d --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/README.md @@ -0,0 +1,174 @@ +[![Build Status](https://gitlab.com/go-kivik/kivik/badges/master/pipeline.svg)](https://gitlab.com/go-kivik/kivik/pipelines) [![Codecov](https://img.shields.io/codecov/c/github/go-kivik/kivik.svg?style=flat)](https://codecov.io/gh/go-kivik/kivik) [![Go Report Card](https://goreportcard.com/badge/github.com/go-kivik/kivik)](https://goreportcard.com/report/github.com/go-kivik/kivik) [![GoDoc](https://godoc.org/github.com/go-kivik/kivik?status.svg)](http://godoc.org/github.com/go-kivik/kivik) [![Website](https://img.shields.io/website-up-down-green-red/http/kivik.io.svg?label=website&colorB=007fff)](http://kivik.io) + +# Kivik + +Package kivik provides a common interface to CouchDB or CouchDB-like databases. + +The kivik package must be used in conjunction with a database driver. + +The kivik driver system is modeled after the standard library's [sql](https://golang.org/pkg/database/sql/) +and [sql/driver](https://golang.org/pkg/database/sql/driver/) packages, although +the client API is completely different due to the different database models +implemented by SQL and NoSQL databases such as CouchDB. + +# Versions + +You are browsing the **stable v3** branch of Kivik. For the latest changes, you +may be interested in the [development branch](https://github.com/go-kivik/kivik). + +Example configuration for common dependency managers follow. + +## Go Modules + +Kivik 3.x and later depends on Go modules, which requires Go 1.11 or later. If +your project does not use modules, and you are unable to switch, you may use +[Kivik 2.x](https://github.com/go-kivik/kivik/tree/v2). + +# Installation + +Install Kivik as you normally would for any Go package: + + go get -u github.com/go-kivik/kivik/v3 + go get -u github.com/go-kivik/couchdb/v3 + +This will install the main Kivik package and the CouchDB database driver. See +the [list of Kivik database drivers](https://github.com/go-kivik/kivik/wiki/Kivik-database-drivers) +for a complete list of available drivers. + +# Example Usage + +Please consult the the [package documentation](https://godoc.org/github.com/go-kivik/kivik) +for all available API methods, and a complete usage documentation. And for +additional usage examples, [consult the wiki](https://github.com/go-kivik/kivik/wiki/Usage-Examples). + +```go +package main + +import ( + "context" + "fmt" + + kivik "github.com/go-kivik/kivik/v3" + _ "github.com/go-kivik/couchdb/v3" // The CouchDB driver +) + +func main() { + client, err := kivik.New("couch", "http://localhost:5984/") + if err != nil { + panic(err) + } + + db := client.DB(context.TODO(), "animals") + + doc := map[string]interface{}{ + "_id": "cow", + "feet": 4, + "greeting": "moo", + } + + rev, err := db.Put(context.TODO(), "cow", doc) + if err != nil { + panic(err) + } + fmt.Printf("Cow inserted with revision %s\n", rev) +} +``` + +# Frequently Asked Questions + +Nobody has ever asked me any of these questions, so they're probably better called +"Never Asked Questions" or possibly "Imagined Questions." + +## Why another CouchDB client API? + +Read the [design goals](https://github.com/go-kivik/kivik/wiki/Design-goals) for +the general design goals. + +Specifically, I was motivated to write Kivik for a few reasons: + +1. I was unhappy with any of the existing CouchDB drivers for Go. The [best +one](https://github.com/fjl/go-couchdb) had a number of shortcomings: + + - It is no longer actively developed. + - It [doesn't have an open source license](https://github.com/fjl/go-couchdb/issues/15). + - It doesn't support iterating over result sets, forcing one to load all + results of a query into memory at once. + - It [doesn't support CouchDB 2.0](https://github.com/fjl/go-couchdb/issues/14) + sequence IDs or MongoDB-style queries. + - It doesn't natively support CookieAuth (it does allow a generic Auth method + which could be used to do this, but I think it's appropriate to put directly + in the library). + +2. I wanted a single client API that worked with both CouchDB and +[PouchDB](https://pouchdb.com/). I had previously written +[go-pouchdb](https://github.com/flimzy/go-pouchdb), a GopherJS wrapper around +the PouchDB library with a public API modeled after `fjl/go-couchdb`, but I +still wanted a unified driver infrastructure. + +3. I want an unambiguous, open source license. This software is released under +the Apache 2.0 license. See the included LICENSE.md file for details. + +4. I wanted the ability to mock CouchDB connections for testing. This is possible +with the `sql` / `sql/driver` approach by implementing a mock driver, but was +not possible with any existing CouchDB client libraries. This library makes that +possible for CouchDB apps, too. + +5. I wanted a simple, mock CouchDB server I could use for testing. It doesn't +need to be efficient, or support all CouchDB servers, but it should be enough +to test the basic functionality of a PouchDB app, for instance. Kivik aims to +do this with the `kivik serve` command, in the near future. + +6. I wanted a toolkit that would make it easy to build a proxy to sit in front +of CouchDB to handle custom authentication or other logic that CouchDB cannot +support natively. Kivik aims to accomplish this in the future. + +## What are Kivik's requirements? + +Kivik's test suite is automatically run on Linux for every pull request, but +should work on all supported Go architectures. If you find it not working for +your OS/architecture, please submit a bug report. + +Below are the compatibility targets for specific runtime and database versions. +If you discover a bug affecting any of these supported environments, please let +me know by submitting a bug report via GitHub. + +- **Go** Kivik 3.x aims for full compatibility with all stable releases of Go + from 1.9. For Go 1.7 or 1.8 you can use [Kivik 1.x](https://github.com/go-kivik/kivik/tree/v1) +- **CouchDB** The Kivik 3.x CouchDB driver aims for compatibility with all + stable releases of CouchDB from 1.6.1. +- **GopherJS** GopherJS always requires the latest stable version of Go, so + building Kivik with GopherJS has this same requirement. +- **PouchDB** The Kivik 3.x PouchDB driver aims for compatibility with all + stable releases of PouchDB from 6.0.0. + +## What is the development status? + +Kivik 3.x is considered production-ready and comes with a complete client API +client and backend drivers for CouchDB and PouchDB. + +Future goals are to flesh out the Memory driver, which will make automated +testing without a real CouchDB server easier. Then I will work on completing +the 'serve' mode. + +You can see a complete overview of the current status on the +[Compatibility chart](https://github.com/go-kivik/kivik/blob/master/doc/COMPATIBILITY.md) + +## Why the name "Kivik"? + +[Kivik](http://www.ikea.com/us/en/catalog/categories/series/18329/) is a line +of sofas (couches) from IKEA. And in the spirit of IKEA, and build-your-own +furniture, Kivik aims to allow you to "build your own" CouchDB client, server, +and proxy applications. + +## What license is Kivik released under? + +This software is released under the terms of the Apache 2.0 license. See +LICENCE.md, or read the [full license](http://www.apache.org/licenses/LICENSE-2.0). + +## What projects currently use Kivik? + +If your project uses Kivik, and you'd like to be added to this list, create an +issue or submit a pull request. + +- [Cayley](https://github.com/cayleygraph/cayley) is an open-source graph + database. It uses Kivik for the CouchDB and PouchDB storage backends. diff --git a/vendor/github.com/go-kivik/kivik/v3/attachments.go b/vendor/github.com/go-kivik/kivik/v3/attachments.go new file mode 100644 index 00000000000..197d799e04a --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/attachments.go @@ -0,0 +1,175 @@ +package kivik + +import ( + "bytes" + "encoding/json" + "io" + "io/ioutil" + + "github.com/go-kivik/kivik/v3/driver" +) + +// Attachments is a collection of one or more file attachments. +type Attachments map[string]*Attachment + +// Get fetches the requested attachment, or returns nil if it does not exist. +func (a *Attachments) Get(filename string) *Attachment { + return map[string]*Attachment(*a)[filename] +} + +// Set sets the attachment associated with filename in the collection, +// replacing it if it already existed. +func (a *Attachments) Set(filename string, att *Attachment) { + map[string]*Attachment(*a)[filename] = att +} + +// Delete removes the specified file from the collection. +func (a *Attachments) Delete(filename string) { + delete(map[string]*Attachment(*a), filename) +} + +// Attachment represents a file attachment on a CouchDB document. +type Attachment struct { + // Filename is the name of the attachment. + Filename string `json:"-"` + + // ContentType is the MIME type of the attachment contents. + ContentType string `json:"content_type"` + + // Stub will be true if the data structure only represents file metadata, + // and contains no actual content. Stub will be true when returned by the + // GetAttachmentMeta function, or when included in a document without the + // 'include_docs' option. + Stub bool `json:"stub"` + + // Follows will be true when reading attachments in multipart/related + // format. + Follows bool `json:"follows"` + + // Content represents the attachment's content. + // + // Kivik will always return a non-nil Content, even for 0-byte attachments + // or when Stub is true. It is the caller's responsibility to close + // Content. + Content io.ReadCloser `json:"-"` + + // Size records the uncompressed size of the attachment. The value -1 + // indicates that the length is unknown. Unless Stub is true, values >= 0 + // indicate that the given number of bytes may be read from Content. + Size int64 `json:"length"` + + // Used compression codec, if any. Will be the empty string if the + // attachment is uncompressed. + ContentEncoding string `json:"encoding"` + + // EncodedLength records the compressed attachment size in bytes. Only + // meaningful when ContentEncoding is defined. + EncodedLength int64 `json:"encoded_length"` + + // RevPos is the revision number when attachment was added. + RevPos int64 `json:"revpos"` + + // Digest is the content hash digest. + Digest string `json:"digest"` +} + +// bufCloser wraps a *bytes.Buffer to create an io.ReadCloser +type bufCloser struct { + *bytes.Buffer +} + +var _ io.ReadCloser = &bufCloser{} + +func (b *bufCloser) Close() error { return nil } + +// validate returns an error if the attachment is invalid. +func (a *Attachment) validate() error { + if a.Filename == "" { + return missingArg("filename") + } + return nil +} + +// MarshalJSON satisfies the json.Marshaler interface. +func (a *Attachment) MarshalJSON() ([]byte, error) { + type jsonAttachment struct { + ContentType string `json:"content_type"` + Stub *bool `json:"stub,omitempty"` + Follows *bool `json:"follows,omitempty"` + Size int64 `json:"length,omitempty"` + RevPos int64 `json:"revpos,omitempty"` + Data []byte `json:"data,omitempty"` + Digest string `json:"digest,omitempty"` + } + att := &jsonAttachment{ + ContentType: a.ContentType, + Size: a.Size, + RevPos: a.RevPos, + Digest: a.Digest, + } + switch { + case a.Stub: + att.Stub = &a.Stub + case a.Follows: + att.Follows = &a.Follows + default: + defer a.Content.Close() // nolint: errcheck + data, err := ioutil.ReadAll(a.Content) + if err != nil { + return nil, err + } + att.Data = data + } + return json.Marshal(att) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for an Attachment. +func (a *Attachment) UnmarshalJSON(data []byte) error { + type clone Attachment + type jsonAtt struct { + clone + Data []byte `json:"data"` + } + var att jsonAtt + if err := json.Unmarshal(data, &att); err != nil { + return err + } + *a = Attachment(att.clone) + if att.Data != nil { + a.Content = ioutil.NopCloser(bytes.NewReader(att.Data)) + } else { + a.Content = nilContent + } + return nil +} + +// UnmarshalJSON implements the json.Unmarshaler interface for a collection of +// Attachments. +func (a *Attachments) UnmarshalJSON(data []byte) error { + atts := make(map[string]*Attachment) + if err := json.Unmarshal(data, &atts); err != nil { + return err + } + for filename, att := range atts { + att.Filename = filename + } + *a = atts + return nil +} + +// AttachmentsIterator is an experimental way to read streamed attachments from +// a multi-part Get request. +type AttachmentsIterator struct { + atti driver.Attachments +} + +// Next returns the next attachment in the stream. io.EOF will be +// returned when there are no more attachments. +func (i *AttachmentsIterator) Next() (*Attachment, error) { + att := new(driver.Attachment) + if err := i.atti.Next(att); err != nil { + return nil, err + } + katt := Attachment(*att) + return &katt, nil +} diff --git a/vendor/github.com/go-kivik/kivik/v3/bulk.go b/vendor/github.com/go-kivik/kivik/v3/bulk.go new file mode 100644 index 00000000000..b5eebc5afac --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/bulk.go @@ -0,0 +1,155 @@ +package kivik + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +// BulkResults is an iterator over the results of a BulkDocs query. +type BulkResults struct { + *iter + bulki driver.BulkResults +} + +// Next returns the next BulkResult from the feed. If an error occurs, it will +// be returned and the feed closed. io.EOF will be returned when there are no +// more results. +func (r *BulkResults) Next() bool { + return r.iter.Next() +} + +// Err returns the error, if any, that was encountered during iteration. Err +// may be called after an explicit or implicit Close. +func (r *BulkResults) Err() error { + return r.iter.Err() +} + +// Close closes the feed. Any unread updates will still be accessible via +// Next(). +func (r *BulkResults) Close() error { + return r.iter.Close() +} + +type bulkIterator struct{ driver.BulkResults } + +var _ iterator = &bulkIterator{} + +func (r *bulkIterator) Next(i interface{}) error { + return r.BulkResults.Next(i.(*driver.BulkResult)) +} + +func newBulkResults(ctx context.Context, bulki driver.BulkResults) *BulkResults { + return &BulkResults{ + iter: newIterator(ctx, &bulkIterator{bulki}, &driver.BulkResult{}), + bulki: bulki, + } +} + +// ID returns the document ID name for the current result. +func (r *BulkResults) ID() string { + runlock, err := r.rlock() + if err != nil { + return "" + } + defer runlock() + return r.curVal.(*driver.BulkResult).ID +} + +// Rev returns the revision of the current curResult. +func (r *BulkResults) Rev() string { + runlock, err := r.rlock() + if err != nil { + return "" + } + defer runlock() + return r.curVal.(*driver.BulkResult).Rev +} + +// UpdateErr returns the error associated with the current result, or nil +// if none. Do not confuse this with Err, which returns an error for the +// iterator itself. +func (r *BulkResults) UpdateErr() error { + runlock, err := r.rlock() + if err != nil { + return nil + } + defer runlock() + return r.curVal.(*driver.BulkResult).Error +} + +// BulkDocs allows you to create and update multiple documents at the same time +// within a single request. This function returns an iterator over the results +// of the bulk operation. +// See http://docs.couchdb.org/en/2.0.0/api/database/bulk-api.html#db-bulk-docs +// +// As with Put, each individual document may be a JSON-marshable object, or a +// raw JSON string in a []byte, json.RawMessage, or io.Reader. +func (db *DB) BulkDocs(ctx context.Context, docs []interface{}, options ...Options) (*BulkResults, error) { + docsi, err := docsInterfaceSlice(docs) + if err != nil { + return nil, err + } + if len(docsi) == 0 { + return nil, &Error{HTTPStatus: http.StatusBadRequest, Err: errors.New("kivik: no documents provided")} + } + opts := mergeOptions(options...) + if bulkDocer, ok := db.driverDB.(driver.BulkDocer); ok { + bulki, err := bulkDocer.BulkDocs(ctx, docsi, opts) + if err != nil { + return nil, err + } + return newBulkResults(ctx, bulki), nil + } + var results []driver.BulkResult + for _, doc := range docsi { + var err error + var id, rev string + if docID, ok := extractDocID(doc); ok { + id = docID + rev, err = db.Put(ctx, id, doc, opts) + } else { + id, rev, err = db.CreateDoc(ctx, doc, opts) + } + results = append(results, driver.BulkResult{ + ID: id, + Rev: rev, + Error: err, + }) + } + return newBulkResults(ctx, &emulatedBulkResults{results}), nil +} + +type emulatedBulkResults struct { + results []driver.BulkResult +} + +var _ driver.BulkResults = &emulatedBulkResults{} + +func (r *emulatedBulkResults) Close() error { + r.results = nil + return nil +} + +func (r *emulatedBulkResults) Next(res *driver.BulkResult) error { + if len(r.results) == 0 { + return io.EOF + } + *res = r.results[0] + r.results = r.results[1:] + return nil +} + +func docsInterfaceSlice(docsi []interface{}) ([]interface{}, error) { + for i, doc := range docsi { + x, err := normalizeFromJSON(doc) + if err != nil { + return nil, &Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + docsi[i] = x + } + return docsi, nil +} diff --git a/vendor/github.com/go-kivik/kivik/v3/changes.go b/vendor/github.com/go-kivik/kivik/v3/changes.go new file mode 100644 index 00000000000..78403b2ca83 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/changes.go @@ -0,0 +1,124 @@ +package kivik + +import ( + "context" + + "github.com/go-kivik/kivik/v3/driver" +) + +// Changes is an iterator over the database changes feed. +type Changes struct { + *iter + changesi driver.Changes +} + +// Next prepares the next result value for reading. It returns true on success +// or false if there are no more results, due to an error or the changes feed +// having been closed. Err should be consulted to determine any error. +func (c *Changes) Next() bool { + return c.iter.Next() +} + +// Err returns the error, if any, that was encountered during iteration. Err may +// be called after an explicit or implicit Close. +func (c *Changes) Err() error { + return c.iter.Err() +} + +// Close closes the Changes feed, preventing further enumeration, and freeing +// any resources (such as the http request body) of the underlying query. If +// Next is called and there are no further results, Changes is closed +// automatically and it will suffice to check the result of Err. Close is +// idempotent and does not affect the result of Err. +func (c *Changes) Close() error { + return c.iter.Close() +} + +type changesIterator struct{ driver.Changes } + +var _ iterator = &changesIterator{} + +func (c *changesIterator) Next(i interface{}) error { return c.Changes.Next(i.(*driver.Change)) } + +func newChanges(ctx context.Context, changesi driver.Changes) *Changes { + return &Changes{ + iter: newIterator(ctx, &changesIterator{changesi}, &driver.Change{}), + changesi: changesi, + } +} + +// Changes returns a list of changed revs. +func (c *Changes) Changes() []string { + return c.curVal.(*driver.Change).Changes +} + +// Deleted returns true if the change relates to a deleted document. +func (c *Changes) Deleted() bool { + return c.curVal.(*driver.Change).Deleted +} + +// ID returns the ID of the current result. +func (c *Changes) ID() string { + return c.curVal.(*driver.Change).ID +} + +// ScanDoc works the same as ScanValue, but on the doc field of the result. It +// is only valid for results that include documents. +func (c *Changes) ScanDoc(dest interface{}) error { + runlock, err := c.rlock() + if err != nil { + return err + } + defer runlock() + return scan(dest, c.curVal.(*driver.Change).Doc) +} + +// Changes returns an iterator over the real-time changes feed. The feed remains +// open until explicitly closed, or an error is encountered. +// See http://couchdb.readthedocs.io/en/latest/api/database/changes.html#get--db-_changes +func (db *DB) Changes(ctx context.Context, options ...Options) (*Changes, error) { + changesi, err := db.driverDB.Changes(ctx, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newChanges(ctx, changesi), nil +} + +// Seq returns the Seq of the current result. +func (c *Changes) Seq() string { + return c.curVal.(*driver.Change).Seq +} + +// LastSeq returns the last update sequence id present in the change set, +// if returned by the server. This value is only guaranteed to be set after +// all changes have been enumerated through by Next, thus should only be +// read after processing all changes in a change set. Calling Close before +// enumerating will render this value unreliable. +func (c *Changes) LastSeq() string { + if c.changesi == nil { + return "" + } + return c.changesi.LastSeq() +} + +// Pending returns the count of remaining items in the change feed. This +// value is only guaranteed to be set after all changes have been +// enumerated through by Next, thus should only be read after processing all +// changes in a change set. Calling Close before enumerating will render +// this value unreliable. +func (c *Changes) Pending() int64 { + if c.changesi == nil { + return 0 + } + return c.changesi.Pending() +} + +// ETag returns the unquoted ETag header, if any. Unlike LastSeq and Pending, +// because this value is returned in the response header (for standard CouchDB +// operation) anyway, it can be read immediately, before iteration even begins. +func (c *Changes) ETag() string { + if c.changesi == nil { + return "" + } + return c.changesi.ETag() +} diff --git a/vendor/github.com/go-kivik/kivik/v3/cluster.go b/vendor/github.com/go-kivik/kivik/v3/cluster.go new file mode 100644 index 00000000000..be1ee08a2fd --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/cluster.go @@ -0,0 +1,53 @@ +package kivik + +import ( + "context" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +var clusterNotImplemented = &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support cluster operations"} + +// ClusterStatus returns the current cluster status. +// +// See http://docs.couchdb.org/en/stable/api/server/common.html#cluster-setup +func (c *Client) ClusterStatus(ctx context.Context, options ...Options) (string, error) { + cluster, ok := c.driverClient.(driver.Cluster) + if !ok { + return "", clusterNotImplemented + } + return cluster.ClusterStatus(ctx, mergeOptions(options...)) +} + +// ClusterSetup performs the requested cluster action. action should be +// an object understood by the driver. For the CouchDB driver, this means an +// object which is marshalable to a JSON object of the expected format. +// +// See http://docs.couchdb.org/en/stable/api/server/common.html#post--_cluster_setup +func (c *Client) ClusterSetup(ctx context.Context, action interface{}) error { + cluster, ok := c.driverClient.(driver.Cluster) + if !ok { + return clusterNotImplemented + } + return cluster.ClusterSetup(ctx, action) +} + +// ClusterMembership contains the list of known nodes, and cluster nodes, as returned +// by the /_membership endpoint. +// See https://docs.couchdb.org/en/latest/api/server/common.html#get--_membership +type ClusterMembership struct { + AllNodes []string `json:"all_nodes"` + ClusterNodes []string `json:"cluster_nodes"` +} + +// Membership returns a list of known CouchDB nodes. +// See https://docs.couchdb.org/en/latest/api/server/common.html#get--_membership +func (c *Client) Membership(ctx context.Context) (*ClusterMembership, error) { + cluster, ok := c.driverClient.(driver.Cluster2) + if !ok { + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support the /_membership endpoint"} + } + nodes, err := cluster.Membership(ctx) + return (*ClusterMembership)(nodes), err +} diff --git a/vendor/github.com/go-kivik/kivik/v3/codecov.yml b/vendor/github.com/go-kivik/kivik/v3/codecov.yml new file mode 100644 index 00000000000..aea8ff245e9 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/codecov.yml @@ -0,0 +1,3 @@ +ignore: +- "test" +- "mock" diff --git a/vendor/github.com/go-kivik/kivik/v3/config.go b/vendor/github.com/go-kivik/kivik/v3/config.go new file mode 100644 index 00000000000..8c91fd74387 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/config.go @@ -0,0 +1,81 @@ +package kivik + +import ( + "context" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +// Config represents all the config sections. +// +// Note that the Config struct, and all of the config-related methods are +// considered experimental, and may change in the future. +type Config map[string]ConfigSection + +// ConfigSection represents all key/value pairs for a section of configuration. +type ConfigSection map[string]string + +var configNotImplemented = &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support Config interface"} + +// Config returns the entire server config, for the specified node. +// +// See http://docs.couchdb.org/en/stable/api/server/configuration.html#get--_node-node-name-_config +func (c *Client) Config(ctx context.Context, node string) (Config, error) { + if configer, ok := c.driverClient.(driver.Configer); ok { + driverCf, err := configer.Config(ctx, node) + if err != nil { + return nil, err + } + cf := Config{} + for k, v := range driverCf { + cf[k] = ConfigSection(v) + } + return cf, nil + } + return nil, configNotImplemented +} + +// ConfigSection returns the requested section of the server config for the +// specified node. +// +// See http://docs.couchdb.org/en/stable/api/server/configuration.html#node-node-name-config-section +func (c *Client) ConfigSection(ctx context.Context, node, section string) (ConfigSection, error) { + if configer, ok := c.driverClient.(driver.Configer); ok { + sec, err := configer.ConfigSection(ctx, node, section) + return ConfigSection(sec), err + } + return nil, configNotImplemented +} + +// ConfigValue returns a single config value for the specified node. +// +// See http://docs.couchdb.org/en/stable/api/server/configuration.html#get--_node-node-name-_config-section-key +func (c *Client) ConfigValue(ctx context.Context, node, section, key string) (string, error) { + if configer, ok := c.driverClient.(driver.Configer); ok { + return configer.ConfigValue(ctx, node, section, key) + } + return "", configNotImplemented +} + +// SetConfigValue sets the server's config value on the specified node, creating +// the key if it doesn't exist. It returns the old value. +// +// See http://docs.couchdb.org/en/stable/api/server/configuration.html#put--_node-node-name-_config-section-key +func (c *Client) SetConfigValue(ctx context.Context, node, section, key, value string) (string, error) { + if configer, ok := c.driverClient.(driver.Configer); ok { + return configer.SetConfigValue(ctx, node, section, key, value) + } + return "", configNotImplemented +} + +// DeleteConfigKey deletes the configuration key and associated value from the +// specified node. It returns the old value. +// +// See http://docs.couchdb.org/en/stable/api/server/configuration.html#delete--_node-node-name-_config-section-key +func (c *Client) DeleteConfigKey(ctx context.Context, node, section, key string) (string, error) { + if configer, ok := c.driverClient.(driver.Configer); ok { + return configer.DeleteConfigKey(ctx, node, section, key) + } + return "", configNotImplemented +} diff --git a/vendor/github.com/go-kivik/kivik/v3/constants.go b/vendor/github.com/go-kivik/kivik/v3/constants.go new file mode 100644 index 00000000000..b8561006510 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/constants.go @@ -0,0 +1,27 @@ +package kivik + +const ( + // KivikVersion is the version of the Kivik library. + KivikVersion = "3.1.0" + // KivikVendor is the vendor string reported by this library. + KivikVendor = "Kivik" +) + +// SessionCookieName is the name of the CouchDB session cookie. +const SessionCookieName = "AuthSession" + +// UserPrefix is the mandatory CouchDB user prefix. +// See http://docs.couchdb.org/en/2.0.0/intro/security.html#org-couchdb-user +const UserPrefix = "org.couchdb.user:" + +// EndKeySuffix is a high Unicode character (0xfff0) useful for appending to an +// endkey argument, when doing a ranged search, as described here: +// http://couchdb.readthedocs.io/en/latest/ddocs/views/collation.html#string-ranges +// +// Example, to return all results with keys beginning with "foo": +// +// rows, err := db.Query(context.TODO(), "ddoc", "view", map[string]interface{}{ +// "startkey": "foo", +// "endkey": "foo" + kivik.EndKeySuffix, +// }) +const EndKeySuffix = string(rune(0xfff0)) diff --git a/vendor/github.com/go-kivik/kivik/v3/db.go b/vendor/github.com/go-kivik/kivik/v3/db.go new file mode 100644 index 00000000000..5deeb2a3089 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/db.go @@ -0,0 +1,733 @@ +package kivik + +import ( + "context" + "encoding/json" + "errors" + "io" + "io/ioutil" + "net/http" + "reflect" + "strings" + + "github.com/go-kivik/kivik/v3/driver" +) + +// DB is a handle to a specific database. +type DB struct { + client *Client + name string + driverDB driver.DB + err error +} + +// Client returns the Client used to connect to the database. +func (db *DB) Client() *Client { + return db.client +} + +// Name returns the database name as passed when creating the DB connection. +func (db *DB) Name() string { + return db.name +} + +// Err returns the error, if any, that occurred while connecting to or creating +// the database. This error will be deferred until the next call, normally, so +// using this method is only ever necessary if you need to directly check the +// error status, and intend to do nothing else with the DB object. +func (db *DB) Err() error { + return db.err +} + +// AllDocs returns a list of all documents in the database. +func (db *DB) AllDocs(ctx context.Context, options ...Options) (*Rows, error) { + if db.err != nil { + return nil, db.err + } + rowsi, err := db.driverDB.AllDocs(ctx, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil +} + +// DesignDocs returns a list of all documents in the database. +func (db *DB) DesignDocs(ctx context.Context, options ...Options) (*Rows, error) { + if db.err != nil { + return nil, db.err + } + ddocer, ok := db.driverDB.(driver.DesignDocer) + if !ok { + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Err: errors.New("kivik: design doc view not supported by driver")} + } + rowsi, err := ddocer.DesignDocs(ctx, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil +} + +// LocalDocs returns a list of all documents in the database. +func (db *DB) LocalDocs(ctx context.Context, options ...Options) (*Rows, error) { + if db.err != nil { + return nil, db.err + } + ldocer, ok := db.driverDB.(driver.LocalDocer) + if !ok { + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Err: errors.New("kivik: local doc view not supported by driver")} + } + rowsi, err := ldocer.LocalDocs(ctx, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil +} + +// Query executes the specified view function from the specified design +// document. ddoc and view may or may not be be prefixed with '_design/' +// and '_view/' respectively. No other +func (db *DB) Query(ctx context.Context, ddoc, view string, options ...Options) (*Rows, error) { + if db.err != nil { + return nil, db.err + } + ddoc = strings.TrimPrefix(ddoc, "_design/") + view = strings.TrimPrefix(view, "_view/") + rowsi, err := db.driverDB.Query(ctx, ddoc, view, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil +} + +// Row contains the result of calling Get for a single document. For most uses, +// it is sufficient just to call the ScanDoc method. For more advanced uses, the +// fields may be accessed directly. +type Row struct { + // ContentLength records the size of the JSON representation of the document + // as requestd. The value -1 indicates that the length is unknown. Values + // >= 0 indicate that the given number of bytes may be read from Body. + ContentLength int64 + + // Rev is the revision ID of the returned document. + Rev string + + // Body represents the document's content. + // + // Kivik will always return a non-nil Body, except when Err is non-nil. The + // ScanDoc method will close Body. When not using ScanDoc, it is the + // caller's responsibility to close Body + Body io.ReadCloser + + // Err contains any error that occurred while fetching the document. It is + // typically returned by ScanDoc. + Err error + + // Attachments is experimental + Attachments *AttachmentsIterator +} + +// ScanDoc unmarshals the data from the fetched row into dest. It is an +// intelligent wrapper around json.Unmarshal which also handles +// multipart/related responses. When done, the underlying reader is closed. +func (r *Row) ScanDoc(dest interface{}) error { + if r.Err != nil { + return r.Err + } + if reflect.TypeOf(dest).Kind() != reflect.Ptr { + return errNonPtr + } + defer r.Body.Close() // nolint: errcheck + if err := json.NewDecoder(r.Body).Decode(dest); err != nil { + return err + } + return nil +} + +// Get fetches the requested document. Any errors are deferred until the +// row.ScanDoc call. +func (db *DB) Get(ctx context.Context, docID string, options ...Options) *Row { + if db.err != nil { + return &Row{Err: db.err} + } + doc, err := db.driverDB.Get(ctx, docID, mergeOptions(options...)) + if err != nil { + return &Row{Err: err} + } + row := &Row{ + ContentLength: doc.ContentLength, + Rev: doc.Rev, + Body: doc.Body, + } + if doc.Attachments != nil { + row.Attachments = &AttachmentsIterator{atti: doc.Attachments} + } + return row +} + +// GetMeta returns the size and rev of the specified document. GetMeta accepts +// the same options as the Get method. +func (db *DB) GetMeta(ctx context.Context, docID string, options ...Options) (size int64, rev string, err error) { + if db.err != nil { + return 0, "", db.err + } + opts := mergeOptions(options...) + if r, ok := db.driverDB.(driver.MetaGetter); ok { + return r.GetMeta(ctx, docID, opts) + } + row := db.Get(ctx, docID, opts) + if row.Err != nil { + return 0, "", row.Err + } + if row.Rev != "" { + _ = row.Body.Close() + return row.ContentLength, row.Rev, nil + } + var doc struct { + Rev string `json:"_rev"` + } + // These last two lines cannot be combined for GopherJS due to a bug. + // See https://github.com/gopherjs/gopherjs/issues/608 + err = row.ScanDoc(&doc) + return row.ContentLength, doc.Rev, err +} + +// CreateDoc creates a new doc with an auto-generated unique ID. The generated +// docID and new rev are returned. +func (db *DB) CreateDoc(ctx context.Context, doc interface{}, options ...Options) (docID, rev string, err error) { + if db.err != nil { + return "", "", db.err + } + return db.driverDB.CreateDoc(ctx, doc, mergeOptions(options...)) +} + +// normalizeFromJSON unmarshals a []byte, json.RawMessage or io.Reader to a +// map[string]interface{}, or passed through any other types. +func normalizeFromJSON(i interface{}) (interface{}, error) { + var body []byte + switch t := i.(type) { + case []byte: + body = t + case json.RawMessage: + body = t + default: + r, ok := i.(io.Reader) + if !ok { + return i, nil + } + var err error + body, err = ioutil.ReadAll(r) + if err != nil { + return nil, &Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + } + var x map[string]interface{} + if err := json.Unmarshal(body, &x); err != nil { + return nil, &Error{HTTPStatus: http.StatusBadRequest, Err: err} + } + return x, nil +} + +func extractDocID(i interface{}) (string, bool) { + if i == nil { + return "", false + } + var id string + var ok bool + switch t := i.(type) { + case map[string]interface{}: + id, ok = t["_id"].(string) + case map[string]string: + id, ok = t["_id"] + default: + data, err := json.Marshal(i) + if err != nil { + return "", false + } + var result struct { + ID string `json:"_id"` + } + if err := json.Unmarshal(data, &result); err != nil { + return "", false + } + id = result.ID + ok = result.ID != "" + } + if !ok { + return "", false + } + return id, true +} + +// Put creates a new doc or updates an existing one, with the specified docID. +// If the document already exists, the current revision must be included in doc, +// with JSON key '_rev', otherwise a conflict will occur. The new rev is +// returned. +// +// doc may be one of: +// +// - An object to be marshaled to JSON. The resulting JSON structure must +// conform to CouchDB standards. +// - A []byte value, containing a valid JSON document +// - A json.RawMessage value containing a valid JSON document +// - An io.Reader, from which a valid JSON document may be read. +func (db *DB) Put(ctx context.Context, docID string, doc interface{}, options ...Options) (rev string, err error) { + if db.err != nil { + return "", db.err + } + if docID == "" { + return "", missingArg("docID") + } + i, err := normalizeFromJSON(doc) + if err != nil { + return "", err + } + return db.driverDB.Put(ctx, docID, i, mergeOptions(options...)) +} + +// Delete marks the specified document as deleted. The revision may be provided +// via options, which takes priority over the rev argument. +func (db *DB) Delete(ctx context.Context, docID, rev string, options ...Options) (newRev string, err error) { + if db.err != nil { + return "", db.err + } + if docID == "" { + return "", missingArg("docID") + } + opts := mergeOptions(options...) + if rv, ok := opts["rev"].(string); ok && rv != "" { + rev = rv + } + return db.driverDB.Delete(ctx, docID, rev, opts) +} + +// Flush requests a flush of disk cache to disk or other permanent storage. +// +// See http://docs.couchdb.org/en/2.0.0/api/database/compact.html#db-ensure-full-commit +func (db *DB) Flush(ctx context.Context) error { + if db.err != nil { + return db.err + } + if flusher, ok := db.driverDB.(driver.Flusher); ok { + return flusher.Flush(ctx) + } + return &Error{HTTPStatus: http.StatusNotImplemented, Err: errors.New("kivik: flush not supported by driver")} +} + +// DBStats contains database statistics.. +type DBStats struct { + // Name is the name of the database. + Name string `json:"db_name"` + // CompactRunning is true if the database is currently being compacted. + CompactRunning bool `json:"compact_running"` + // DocCount is the number of documents are currently stored in the database. + DocCount int64 `json:"doc_count"` + // DeletedCount is a count of documents which have been deleted from the + // database. + DeletedCount int64 `json:"doc_del_count"` + // UpdateSeq is the current update sequence for the database. + UpdateSeq string `json:"update_seq"` + // DiskSize is the number of bytes used on-disk to store the database. + DiskSize int64 `json:"disk_size"` + // ActiveSize is the number of bytes used on-disk to store active documents. + // If this number is lower than DiskSize, then compaction would free disk + // space. + ActiveSize int64 `json:"data_size"` + // ExternalSize is the size of the documents in the database, as represented + // as JSON, before compression. + ExternalSize int64 `json:"-"` + // Cluster reports the cluster replication configuration variables. + Cluster *ClusterConfig `json:"cluster,omitempty"` + // RawResponse is the raw response body returned by the server, useful if + // you need additional backend-specific information. + // + // For the format of this document, see + // http://docs.couchdb.org/en/2.1.1/api/database/common.html#get--db + RawResponse json.RawMessage `json:"-"` +} + +// ClusterConfig contains the cluster configuration for the database. +type ClusterConfig struct { + Replicas int `json:"n"` + Shards int `json:"q"` + ReadQuorum int `json:"r"` + WriteQuorum int `json:"w"` +} + +// Stats returns database statistics. +// +// See https://docs.couchdb.org/en/stable/api/database/common.html#get--db +func (db *DB) Stats(ctx context.Context) (*DBStats, error) { + if db.err != nil { + return nil, db.err + } + i, err := db.driverDB.Stats(ctx) + if err != nil { + return nil, err + } + return driverStats2kivikStats(i), nil +} + +func driverStats2kivikStats(i *driver.DBStats) *DBStats { + var cluster *ClusterConfig + if i.Cluster != nil { + c := ClusterConfig(*i.Cluster) + cluster = &c + } + return &DBStats{ + Name: i.Name, + CompactRunning: i.CompactRunning, + DocCount: i.DocCount, + DeletedCount: i.DeletedCount, + UpdateSeq: i.UpdateSeq, + DiskSize: i.DiskSize, + ActiveSize: i.ActiveSize, + ExternalSize: i.ExternalSize, + Cluster: cluster, + RawResponse: i.RawResponse, + } +} + +// Compact begins compaction of the database. Check the CompactRunning field +// returned by Info() to see if the compaction has completed. +// See http://docs.couchdb.org/en/2.0.0/api/database/compact.html#db-compact +// +// This method may return immediately, or may wait for the compaction to +// complete before returning, depending on the backend implementation. In +// particular, CouchDB triggers the compaction and returns immediately, whereas +// PouchDB waits until compaction has completed, before returning. +func (db *DB) Compact(ctx context.Context) error { + if db.err != nil { + return db.err + } + return db.driverDB.Compact(ctx) +} + +// CompactView compats the view indexes associated with the specified design +// document. +// See http://docs.couchdb.org/en/2.0.0/api/database/compact.html#db-compact-design-doc +// +// This method may return immediately, or may wait for the compaction to +// complete before returning, depending on the backend implementation. In +// particular, CouchDB triggers the compaction and returns immediately, whereas +// PouchDB waits until compaction has completed, before returning. +func (db *DB) CompactView(ctx context.Context, ddocID string) error { + return db.driverDB.CompactView(ctx, ddocID) +} + +// ViewCleanup removes view index files that are no longer required as a result +// of changed views within design documents. +// See http://docs.couchdb.org/en/2.0.0/api/database/compact.html#db-view-cleanup +func (db *DB) ViewCleanup(ctx context.Context) error { + if db.err != nil { + return db.err + } + return db.driverDB.ViewCleanup(ctx) +} + +// Security returns the database's security document. +// See http://couchdb.readthedocs.io/en/latest/api/database/security.html#get--db-_security +func (db *DB) Security(ctx context.Context) (*Security, error) { + if db.err != nil { + return nil, db.err + } + s, err := db.driverDB.Security(ctx) + if err != nil { + return nil, err + } + return &Security{ + Admins: Members(s.Admins), + Members: Members(s.Members), + }, err +} + +// SetSecurity sets the database's security document. +// See http://couchdb.readthedocs.io/en/latest/api/database/security.html#put--db-_security +func (db *DB) SetSecurity(ctx context.Context, security *Security) error { + if db.err != nil { + return db.err + } + if security == nil { + return missingArg("security") + } + sec := &driver.Security{ + Admins: driver.Members(security.Admins), + Members: driver.Members(security.Members), + } + return db.driverDB.SetSecurity(ctx, sec) +} + +// Copy copies the source document to a new document with an ID of targetID. If +// the database backend does not support COPY directly, the operation will be +// emulated with a Get followed by Put. The target will be an exact copy of the +// source, with only the ID and revision changed. +// +// See http://docs.couchdb.org/en/2.0.0/api/document/common.html#copy--db-docid +func (db *DB) Copy(ctx context.Context, targetID, sourceID string, options ...Options) (targetRev string, err error) { + if db.err != nil { + return "", db.err + } + if targetID == "" { + return "", missingArg("targetID") + } + if sourceID == "" { + return "", missingArg("sourceID") + } + opts := mergeOptions(options...) + if copier, ok := db.driverDB.(driver.Copier); ok { + return copier.Copy(ctx, targetID, sourceID, opts) + } + var doc map[string]interface{} + if err = db.Get(ctx, sourceID, opts).ScanDoc(&doc); err != nil { + return "", err + } + delete(doc, "_rev") + doc["_id"] = targetID + delete(opts, "rev") // rev has a completely different meaning for Copy and Put + return db.Put(ctx, targetID, doc, opts) +} + +// PutAttachment uploads the supplied content as an attachment to the specified +// document. +func (db *DB) PutAttachment(ctx context.Context, docID, rev string, att *Attachment, options ...Options) (newRev string, err error) { + if db.err != nil { + return "", db.err + } + if docID == "" { + return "", missingArg("docID") + } + if e := att.validate(); e != nil { + return "", e + } + a := driver.Attachment(*att) + opts := mergeOptions(options...) + if rv, ok := opts["rev"].(string); ok && rv != "" { + rev = rv + } + return db.driverDB.PutAttachment(ctx, docID, rev, &a, mergeOptions(options...)) +} + +// GetAttachment returns a file attachment associated with the document. +func (db *DB) GetAttachment(ctx context.Context, docID, filename string, options ...Options) (*Attachment, error) { + if db.err != nil { + return nil, db.err + } + if docID == "" { + return nil, missingArg("docID") + } + if filename == "" { + return nil, missingArg("filename") + } + att, err := db.driverDB.GetAttachment(ctx, docID, filename, mergeOptions(options...)) + if err != nil { + return nil, err + } + a := Attachment(*att) + return &a, nil +} + +type nilContentReader struct{} + +var _ io.ReadCloser = &nilContentReader{} + +func (c nilContentReader) Read(_ []byte) (int, error) { return 0, io.EOF } +func (c nilContentReader) Close() error { return nil } + +var nilContent = nilContentReader{} + +// GetAttachmentMeta returns meta data about an attachment. The attachment +// content returned will be empty. +func (db *DB) GetAttachmentMeta(ctx context.Context, docID, filename string, options ...Options) (*Attachment, error) { + if db.err != nil { + return nil, db.err + } + if docID == "" { + return nil, missingArg("docID") + } + if filename == "" { + return nil, missingArg("filename") + } + var att *Attachment + if metaer, ok := db.driverDB.(driver.AttachmentMetaGetter); ok { + a, err := metaer.GetAttachmentMeta(ctx, docID, filename, mergeOptions(options...)) + if err != nil { + return nil, err + } + att = new(Attachment) + *att = Attachment(*a) + } else { + var err error + att, err = db.GetAttachment(ctx, docID, filename, options...) + if err != nil { + return nil, err + } + } + if att.Content != nil { + _ = att.Content.Close() // Ensure this is closed + } + att.Content = nilContent + return att, nil +} + +// DeleteAttachment deletes an attachment from a document, returning the +// document's new revision. The revision may be provided via options, which +// takes priority over the rev argument. +func (db *DB) DeleteAttachment(ctx context.Context, docID, rev, filename string, options ...Options) (newRev string, err error) { + if db.err != nil { + return "", db.err + } + if docID == "" { + return "", missingArg("docID") + } + if filename == "" { + return "", missingArg("filename") + } + opts := mergeOptions(options...) + if rv, ok := opts["rev"].(string); ok && rv != "" { + rev = rv + } + return db.driverDB.DeleteAttachment(ctx, docID, rev, filename, opts) +} + +// PurgeResult is the result of a purge request. +type PurgeResult struct { + // Seq is the purge sequence number. + Seq int64 `json:"purge_seq"` + // Purged is a map of document ids to revisions, indicated the + // document/revision pairs that were successfully purged. + Purged map[string][]string `json:"purged"` +} + +// Purge permanently removes the reference to deleted documents from the +// database. Normal deletion only marks the document with the key/value pair +// `_deleted=true`, to ensure proper replication of deleted documents. By +// using Purge, the document can be completely removed. But note that this +// operation is not replication safe, so great care must be taken when using +// Purge, and this should only be used as a last resort. +// +// Purge expects as input a map with document ID as key, and slice of +// revisions as value. +func (db *DB) Purge(ctx context.Context, docRevMap map[string][]string) (*PurgeResult, error) { + if db.err != nil { + return nil, db.err + } + if purger, ok := db.driverDB.(driver.Purger); ok { + res, err := purger.Purge(ctx, docRevMap) + if err != nil { + return nil, err + } + r := PurgeResult(*res) + return &r, nil + } + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: purge not supported by driver"} +} + +// BulkGetReference is a reference to a document given in a BulkGet query. +type BulkGetReference struct { + ID string `json:"id"` + Rev string `json:"rev,omitempty"` + AttsSince string `json:"atts_since,omitempty"` +} + +// BulkGet can be called to query several documents in bulk. It is well suited +// for fetching a specific revision of documents, as replicators do for example, +// or for getting revision history. +// +// See http://docs.couchdb.org/en/stable/api/database/bulk-api.html#db-bulk-get +func (db *DB) BulkGet(ctx context.Context, docs []BulkGetReference, options ...Options) (*Rows, error) { + if db.err != nil { + return nil, db.err + } + bulkGetter, ok := db.driverDB.(driver.BulkGetter) + if !ok { + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: bulk get not supported by driver"} + } + refs := make([]driver.BulkGetReference, len(docs)) + for i, ref := range docs { + refs[i] = driver.BulkGetReference(ref) + } + rowsi, err := bulkGetter.BulkGet(ctx, refs, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil +} + +// Close cleans up any resources used by the DB. The default CouchDB driver +// does not use this, the default PouchDB driver does. +func (db *DB) Close(ctx context.Context) error { + if db.err != nil { + return db.err + } + if closer, ok := db.driverDB.(driver.DBCloser); ok { + return closer.Close(ctx) + } + return nil +} + +// RevDiff represents a rev diff for a single document, as returned by the +// RevsDiff method. +type RevDiff struct { + Missing []string `json:"missing,omitempty"` + PossibleAncestors []string `json:"possible_ancestors,omitempty"` +} + +// Diffs is a collection of RevDiffs as returned by RevsDiff. The map key is +// the document ID. +type Diffs map[string]RevDiff + +// RevsDiff the subset of document/revision IDs that do not correspond to +// revisions stored in the database. This is used by the replication protocol, +// and is normally never needed otherwise. revMap must marshal to the expected +// format. +// +// Use ID() to return the current document ID, and ScanValue to access the full +// JSON value, which should be of the JSON format: +// +// { +// "missing": ["rev1",...], +// "possible_ancestors": ["revA",...] +// } +// +// See http://docs.couchdb.org/en/stable/api/database/misc.html#db-revs-diff +func (db *DB) RevsDiff(ctx context.Context, revMap interface{}) (*Rows, error) { + if db.err != nil { + return nil, db.err + } + if rd, ok := db.driverDB.(driver.RevsDiffer); ok { + rowsi, err := rd.RevsDiff(ctx, revMap) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil + } + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: _revs_diff not supported by driver"} +} + +// PartitionStats contains partition statistics. +type PartitionStats struct { + DBName string + DocCount int64 + DeletedDocCount int64 + Partition string + ActiveSize int64 + ExternalSize int64 + RawResponse json.RawMessage +} + +// PartitionStats returns statistics about the named partition. +// +// See https://docs.couchdb.org/en/stable/api/partitioned-dbs.html#db-partition-partition +func (db *DB) PartitionStats(ctx context.Context, name string) (*PartitionStats, error) { + if db.err != nil { + return nil, db.err + } + if pdb, ok := db.driverDB.(driver.PartitionedDB); ok { + stats, err := pdb.PartitionStats(ctx, name) + if err != nil { + return nil, err + } + s := PartitionStats(*stats) + return &s, nil + } + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: partitions not supported by driver"} +} diff --git a/vendor/github.com/go-kivik/kivik/v3/doc.go b/vendor/github.com/go-kivik/kivik/v3/doc.go new file mode 100644 index 00000000000..9b39c0ca86e --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/doc.go @@ -0,0 +1,80 @@ +/* +Package kivik provides a generic interface to CouchDB or CouchDB-like databases. + +The kivik package must be used in conjunction with a database driver. The +officially supported drivers are: + + - CouchDB: https://github.com/go-kivik/couchdb + - PouchDB: https://github.com/go-kivik/pouchdb (requires GopherJS) + - KivikMock: https://github.com/go-kivik/kivikmock + +The Filesystem and Memory drivers are also available, but in early stages of +development, and so many features do not yet work: + + - Filesystem: https://github.com/go-kivik/fsdb + - MemroyDB: https://github.com/go-kivik/memorydb + +The kivik driver system is modeled after the standard library's `sql` and +`sql/driver` packages, although the client API is completely different due to +the different database models implemented by SQL and NoSQL databases such as +CouchDB. + +Working with JSON + +couchDB stores JSON, so Kivik translates Go data structures to and from JSON as +necessary. The conversion between Go data types and JSON, and vice versa, is +handled automatically according to the rules and behavior described in the +documentationf or the standard library's `encoding/json` package +(https://golang.org/pkg/encoding/json). + +One would be well-advised to become familiar with using `json` struct field +tags (https://golang.org/pkg/encoding/json/#Marshal) when working with JSON +documents. + +Using contexts + +Most Kivik methods take `context.Context` as their first argument. This allows +the cancellation of blocking operations in the case that the result is no +longer needed. A typical use case for a web application would be to cancel a +Kivik request if the remote HTTP client ahs disconnected, rednering the results +of the query irrelevant. + +To learn more about Go's contexts, read the `context` package documentation +(https://golang.org/pkg/context/) and read the Go blog post "Go Concurrency +Patterns: Context" (https://blog.golang.org/context) for example code. + +If in doubt, you can pass `context.TODO()` as the context variable. Example: + + row := db.Get(context.TODO(), "some_doc_id") + +Error Handling + +Kivik returns errors that embed an HTTP status code. In most cases, this is the +HTTP status code returned by the server. The embedded HTTP status code may be +accessed easily using the StatusCode() method, or with a type assertion to +`interface { StatusCode() int }`. Example: + + if statusErr, ok := err.(interface{ StatusCode() int }); ok { + status = statusErr.StatusCode() + } + +Any error that does not conform to this interface will be assumed to represent +a http.StatusInternalServerError status code. + +Authentication + +For common usage, authentication should be as simple as including the authentication credentials in the connection DSN. For example: + + client, err := kivik.New("couch", "http://admin:abc123@localhost:5984/") + +This will connect to `localhost` on port 5984, using the username `admin` and +the password `abc123`. When connecting to CouchDB (as in the above example), +this will use cookie auth (https://docs.couchdb.org/en/stable/api/server/authn.html?highlight=cookie%20auth#cookie-authentication). + +Depending on which driver you use, there may be other ways to authenticate, as +well. At the moment, the CouchDB driver is the only official driver which offers +additional authentication methods. Please refer to the CouchDB package +documentation for details (https://pkg.go.dev/github.com/go-kivik/couchdb/v3). + +*/ +package kivik // import "github.com/go-kivik/kivik/v3" diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/bulkget.go b/vendor/github.com/go-kivik/kivik/v3/driver/bulkget.go new file mode 100644 index 00000000000..ebdc37b4c34 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/bulkget.go @@ -0,0 +1,17 @@ +package driver + +import "context" + +// BulkGetReference is a reference to a document given in a BulkGet query. +type BulkGetReference struct { + ID string `json:"id"` + Rev string `json:"rev,omitempty"` + AttsSince string `json:"atts_since,omitempty"` +} + +// BulkGetter is an optional interface which may be implemented by a driver to +// support bulk get operations. +type BulkGetter interface { + // BulkGet uses the _bulk_get interface to fetch multiple documents in a single query. + BulkGet(ctx context.Context, docs []BulkGetReference, options map[string]interface{}) (Rows, error) +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/changes.go b/vendor/github.com/go-kivik/kivik/v3/driver/changes.go new file mode 100644 index 00000000000..10d923059a9 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/changes.go @@ -0,0 +1,56 @@ +package driver + +import "encoding/json" + +// Changes is an iterator of the database changes feed. +type Changes interface { + // Next is called to populate *Change with the next value in the changes + // feed. + // + // Next should return io.EOF when the changes feed is closed by request. + Next(*Change) error + // Close closes the changes feed iterator. + Close() error + // LastSeq returns the last change update sequence. + LastSeq() string + // Pending returns the count of remaining items in the feed + Pending() int64 + // ETag returns the unquoted ETag header, if present. + ETag() string +} + +// Change represents the changes to a single document. +type Change struct { + // ID is the document ID to which the change relates. + ID string `json:"id"` + // Seq is the update sequence for the changes feed. + Seq string `json:"seq"` + // Deleted is set to true for the changes feed, if the document has been + // deleted. + Deleted bool `json:"deleted"` + // Changes represents a list of document leaf revisions for the /_changes + // endpoint. + Changes ChangedRevs `json:"changes"` + // Doc is the raw, un-decoded JSON document. This is only populated when + // include_docs=true is set. + Doc json.RawMessage `json:"doc"` +} + +// ChangedRevs represents a "changes" field of a result in the /_changes stream. +type ChangedRevs []string + +// UnmarshalJSON satisfies the json.Unmarshaler interface +func (c *ChangedRevs) UnmarshalJSON(data []byte) error { + var changes []struct { + Rev string `json:"rev"` + } + if err := json.Unmarshal(data, &changes); err != nil { + return err + } + revs := ChangedRevs(make([]string, len(changes))) + for i, change := range changes { + revs[i] = change.Rev + } + *c = revs + return nil +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/config.go b/vendor/github.com/go-kivik/kivik/v3/driver/config.go new file mode 100644 index 00000000000..0a33bf45371 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/config.go @@ -0,0 +1,19 @@ +package driver + +import "context" + +// Config represents all the config sections. +type Config map[string]ConfigSection + +// ConfigSection represents all key/value pairs for a section of configuration. +type ConfigSection map[string]string + +// Configer is an optional interface that may be implemented by a Client to +// allow access to reading and setting server configuration. +type Configer interface { + Config(ctx context.Context, node string) (Config, error) + ConfigSection(ctx context.Context, node, section string) (ConfigSection, error) + ConfigValue(ctx context.Context, node, section, key string) (string, error) + SetConfigValue(ctx context.Context, node, section, key, value string) (string, error) + DeleteConfigKey(ctx context.Context, node, section, key string) (string, error) +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/doc.go b/vendor/github.com/go-kivik/kivik/v3/driver/doc.go new file mode 100644 index 00000000000..19c45bca3c4 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/doc.go @@ -0,0 +1,5 @@ +// Package driver defines interfaces to be implemented by database drivers as +// used by package kivik. +// +// Most code should use package kivik. +package driver // import "github.com/go-kivik/kivik/v3/driver" diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/driver.go b/vendor/github.com/go-kivik/kivik/v3/driver/driver.go new file mode 100644 index 00000000000..41523b5a51f --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/driver.go @@ -0,0 +1,438 @@ +package driver + +import ( + "context" + "encoding/json" + "io" + "time" +) + +// Driver is the interface that must be implemented by a database driver. +type Driver interface { + // NewClient returns a connection handle to the database. The name is in a + // driver-specific format. + NewClient(name string) (Client, error) +} + +// Version represents a server version response. +type Version struct { + // Version is the version number reported by the server or backend. + Version string + // Vendor is the vendor string reported by the server or backend. + Vendor string + // Features is a list of enabled, optional features. This was added in + // CouchDB 2.1.0, and can be expected to be empty for older versions. + Features []string + // RawResponse is the raw response body as returned by the server. + RawResponse json.RawMessage +} + +// Client is a connection to a database server. +type Client interface { + // Version returns the server implementation's details. + Version(ctx context.Context) (*Version, error) + // AllDBs returns a list of all existing database names. + AllDBs(ctx context.Context, options map[string]interface{}) ([]string, error) + // DBExists returns true if the database exists. + DBExists(ctx context.Context, dbName string, options map[string]interface{}) (bool, error) + // CreateDB creates the requested DB. The dbName is validated as a valid + // CouchDB database name prior to calling this function, so the driver can + // assume a valid name. + CreateDB(ctx context.Context, dbName string, options map[string]interface{}) error + // DestroyDB deletes the requested DB. + DestroyDB(ctx context.Context, dbName string, options map[string]interface{}) error + // DB returns a handleto the requested database + DB(ctx context.Context, dbName string, options map[string]interface{}) (DB, error) +} + +// DBsStatser is an optional interface, added to support CouchDB 2.2.0's +// /_dbs_info endpoint. If this is not supported, or if this method returns +// status 404, Kivik will fall back to calling the method of issuing a +// GET /{db} for each database requested. +type DBsStatser interface { + // DBsStats returns database statistical information for each database + // named in dbNames. The returned values should be in the same order as + // the requested database names, and any missing databases should return + // a nil *DBStats value. + DBsStats(ctx context.Context, dbNames []string) ([]*DBStats, error) +} + +// Replication represents a _replicator document. +type Replication interface { + // The following methods are called just once, when the Replication is first + // returned from Replicate() or GetReplications(). + ReplicationID() string + Source() string + Target() string + StartTime() time.Time + EndTime() time.Time + State() string + Err() error + + // These methods may be triggered by user actions. + + // Delete deletes a replication, which cancels it if it is running. + Delete(context.Context) error + // Update fetches the latest replication state from the server. + Update(context.Context, *ReplicationInfo) error +} + +// ReplicationInfo represents a snap-shot state of a replication, as provided +// by the _active_tasks endpoint. +type ReplicationInfo struct { + DocWriteFailures int64 + DocsRead int64 + DocsWritten int64 + Progress float64 +} + +// ClientReplicator is an optional interface that may be implemented by a Client +// that supports replication between two database. +type ClientReplicator interface { + // Replicate initiates a replication. + Replicate(ctx context.Context, targetDSN, sourceDSN string, options map[string]interface{}) (Replication, error) + // GetReplications returns a list of replicatoins (i.e. all docs in the + // _replicator database) + GetReplications(ctx context.Context, options map[string]interface{}) ([]Replication, error) +} + +// Authenticator is an optional interface that may be implemented by a Client +// that supports authenitcated connections. +type Authenticator interface { + // Authenticate attempts to authenticate the client using an authenticator. + // If the authenticator is not known to the client, an error should be + // returned. + Authenticate(ctx context.Context, authenticator interface{}) error +} + +// DBStats contains database statistics. +type DBStats struct { + Name string `json:"db_name"` + CompactRunning bool `json:"compact_running"` + DocCount int64 `json:"doc_count"` + DeletedCount int64 `json:"doc_del_count"` + UpdateSeq string `json:"update_seq"` + DiskSize int64 `json:"disk_size"` + ActiveSize int64 `json:"data_size"` + ExternalSize int64 `json:"-"` + Cluster *ClusterStats `json:"cluster,omitempty"` + RawResponse json.RawMessage `json:"-"` +} + +// ClusterStats contains the cluster configuration for the database. +type ClusterStats struct { + Replicas int `json:"n"` + Shards int `json:"q"` + ReadQuorum int `json:"r"` + WriteQuorum int `json:"w"` +} + +// Members represents the members of a database security document. +type Members struct { + Names []string `json:"names,omitempty"` + Roles []string `json:"roles,omitempty"` +} + +// Security represents a database security document. +type Security struct { + Admins Members `json:"admins"` + Members Members `json:"members"` +} + +// DB is a database handle. +type DB interface { + // AllDocs returns all of the documents in the database, subject to the + // options provided. + AllDocs(ctx context.Context, options map[string]interface{}) (Rows, error) + // Get fetches the requested document from the database, and returns the + // content length (or -1 if unknown), and an io.ReadCloser to access the + // raw JSON content. + Get(ctx context.Context, docID string, options map[string]interface{}) (*Document, error) + // CreateDoc creates a new doc, with a server-generated ID. + CreateDoc(ctx context.Context, doc interface{}, options map[string]interface{}) (docID, rev string, err error) + // Put writes the document in the database. + Put(ctx context.Context, docID string, doc interface{}, options map[string]interface{}) (rev string, err error) + // Delete marks the specified document as deleted. + Delete(ctx context.Context, docID, rev string, options map[string]interface{}) (newRev string, err error) + // Stats returns database statistics. + Stats(ctx context.Context) (*DBStats, error) + // Compact initiates compaction of the database. + Compact(ctx context.Context) error + // CompactView initiates compaction of the view. + CompactView(ctx context.Context, ddocID string) error + // ViewCleanup cleans up stale view files. + ViewCleanup(ctx context.Context) error + // Security returns the database's security document. + Security(ctx context.Context) (*Security, error) + // SetSecurity sets the database's security document. + SetSecurity(ctx context.Context, security *Security) error + // Changes returns a Rows iterator for the changes feed. In continuous mode, + // the iterator will continue indefinitely, until Close is called. + Changes(ctx context.Context, options map[string]interface{}) (Changes, error) + // PutAttachment uploads an attachment to the specified document, returning + // the new revision. + PutAttachment(ctx context.Context, docID, rev string, att *Attachment, options map[string]interface{}) (newRev string, err error) + // GetAttachment fetches an attachment for the associated document ID. + GetAttachment(ctx context.Context, docID, filename string, options map[string]interface{}) (*Attachment, error) + // DeleteAttachment deletes an attachment from a document, returning the + // document's new revision. + DeleteAttachment(ctx context.Context, docID, rev, filename string, options map[string]interface{}) (newRev string, err error) + // Query performs a query against a view, subject to the options provided. + // ddoc will be the design doc name without the '_design/' previx. + // view will be the view name without the '_view/' prefix. + Query(ctx context.Context, ddoc, view string, options map[string]interface{}) (Rows, error) +} + +// Document represents a single document returned by Get +type Document struct { + // ContentLength is the size of the document response in bytes. + ContentLength int64 + + // Rev is the revision number returned + Rev string + + // Body contains the respons body, either in raw JSON or multipart/related + // format. + Body io.ReadCloser + + // Attachments will be nil except when attachments=true. + Attachments Attachments +} + +// Attachments is an iterator over the attachments included in a document when +// Get is called with `include_docs=true`. +type Attachments interface { + // Next is called to pupulate att with the next attachment in the result + // set. + // + // Next should return io.EOF when there are no more attachments. + Next(att *Attachment) error + + // Close closes the Attachments iterator + Close() error +} + +// Purger is an optional interface which may be implemented by a DB to support +// document purging. +type Purger interface { + // Purge permanently removes the references to deleted documents from the + // database. + Purge(ctx context.Context, docRevMap map[string][]string) (*PurgeResult, error) +} + +// PurgeResult is the result of a purge request. +type PurgeResult struct { + Seq int64 `json:"purge_seq"` + Purged map[string][]string `json:"purged"` +} + +// BulkDocer is an optional interface which may be implemented by a DB to +// support bulk insert/update operations. For any driver that does not support +// the BulkDocer interface, the Put or CreateDoc methods will be called for each +// document to emulate the same functionality, with options passed through +// unaltered. +type BulkDocer interface { + // BulkDocs alls bulk create, update and/or delete operations. It returns an + // iterator over the results. + BulkDocs(ctx context.Context, docs []interface{}, options map[string]interface{}) (BulkResults, error) +} + +// Finder is the old Finder interface, which does not accept options. It +// remains for compatibility with older backends. +// +// Deprecated: Use OptsFinder instead. +type Finder interface { + Find(ctx context.Context, query interface{}) (Rows, error) + CreateIndex(ctx context.Context, ddoc, name string, index interface{}) error + GetIndexes(ctx context.Context) ([]Index, error) + DeleteIndex(ctx context.Context, ddoc, name string) error + Explain(ctx context.Context, query interface{}) (*QueryPlan, error) +} + +// OptsFinder is an optional interface which may be implemented by a DB. The +// Finder interface provides access to the new (in CouchDB 2.0) MongoDB-style +// query interface. +type OptsFinder interface { + // Find executes a query using the new /_find interface. If query is a + // string, []byte, or json.RawMessage, it should be treated as a raw JSON + // payload. Any other type should be marshaled to JSON. + Find(ctx context.Context, query interface{}, options map[string]interface{}) (Rows, error) + // CreateIndex creates an index if it doesn't already exist. If the index + // already exists, it should do nothing. ddoc and name may be empty, in + // which case they should be provided by the backend. If index is a string, + // []byte, or json.RawMessage, it should be treated as a raw JSON payload. + // Any other type should be marshaled to JSON. + CreateIndex(ctx context.Context, ddoc, name string, index interface{}, options map[string]interface{}) error + // GetIndexes returns a list of all indexes in the database. + GetIndexes(ctx context.Context, options map[string]interface{}) ([]Index, error) + // Delete deletes the requested index. + DeleteIndex(ctx context.Context, ddoc, name string, options map[string]interface{}) error + // Explain returns the query plan for a given query. Explain takes the same + // arguments as Find. + Explain(ctx context.Context, query interface{}, options map[string]interface{}) (*QueryPlan, error) +} + +// QueryPlan is the response of an Explain query. +type QueryPlan struct { + DBName string `json:"dbname"` + Index map[string]interface{} `json:"index"` + Selector map[string]interface{} `json:"selector"` + Options map[string]interface{} `json:"opts"` + Limit int64 `json:"limit"` + Skip int64 `json:"skip"` + + // Fields is the list of fields to be returned in the result set, or + // an empty list if all fields are to be returned. + Fields []interface{} `json:"fields"` + Range map[string]interface{} `json:"range"` +} + +// Index is a MonboDB-style index definition. +type Index struct { + DesignDoc string `json:"ddoc,omitempty"` + Name string `json:"name"` + Type string `json:"type"` + Definition interface{} `json:"def"` +} + +// Attachment represents a file attachment to a document. +type Attachment struct { + Filename string `json:"-"` + ContentType string `json:"content_type"` + Stub bool `json:"stub"` + Follows bool `json:"follows"` + Content io.ReadCloser `json:"-"` + Size int64 `json:"length"` + ContentEncoding string `json:"encoding"` + EncodedLength int64 `json:"encoded_length"` + RevPos int64 `json:"revpos"` + Digest string `json:"digest"` +} + +// AttachmentMetaGetter is an optional interface which may be satisfied by a +// DB. If satisfied, it may be used to fetch meta data about an attachment. If +// not satisfied, GetAttachment will be used instead. +type AttachmentMetaGetter interface { + // GetAttachmentMetaOpts returns meta information about an attachment. + GetAttachmentMeta(ctx context.Context, docID, filename string, options map[string]interface{}) (*Attachment, error) +} + +// BulkResult is the result of a single doc update in a BulkDocs request. +type BulkResult struct { + ID string `json:"id"` + Rev string `json:"rev"` + Error error +} + +// BulkResults is an iterator over the results for a BulkDocs call. +type BulkResults interface { + // Next is called to populate *BulkResult with the values of the next bulk + // result in the set. + // + // Next should return io.EOF when there are no more results. + Next(*BulkResult) error + // Close closes the bulk results iterator. + Close() error +} + +// MetaGetter is an optional interface that may be implemented by a DB. If not +// implemented, the Get method will be used to emulate the functionality, with +// options passed through unaltered. +type MetaGetter interface { + // GetMeta returns the document size and revision of the requested document. + // GetMeta should accept the same options as the Get method. + GetMeta(ctx context.Context, docID string, options map[string]interface{}) (size int64, rev string, err error) +} + +// Flusher is an optional interface that may be implemented by a DB that can +// force a flush of the database backend file(s) to disk or other permanent +// storage. +type Flusher interface { + // Flush requests a flush of disk cache to disk or other permanent storage. + // + // See http://docs.couchdb.org/en/2.0.0/api/database/compact.html#db-ensure-full-commit + Flush(ctx context.Context) error +} + +// Copier is an optional interface that may be implemented by a DB. +// +// If a DB does implement Copier, Copy() functions will use it. If a DB does +// not implement the Copier interface, the functionality will be emulated by +// calling Get followed by Put, with options passed through unaltered, except +// that the 'rev' option will be removed for the Put call. +type Copier interface { + Copy(ctx context.Context, targetID, sourceID string, options map[string]interface{}) (targetRev string, err error) +} + +// DesignDocer is an optional interface that may be implemented by a DB. +type DesignDocer interface { + // DesignDocs returns all of the design documents in the database, subject + // to the options provided. + DesignDocs(ctx context.Context, options map[string]interface{}) (Rows, error) +} + +// LocalDocer is an optional interface that may be implemented by a DB. +type LocalDocer interface { + // LocalDocs returns all of the local documents in the database, subject to + // the options provided. + LocalDocs(ctx context.Context, options map[string]interface{}) (Rows, error) +} + +// Pinger is an optional interface that may be implemented by a Client. When +// not implemented, Kivik will call Version instead, to determine if the +// database is usable. +type Pinger interface { + // Ping returns true if the database is online and available for requests. + Ping(ctx context.Context) (bool, error) +} + +// ClusterMembership contains the list of known nodes, and cluster nodes, as returned +// by the /_membership endpoint. +// See https://docs.couchdb.org/en/latest/api/server/common.html#get--_membership +type ClusterMembership struct { + AllNodes []string `json:"all_nodes"` + ClusterNodes []string `json:"cluster_nodes"` +} + +// Cluster is an optional interface that may be implemented by a Client to +// support CouchDB cluster configuration operations. +type Cluster interface { + // ClusterStatus returns the current cluster status. + ClusterStatus(ctx context.Context, options map[string]interface{}) (string, error) + // ClusterSetup performs the action specified by action. + ClusterSetup(ctx context.Context, action interface{}) error +} + +// Cluster2 extends Cluster (and is merged with it in kivik v4), to allow +// access to the /_membership endpoint. +type Cluster2 interface { + // Membership returns a list of all known nodes, and all nodes configured as + // part of the cluster. + Membership(ctx context.Context) (*ClusterMembership, error) +} + +// ClientCloser is an optional interface that may be implemented by a Client +// to clean up resources when a Client is no longer needed. +type ClientCloser interface { + Close(ctx context.Context) error +} + +// DBCloser is an optional interface that may be implemented by a DB to clean +// up resources when a DB is no longer needed. +type DBCloser interface { + Close(ctx context.Context) error +} + +// RevDiff represents a rev diff for a single document, as returned by the +// RevsDiff method. +type RevDiff struct { + Missing []string `json:"missing,omitempty"` + PossibleAncestors []string `json:"possible_ancestors,omitempty"` +} + +// RevsDiffer is an optional interface that may be implemented by a DB. +type RevsDiffer interface { + // RevsDiff returns a Rows iterator, which should populate the ID and Value + // fields, and nothing else. + RevsDiff(ctx context.Context, revMap interface{}) (Rows, error) +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/errors.go b/vendor/github.com/go-kivik/kivik/v3/driver/errors.go new file mode 100644 index 00000000000..79004fd5373 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/errors.go @@ -0,0 +1,11 @@ +package driver + +type err string + +func (e err) Error() string { + return string(e) +} + +// EOQ should be returned by a view iterator at the end of each query result +// set. +const EOQ = err("EOQ") diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/partition.go b/vendor/github.com/go-kivik/kivik/v3/driver/partition.go new file mode 100644 index 00000000000..35d56a1323d --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/partition.go @@ -0,0 +1,24 @@ +package driver + +import ( + "context" + "encoding/json" +) + +// PartitionedDB is an optional interface that may be satisfied by a DB to +// support querying partitoin-specific information. +type PartitionedDB interface { + // PartitionStats returns information about the named partition. + PartitionStats(ctx context.Context, name string) (*PartitionStats, error) +} + +// PartitionStats contains partition statistics. +type PartitionStats struct { + DBName string + DocCount int64 + DeletedDocCount int64 + Partition string + ActiveSize int64 + ExternalSize int64 + RawResponse json.RawMessage +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/rows.go b/vendor/github.com/go-kivik/kivik/v3/driver/rows.go new file mode 100644 index 00000000000..61411ad3fbc --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/rows.go @@ -0,0 +1,65 @@ +package driver + +import ( + "encoding/json" +) + +// Row is a generic view result row. +type Row struct { + // ID is the document ID of the result. + ID string `json:"id"` + // Key is the view key of the result. For built-in views, this is the same + // as ID. + Key json.RawMessage `json:"key"` + // Value is the raw, un-decoded JSON value. For most built-in views (such as + // /_all_docs), this is `{"rev":"X-xxx"}`. + Value json.RawMessage `json:"value"` + // Doc is the raw, un-decoded JSON document. This is only populated by views + // which return docs, such as /_all_docs?include_docs=true. + Doc json.RawMessage `json:"doc"` + // Error represents the error for any row not fetched. Usually just + // 'not_found'. + Error error `json:"-"` +} + +// Rows is an iterator over a view's results. +type Rows interface { + // Next is called to populate row with the next row in the result set. + // + // Next should return io.EOF when there are no more rows. + Next(row *Row) error + // Close closes the rows iterator. + Close() error + // UpdateSeq is the update sequence of the database, if requested in the + // result set. + UpdateSeq() string + // Offset is the offset where the result set starts. + Offset() int64 + // TotalRows is the number of documents in the database/view. + TotalRows() int64 +} + +// RowsWarner is an optional interface that may be implemented by a Rows, which +// allows a rows iterator to return a non-fatal warning. This is intended for +// use by the /_find endpoint, which generates warnings when indexes don't +// exist. +type RowsWarner interface { + // Warning returns the warning generated by the query, if any. + Warning() string +} + +// Bookmarker is an optional interface that may be implemented by a Rows for +// returning a paging bookmark. +type Bookmarker interface { + // Bookmark returns an opaque bookmark string used for paging, added to + // the /_find endpoint in CouchDB 2.1.1. See the CouchDB documentation for + // usage: http://docs.couchdb.org/en/2.1.1/api/database/find.html#pagination + Bookmark() string +} + +// QueryIndexer is an optional interface that may be implemented by a Rows, +// which allows a rows iterator to return a query index value. This is intended +// for use by multi-query queries to views. +type QueryIndexer interface { + QueryIndex() int +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/session.go b/vendor/github.com/go-kivik/kivik/v3/driver/session.go new file mode 100644 index 00000000000..4e73f23b797 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/session.go @@ -0,0 +1,33 @@ +package driver + +import ( + "context" + "encoding/json" +) + +// Session is a copy of kivik.Session +type Session struct { + // Name is the name of the authenticated user. + Name string + // Roles is a list of roles the user belongs to. + Roles []string + // AuthenticationMethod is the authentication method that was used for this + // session. + AuthenticationMethod string + // AuthenticationDB is the user database against which authentication was + // performed. + AuthenticationDB string + // AuthenticationHandlers is a list of authentication handlers configured on + // the server. + AuthenticationHandlers []string + // RawResponse is the raw JSON response sent by the server, useful for + // custom backends which may provide additional fields. + RawResponse json.RawMessage +} + +// Sessioner is an optional interface that a Client may satisfy to provide +// access to the authenticated session information. +type Sessioner interface { + // Session returns information about the authenticated user. + Session(ctx context.Context) (*Session, error) +} diff --git a/vendor/github.com/go-kivik/kivik/v3/driver/updates.go b/vendor/github.com/go-kivik/kivik/v3/driver/updates.go new file mode 100644 index 00000000000..44aa92c8158 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/driver/updates.go @@ -0,0 +1,29 @@ +package driver + +import "context" + +// DBUpdate represents a database update event. +type DBUpdate struct { + DBName string `json:"db_name"` + Type string `json:"type"` + Seq string `json:"seq"` +} + +// DBUpdates is a DBUpdates iterator. +type DBUpdates interface { + // Next is called to populate DBUpdate with the values of the next update in + // the feed. + // + // Next should return io.EOF when the feed is closed normally. + Next(*DBUpdate) error + // Close closes the iterator. + Close() error +} + +// DBUpdater is an optional interface that may be implemented by a Client to +// provide access to the DB Updates feed. +type DBUpdater interface { + // DBUpdates must return a DBUpdate iterator. The context, or the iterator's + // Close method, may be used to close the iterator. + DBUpdates(context.Context) (DBUpdates, error) +} diff --git a/vendor/github.com/go-kivik/kivik/v3/errors.go b/vendor/github.com/go-kivik/kivik/v3/errors.go new file mode 100644 index 00000000000..7b45c6622ed --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/errors.go @@ -0,0 +1,154 @@ +package kivik + +import ( + "fmt" + "net/http" + "strings" + + "golang.org/x/xerrors" +) + +// Error represents an error returned by Kivik. +// +// This type definition is not guaranteed to remain stable, or even exported. +// When examining errors programatically, you should rely instead on the +// StatusCode() function in this package, rather than on directly observing +// the fields of this type. +type Error struct { + // HTTPStatus is the HTTP status code associated with this error. Normally + // this is the actual HTTP status returned by the server, but in some cases + // it may be generated by Kivik directly. Check the FromServer value if + // the distinction matters to you. + HTTPStatus int + + // FromServer is set to true if the error was returned by the server. + // This field is deprecated and will soon be removed. + FromServer bool + + // Message is the error message. + Message string + + // Err is the originating error, if any. + Err error +} + +var ( + _ error = &Error{} + _ statusCoder = &Error{} + _ causer = &Error{} +) + +func (e *Error) Error() string { + if e.Err == nil { + return e.msg() + } + if e.Message == "" { + return e.Err.Error() + } + return e.Message + ": " + e.Err.Error() +} + +// StatusCode returns the HTTP status code associated with the error, or 500 +// (internal server error), if none. +func (e *Error) StatusCode() int { + if e.HTTPStatus == 0 { + return http.StatusInternalServerError + } + return e.HTTPStatus +} + +// Cause satisfies the github.com/pkg/errors.causer interface by returning e.Err. +func (e *Error) Cause() error { + return e.Err +} + +// Unwrap satisfies the Go 1.13 errors.Wrapper interface +// (golang.org/x/xerrors.Unwrap for older versions of Go). +func (e *Error) Unwrap() error { + return e.Err +} + +// Format implements fmt.Formatter +func (e *Error) Format(f fmt.State, c rune) { + parts := make([]string, 0, 3) + if e.Message != "" { + parts = append(parts, e.Message) + } + switch c { + case 'v': + if f.Flag('+') { + var prefix string + if e.FromServer { + prefix = "server responded with" + } else { + prefix = "kivik generated" + } + parts = append(parts, fmt.Sprintf("%s %d / %s", prefix, e.HTTPStatus, http.StatusText(e.HTTPStatus))) + } + } + if e.Err != nil { + parts = append(parts, e.Err.Error()) + } + _, _ = fmt.Fprint(f, strings.Join(parts, ": ")) +} + +func (e *Error) msg() string { + switch e.Message { + case "": + return http.StatusText(e.StatusCode()) + default: + return e.Message + } +} + +type statusCoder interface { + StatusCode() int +} + +type causer interface { + Cause() error +} + +// StatusCode returns the HTTP status code embedded in the error, or 500 +// (internal server error), if there was no specified status code. If err is +// nil, StatusCode returns 0. This provides a convenient way to determine the +// precise nature of a Kivik-returned error. +// +// For example, to panic for all but NotFound errors: +// +// err := db.Get(context.TODO(), "docID").ScanDoc(&doc) +// if kivik.StatusCode(err) == kivik.StatusNotFound { +// return +// } +// if err != nil { +// panic(err) +// } +// +// This method uses the statusCoder interface, which is not exported by this +// package, but is considered part of the stable public API. Driver +// implementations are expected to return errors which conform to this +// interface. +// +// type statusCoder interface { +// StatusCode() (httpStatusCode int) +// } +func StatusCode(err error) int { + if err == nil { + return 0 + } + var coder statusCoder + for { + if xerrors.As(err, &coder) { + return coder.StatusCode() + } + if uw := xerrors.Unwrap(err); uw != nil { + err = uw + continue + } + if c, ok := err.(causer); ok { + err = c.Cause() + continue + } + return http.StatusInternalServerError + } +} diff --git a/vendor/github.com/go-kivik/kivik/v3/find.go b/vendor/github.com/go-kivik/kivik/v3/find.go new file mode 100644 index 00000000000..e4bce58bc2f --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/find.go @@ -0,0 +1,128 @@ +package kivik + +import ( + "context" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +var findNotImplemented = &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support Find interface"} + +// Find executes a query using the new /_find interface. The query must be +// JSON-marshalable to a valid query. +// See http://docs.couchdb.org/en/2.0.0/api/database/find.html#db-find +func (db *DB) Find(ctx context.Context, query interface{}, options ...Options) (*Rows, error) { + if finder, ok := db.driverDB.(driver.OptsFinder); ok { + rowsi, err := finder.Find(ctx, query, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil + } + // nolint:staticcheck + if finder, ok := db.driverDB.(driver.Finder); ok { + rowsi, err := finder.Find(ctx, query) + if err != nil { + return nil, err + } + return newRows(ctx, rowsi), nil + } + return nil, findNotImplemented +} + +// CreateIndex creates an index if it doesn't already exist. ddoc and name may +// be empty, in which case they will be auto-generated. index must be a valid +// index object, as described here: +// http://docs.couchdb.org/en/stable/api/database/find.html#db-index +func (db *DB) CreateIndex(ctx context.Context, ddoc, name string, index interface{}, options ...Options) error { + if finder, ok := db.driverDB.(driver.OptsFinder); ok { + return finder.CreateIndex(ctx, ddoc, name, index, mergeOptions(options...)) + } + // nolint:staticcheck + if finder, ok := db.driverDB.(driver.Finder); ok { + return finder.CreateIndex(ctx, ddoc, name, index) + } + return findNotImplemented +} + +// DeleteIndex deletes the requested index. +func (db *DB) DeleteIndex(ctx context.Context, ddoc, name string, options ...Options) error { + if finder, ok := db.driverDB.(driver.OptsFinder); ok { + return finder.DeleteIndex(ctx, ddoc, name, mergeOptions(options...)) + } + // nolint:staticcheck + if finder, ok := db.driverDB.(driver.Finder); ok { + return finder.DeleteIndex(ctx, ddoc, name) + } + return findNotImplemented +} + +// Index is a MonboDB-style index definition. +type Index struct { + DesignDoc string `json:"ddoc,omitempty"` + Name string `json:"name"` + Type string `json:"type"` + Definition interface{} `json:"def"` +} + +// GetIndexes returns the indexes defined on the current database. +func (db *DB) GetIndexes(ctx context.Context, options ...Options) ([]Index, error) { + if finder, ok := db.driverDB.(driver.OptsFinder); ok { + dIndexes, err := finder.GetIndexes(ctx, mergeOptions(options...)) + indexes := make([]Index, len(dIndexes)) + for i, index := range dIndexes { + indexes[i] = Index(index) + } + return indexes, err + } + // nolint:staticcheck + if finder, ok := db.driverDB.(driver.Finder); ok { + dIndexes, err := finder.GetIndexes(ctx) + indexes := make([]Index, len(dIndexes)) + for i, index := range dIndexes { + indexes[i] = Index(index) + } + return indexes, err + } + return nil, findNotImplemented +} + +// QueryPlan is the query execution plan for a query, as returned by the Explain +// function. +type QueryPlan struct { + DBName string `json:"dbname"` + Index map[string]interface{} `json:"index"` + Selector map[string]interface{} `json:"selector"` + Options map[string]interface{} `json:"opts"` + Limit int64 `json:"limit"` + Skip int64 `json:"skip"` + + // Fields is the list of fields to be returned in the result set, or + // an empty list if all fields are to be returned. + Fields []interface{} `json:"fields"` + Range map[string]interface{} `json:"range"` +} + +// Explain returns the query plan for a given query. Explain takes the same +// arguments as Find. +func (db *DB) Explain(ctx context.Context, query interface{}, options ...Options) (*QueryPlan, error) { + if explainer, ok := db.driverDB.(driver.OptsFinder); ok { + plan, err := explainer.Explain(ctx, query, mergeOptions(options...)) + if err != nil { + return nil, err + } + qp := QueryPlan(*plan) + return &qp, nil + } + // nolint:staticcheck + if explainer, ok := db.driverDB.(driver.Finder); ok { + plan, err := explainer.Explain(ctx, query) + if err != nil { + return nil, err + } + qp := QueryPlan(*plan) + return &qp, nil + } + return nil, findNotImplemented +} diff --git a/vendor/github.com/go-kivik/kivik/v3/internal/registry/registry.go b/vendor/github.com/go-kivik/kivik/v3/internal/registry/registry.go new file mode 100644 index 00000000000..ef131fbef39 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/internal/registry/registry.go @@ -0,0 +1,36 @@ +// Package registry handles driver registrations. It's in a separate package +// to facilitate testing. +package registry + +import ( + "sync" + + "github.com/go-kivik/kivik/v3/driver" +) + +var ( + driversMu sync.RWMutex + drivers = make(map[string]driver.Driver) +) + +// Register makes a database driver available by the provided name. If Register +// is called twice with the same name or if driver is nil, it panics. +func Register(name string, driver driver.Driver) { + driversMu.Lock() + defer driversMu.Unlock() + if driver == nil { + panic("kivik: Register driver is nil") + } + if _, dup := drivers[name]; dup { + panic("kivik: Register called twice for driver " + name) + } + drivers[name] = driver +} + +// Driver returns the driver registered with the requested name, or nil if +// it has not been registered. +func Driver(name string) driver.Driver { + driversMu.RLock() + defer driversMu.RUnlock() + return drivers[name] +} diff --git a/vendor/github.com/go-kivik/kivik/v3/iterator.go b/vendor/github.com/go-kivik/kivik/v3/iterator.go new file mode 100644 index 00000000000..e4644dbe802 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/iterator.go @@ -0,0 +1,171 @@ +package kivik + +import ( + "context" + "encoding/json" + "io" + "net/http" + "reflect" + "sync" + + "github.com/go-kivik/kivik/v3/driver" +) + +type iterator interface { + Next(interface{}) error + Close() error +} + +type iter struct { + feed iterator + + mu sync.RWMutex + ready bool // Set to true once Next() has been called + closed bool + lasterr error // non-nil only if closed is true + eoq bool + + cancel func() // cancel function to exit context goroutine when iterator is closed + + curVal interface{} +} + +func (i *iter) rlock() (unlock func(), err error) { + i.mu.RLock() + if i.closed { + i.mu.RUnlock() + return nil, &Error{HTTPStatus: http.StatusBadRequest, Message: "kivik: Iterator is closed"} + } + if !i.ready { + i.mu.RUnlock() + return nil, &Error{HTTPStatus: http.StatusBadRequest, Message: "kivik: Iterator access before calling Next"} + } + return func() { i.mu.RUnlock() }, nil +} + +// newIterator instantiates a new iterator. +// +// ctx is a possibly-cancellable context +// zeroValue is an empty instance of the data type this iterator iterates over +// feed is the iterator interface, which typically wraps a driver.X iterator +func newIterator(ctx context.Context, feed iterator, zeroValue interface{}) *iter { + i := &iter{ + feed: feed, + curVal: zeroValue, + } + ctx, i.cancel = context.WithCancel(ctx) + go i.awaitDone(ctx) + return i +} + +// awaitDone blocks until the rows are closed or the context is cancelled, then closes the iterator if it's still open. +func (i *iter) awaitDone(ctx context.Context) { + <-ctx.Done() + _ = i.close(ctx.Err()) +} + +// Next prepares the next iterator result value for reading. It returns true on +// success, or false if there is no next result or an error occurs while +// preparing it. Err should be consulted to distinguish between the two. +func (i *iter) Next() bool { + doClose, ok := i.next() + if doClose { + _ = i.Close() + } + return ok +} + +func (i *iter) next() (doClose, ok bool) { + i.mu.RLock() + defer i.mu.RUnlock() + if i.closed { + return false, false + } + i.ready = true + i.eoq = false + err := i.feed.Next(i.curVal) + if err == driver.EOQ { + i.eoq = true + err = nil + } + i.lasterr = err + if i.lasterr != nil { + return true, false + } + return false, true +} + +// EOQ returns true if the iterator has reached the end of a query in a +// multi-query query. When EOQ is true, the row data will not have been +// updated. It is common to simply `continue` in case of EOQ, unless you care +// about the per-query metadata, such as offset, total rows, etc. +func (i *iter) EOQ() bool { + return i.eoq +} + +// Close closes the Iterator, preventing further enumeration, and freeing any +// resources (such as the http request body) of the underlying feed. If Next is +// called and there are no further results, Iterator is closed automatically and +// it will suffice to check the result of Err. Close is idempotent and does not +// affect the result of Err. +func (i *iter) Close() error { + return i.close(nil) +} + +func (i *iter) close(err error) error { + i.mu.Lock() + defer i.mu.Unlock() + if i.closed { + return nil + } + i.closed = true + + if i.lasterr == nil { + i.lasterr = err + } + + err = i.feed.Close() + + if i.cancel != nil { + i.cancel() + } + + return err +} + +// Err returns the error, if any, that was encountered during iteration. Err +// may be called after an explicit or implicit Close. +func (i *iter) Err() error { + i.mu.RLock() + defer i.mu.RUnlock() + if i.lasterr == io.EOF { + return nil + } + return i.lasterr +} + +func scan(dest interface{}, val json.RawMessage) error { + if reflect.TypeOf(dest).Kind() != reflect.Ptr { + return errNonPtr + } + switch d := dest.(type) { + case *[]byte: + if d == nil { + return errNilPtr + } + tgt := make([]byte, len(val)) + copy(tgt, val) + *d = tgt + return nil + case *json.RawMessage: + if d == nil { + return errNilPtr + } + *d = val + return nil + } + if err := json.Unmarshal(val, dest); err != nil { + return err + } + return nil +} diff --git a/vendor/github.com/go-kivik/kivik/v3/kivik.go b/vendor/github.com/go-kivik/kivik/v3/kivik.go new file mode 100644 index 00000000000..fc005343de9 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/kivik.go @@ -0,0 +1,206 @@ +package kivik + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" + "github.com/go-kivik/kivik/v3/internal/registry" +) + +// Client is a client connection handle to a CouchDB-like server. +type Client struct { + dsn string + driverName string + driverClient driver.Client +} + +// Options is a collection of options. The keys and values are backend specific. +type Options map[string]interface{} + +func mergeOptions(otherOpts ...Options) Options { + if len(otherOpts) == 0 { + return nil + } + options := make(Options) + for _, opts := range otherOpts { + for k, v := range opts { + options[k] = v + } + } + if len(options) == 0 { + return nil + } + return options +} + +// Register makes a database driver available by the provided name. If Register +// is called twice with the same name or if driver is nil, it panics. +func Register(name string, driver driver.Driver) { + registry.Register(name, driver) +} + +// New creates a new client object specified by its database driver name +// and a driver-specific data source name. +func New(driverName, dataSourceName string) (*Client, error) { + driveri := registry.Driver(driverName) + if driveri == nil { + return nil, &Error{HTTPStatus: http.StatusBadRequest, Message: fmt.Sprintf("kivik: unknown driver %q (forgotten import?)", driverName)} + } + client, err := driveri.NewClient(dataSourceName) + if err != nil { + return nil, err + } + return &Client{ + dsn: dataSourceName, + driverName: driverName, + driverClient: client, + }, nil +} + +// Driver returns the name of the driver string used to connect this client. +func (c *Client) Driver() string { + return c.driverName +} + +// DSN returns the data source name used to connect this client. +func (c *Client) DSN() string { + return c.dsn +} + +// Version represents a server version response. +type Version struct { + // Version is the version number reported by the server or backend. + Version string + // Vendor is the vendor string reported by the server or backend. + Vendor string + // Features is a list of enabled, optional features. This was added in + // CouchDB 2.1.0, and can be expected to be empty for older versions. + Features []string + // RawResponse is the raw response body returned by the server, useful if + // you need additional backend-specific information. + // + // For the format of this document, see + // http://docs.couchdb.org/en/2.0.0/api/server/common.html#get + RawResponse json.RawMessage +} + +// Version returns version and vendor info about the backend. +func (c *Client) Version(ctx context.Context) (*Version, error) { + ver, err := c.driverClient.Version(ctx) + if err != nil { + return nil, err + } + v := &Version{} + *v = Version(*ver) + return v, nil +} + +// DB returns a handle to the requested database. Any options parameters +// passed are merged, with later values taking precidence. If any errors occur +// at this stage, they are deferred, or may be checked directly with Err() +func (c *Client) DB(ctx context.Context, dbName string, options ...Options) *DB { + db, err := c.driverClient.DB(ctx, dbName, mergeOptions(options...)) + return &DB{ + client: c, + name: dbName, + driverDB: db, + err: err, + } +} + +// AllDBs returns a list of all databases. +func (c *Client) AllDBs(ctx context.Context, options ...Options) ([]string, error) { + return c.driverClient.AllDBs(ctx, mergeOptions(options...)) +} + +// DBExists returns true if the specified database exists. +func (c *Client) DBExists(ctx context.Context, dbName string, options ...Options) (bool, error) { + return c.driverClient.DBExists(ctx, dbName, mergeOptions(options...)) +} + +// CreateDB creates a DB of the requested name. Any errors are deferred, or may +// be checked with Err(). +func (c *Client) CreateDB(ctx context.Context, dbName string, options ...Options) error { + return c.driverClient.CreateDB(ctx, dbName, mergeOptions(options...)) +} + +// DestroyDB deletes the requested DB. +func (c *Client) DestroyDB(ctx context.Context, dbName string, options ...Options) error { + return c.driverClient.DestroyDB(ctx, dbName, mergeOptions(options...)) +} + +// Authenticate authenticates the client with the passed authenticator, which +// is driver-specific. If the driver does not understand the authenticator, an +// error will be returned. +func (c *Client) Authenticate(ctx context.Context, a interface{}) error { + if auth, ok := c.driverClient.(driver.Authenticator); ok { + return auth.Authenticate(ctx, a) + } + return &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support authentication"} +} + +func missingArg(arg string) error { + return &Error{HTTPStatus: http.StatusBadRequest, Message: fmt.Sprintf("kivik: %s required", arg)} +} + +// DBsStats returns database statistics about one or more databases. +func (c *Client) DBsStats(ctx context.Context, dbnames []string) ([]*DBStats, error) { + dbstats, err := c.nativeDBsStats(ctx, dbnames) + switch StatusCode(err) { + case http.StatusNotFound, http.StatusNotImplemented: + return c.fallbackDBsStats(ctx, dbnames) + } + return dbstats, err +} + +func (c *Client) fallbackDBsStats(ctx context.Context, dbnames []string) ([]*DBStats, error) { + dbstats := make([]*DBStats, len(dbnames)) + for i, dbname := range dbnames { + db := c.DB(ctx, dbname) + stat, err := db.Stats(ctx) + if err != nil { + return nil, err + } + dbstats[i] = stat + } + return dbstats, nil +} + +func (c *Client) nativeDBsStats(ctx context.Context, dbnames []string) ([]*DBStats, error) { + statser, ok := c.driverClient.(driver.DBsStatser) + if !ok { + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: not supported by driver"} + } + stats, err := statser.DBsStats(ctx, dbnames) + if err != nil { + return nil, err + } + dbstats := make([]*DBStats, len(stats)) + for i, stat := range stats { + dbstats[i] = driverStats2kivikStats(stat) + } + return dbstats, nil +} + +// Ping returns true if the database is online and available for requests, +// for instance by querying the /_up endpoint. If the underlying driver +// supports the Pinger interface, it will be used. Otherwise, a fallback is +// made to calling Version. +func (c *Client) Ping(ctx context.Context) (bool, error) { + if pinger, ok := c.driverClient.(driver.Pinger); ok { + return pinger.Ping(ctx) + } + _, err := c.driverClient.Version(ctx) + return err == nil, err +} + +// Close cleans up any resources used by Client. +func (c *Client) Close(ctx context.Context) error { + if closer, ok := c.driverClient.(driver.ClientCloser); ok { + return closer.Close(ctx) + } + return nil +} diff --git a/vendor/github.com/go-kivik/kivik/v3/package.json b/vendor/github.com/go-kivik/kivik/v3/package.json new file mode 100644 index 00000000000..72771545680 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/package.json @@ -0,0 +1,18 @@ +{ + "name": "kivik", + "version": "0.0.1", + "description": "Isomorphic Go and GopherJS client library for CouchDB & PouchDB", + "author": "Jonathan Hall ", + "repository": { + "type": "git", + "url": "https://github.com/go-kivik/kivik" + }, + "devDependencies": { + "pouchdb": "*", + "pouchdb-find": "*", + "pouchdb-all-dbs": "*", + "memdown": ">=1.1.0", + "inherits": "*", + "xhr2": "*" + } +} diff --git a/vendor/github.com/go-kivik/kivik/v3/replication.go b/vendor/github.com/go-kivik/kivik/v3/replication.go new file mode 100644 index 00000000000..4188fef2ffa --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/replication.go @@ -0,0 +1,199 @@ +package kivik + +import ( + "context" + "net/http" + "sync" + "time" + + "github.com/go-kivik/kivik/v3/driver" +) + +// ReplicationState represents a replication's state +type ReplicationState string + +// The possible values for the _replication_state field in _replicator documents +// plus a blank value for unstarted replications. +const ( + ReplicationNotStarted ReplicationState = "" + ReplicationStarted ReplicationState = "triggered" + ReplicationError ReplicationState = "error" + ReplicationComplete ReplicationState = "completed" +) + +// The additional possible values for the state field in the _scheduler docs. +const ( + ReplicationInitializing ReplicationState = "initializing" + ReplicationRunning ReplicationState = "running" + ReplicationPending ReplicationState = "pending" + ReplicationCrashing ReplicationState = "crashing" + ReplicationFailed ReplicationState = "failed" +) + +// Replication represents a CouchDB replication process. +type Replication struct { + Source string + Target string + + infoMU sync.RWMutex + info *driver.ReplicationInfo + statusErr error + irep driver.Replication +} + +// DocsWritten returns the number of documents written, if known. +func (r *Replication) DocsWritten() int64 { + if r != nil && r.info != nil { + r.infoMU.RLock() + defer r.infoMU.RUnlock() + return r.info.DocsWritten + } + return 0 +} + +// DocsRead returns the number of documents read, if known. +func (r *Replication) DocsRead() int64 { + if r != nil && r.info != nil { + r.infoMU.RLock() + defer r.infoMU.RUnlock() + return r.info.DocsRead + } + return 0 +} + +// DocWriteFailures returns the number of doc write failures, if known. +func (r *Replication) DocWriteFailures() int64 { + if r != nil && r.info != nil { + r.infoMU.RLock() + defer r.infoMU.RUnlock() + return r.info.DocWriteFailures + } + return 0 +} + +// Progress returns the current replication progress, if known. +func (r *Replication) Progress() float64 { + if r != nil && r.info != nil { + r.infoMU.RLock() + defer r.infoMU.RUnlock() + return r.info.Progress + } + return 0 +} + +func newReplication(rep driver.Replication) *Replication { + return &Replication{ + Source: rep.Source(), + Target: rep.Target(), + irep: rep, + } +} + +// ReplicationID returns the _replication_id field of the replicator document. +func (r *Replication) ReplicationID() string { + return r.irep.ReplicationID() +} + +// StartTime returns the replication start time, once the replication has been +// triggered. +func (r *Replication) StartTime() time.Time { + return r.irep.StartTime() +} + +// EndTime returns the replication end time, once the replication has terminated. +func (r *Replication) EndTime() time.Time { + return r.irep.EndTime() +} + +// State returns the current replication state +func (r *Replication) State() ReplicationState { + return ReplicationState(r.irep.State()) +} + +// Err returns the error, if any, that caused the replication to abort. +func (r *Replication) Err() error { + if r == nil { + return nil + } + return r.irep.Err() +} + +// IsActive returns true if the replication has not yet completed or +// errored. +func (r *Replication) IsActive() bool { + if r == nil { + return false + } + switch r.State() { + case ReplicationError, ReplicationComplete, ReplicationCrashing, ReplicationFailed: + return false + default: + return true + } +} + +// Delete deletes a replication. If it is currently running, it will be +// cancelled. +func (r *Replication) Delete(ctx context.Context) error { + return r.irep.Delete(ctx) +} + +// Update requests a replication state update from the server. If there is an +// error retrieving the update, it is returned and the replication state is +// unaltered. +func (r *Replication) Update(ctx context.Context) error { + var info driver.ReplicationInfo + r.statusErr = r.irep.Update(ctx, &info) + if r.statusErr != nil { + return r.statusErr + } + r.infoMU.Lock() + r.info = &info + r.infoMU.Unlock() + return nil +} + +var replicationNotImplemented = &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support replication"} + +// GetReplications returns a list of defined replications in the _replicator +// database. Options are in the same format as to AllDocs(), except that +// "conflicts" and "update_seq" are ignored. +func (c *Client) GetReplications(ctx context.Context, options ...Options) ([]*Replication, error) { + replicator, ok := c.driverClient.(driver.ClientReplicator) + if !ok { + return nil, replicationNotImplemented + } + reps, err := replicator.GetReplications(ctx, mergeOptions(options...)) + if err != nil { + return nil, err + } + replications := make([]*Replication, len(reps)) + for i, rep := range reps { + replications[i] = newReplication(rep) + } + return replications, nil +} + +// Replicate initiates a replication from source to target. +// +// To use an object for either "source" or "target", pass the desired object +// in options. This will override targetDSN and sourceDSN function parameters. +func (c *Client) Replicate(ctx context.Context, targetDSN, sourceDSN string, options ...Options) (*Replication, error) { + replicator, ok := c.driverClient.(driver.ClientReplicator) + if !ok { + return nil, replicationNotImplemented + } + rep, err := replicator.Replicate(ctx, targetDSN, sourceDSN, mergeOptions(options...)) + if err != nil { + return nil, err + } + return newReplication(rep), nil +} + +// ReplicationInfo represents a snapshot of the status of a replication. +type ReplicationInfo struct { + DocWriteFailures int64 + DocsRead int64 + DocsWritten int64 + Progress float64 +} diff --git a/vendor/github.com/go-kivik/kivik/v3/rows.go b/vendor/github.com/go-kivik/kivik/v3/rows.go new file mode 100644 index 00000000000..73aa263488b --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/rows.go @@ -0,0 +1,188 @@ +package kivik + +import ( + "context" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +// Rows is an iterator over a a multi-value query. +type Rows struct { + *iter + rowsi driver.Rows +} + +// Next prepares the next result value for reading. It returns true on success +// or false if there are no more results or an error occurs while preparing it. +// Err should be consulted to distinguish between the two. +func (r *Rows) Next() bool { + return r.iter.Next() +} + +// Err returns the error, if any, that was encountered during iteration. Err may +// be called after an explicit or implicit Close. +func (r *Rows) Err() error { + return r.iter.Err() +} + +// Close closes the Rows, preventing further enumeration, and freeing any +// resources (such as the http request body) of the underlying query. If Next is +// called and there are no further results, Rows is closed automatically and it +// will suffice to check the result of Err. Close is idempotent and does not +// affect the result of Err. +func (r *Rows) Close() error { + return r.iter.Close() +} + +type rowsIterator struct{ driver.Rows } + +var _ iterator = &rowsIterator{} + +func (r *rowsIterator) Next(i interface{}) error { return r.Rows.Next(i.(*driver.Row)) } + +func newRows(ctx context.Context, rowsi driver.Rows) *Rows { + return &Rows{ + iter: newIterator(ctx, &rowsIterator{rowsi}, &driver.Row{}), + rowsi: rowsi, + } +} + +var ( + errNilPtr = &Error{HTTPStatus: http.StatusBadRequest, Message: "kivik: destination pointer is nil"} + errNonPtr = &Error{HTTPStatus: http.StatusBadRequest, Message: "kivik: destination is not a pointer"} +) + +// ScanValue copies the data from the result value into the value pointed at by +// dest. Think of this as a json.Unmarshal into dest. +// +// If the dest argument has type *[]byte, Scan stores a copy of the input data. +// The copy is owned by the caller and can be modified and held indefinitely. +// +// The copy can be avoided by using an argument of type *json.RawMessage +// instead. After a ScanValue into a json.RawMessage, the slice is only valid +// until the next call to Next or Close. +// +// For all other types, refer to the documentation for json.Unmarshal for type +// conversion rules. +func (r *Rows) ScanValue(dest interface{}) error { + runlock, err := r.rlock() + if err != nil { + return err + } + defer runlock() + if err := r.curVal.(*driver.Row).Error; err != nil { + return err + } + return scan(dest, r.curVal.(*driver.Row).Value) +} + +// ScanDoc works the same as ScanValue, but on the doc field of the result. It +// will panic if the query does not include documents. +func (r *Rows) ScanDoc(dest interface{}) error { + runlock, err := r.rlock() + if err != nil { + return err + } + defer runlock() + if err := r.curVal.(*driver.Row).Error; err != nil { + return err + } + doc := r.curVal.(*driver.Row).Doc + if doc == nil { + return &Error{HTTPStatus: http.StatusBadRequest, Message: "kivik: doc is nil; does the query include docs?"} + } + return scan(dest, doc) +} + +// ScanKey works the same as ScanValue, but on the key field of the result. For +// simple keys, which are just strings, the Key() method may be easier to use. +func (r *Rows) ScanKey(dest interface{}) error { + runlock, err := r.rlock() + if err != nil { + return err + } + if err := r.curVal.(*driver.Row).Error; err != nil { + return err + } + defer runlock() + return scan(dest, r.curVal.(*driver.Row).Key) +} + +// ID returns the ID of the current result. +func (r *Rows) ID() string { + runlock, err := r.rlock() + if err != nil { + return "" + } + defer runlock() + return r.curVal.(*driver.Row).ID +} + +// Key returns the Key of the current result as a raw JSON string. For +// compound keys, the ScanKey() method may be more convenient. +func (r *Rows) Key() string { + runlock, err := r.rlock() + if err != nil { + return "" + } + defer runlock() + return string(r.curVal.(*driver.Row).Key) +} + +// Offset returns the starting offset where the result set started. It is +// only guaranteed to be set after all result rows have been enumerated through +// by Next, and thus should only be read after processing all rows in a result +// set. Calling Close before enumerating will render this value unreliable. +func (r *Rows) Offset() int64 { + return r.rowsi.Offset() +} + +// TotalRows returns the total number of rows in the view which would have been +// returned if no limiting were used. This value is only guaranteed to be set +// after all result rows have been enumerated through by Next, and thus should +// only be read after processing all rows in a result set. Calling Close before +// enumerating will render this value unreliable. +func (r *Rows) TotalRows() int64 { + return r.rowsi.TotalRows() +} + +// UpdateSeq returns the sequence id of the underlying database the view +// reflects, if requested in the query. This value is only guaranteed to be set +// after all result rows have been enumerated through by Next, and thus should +// only be read after processing all rows in a result set. Calling Close before +// enumerating will render this value unreliable. +func (r *Rows) UpdateSeq() string { + return r.rowsi.UpdateSeq() +} + +// Warning returns a warning generated by the query, if any. This value is only +// guaranteed to be set after all result rows have been enumeratd through by +// Next. +func (r *Rows) Warning() string { + if w, ok := r.rowsi.(driver.RowsWarner); ok { + return w.Warning() + } + return "" +} + +// QueryIndex returns the 0-based index of the query. For standard queries, +// this is always 0. When multiple queries are passed to the view, this will +// represent the query currently being iterated +func (r *Rows) QueryIndex() int { + if qi, ok := r.rowsi.(driver.QueryIndexer); ok { + return qi.QueryIndex() + } + return 0 +} + +// Bookmark returns the paging bookmark, if one was provided with the result +// set. This is intended for use with the Mango /_find interface, with CouchDB +// 2.1.1 and later. Consult the official CouchDB documentation for detailed +// usage instructions. http://docs.couchdb.org/en/2.1.1/api/database/find.html#pagination +func (r *Rows) Bookmark() string { + if b, ok := r.rowsi.(driver.Bookmarker); ok { + return b.Bookmark() + } + return "" +} diff --git a/vendor/github.com/go-kivik/kivik/v3/security.go b/vendor/github.com/go-kivik/kivik/v3/security.go new file mode 100644 index 00000000000..af3da4b0b38 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/security.go @@ -0,0 +1,13 @@ +package kivik + +// Members represents the members of a database security document. +type Members struct { + Names []string `json:"names,omitempty"` + Roles []string `json:"roles,omitempty"` +} + +// Security represents a database security document. +type Security struct { + Admins Members `json:"admins"` + Members Members `json:"members"` +} diff --git a/vendor/github.com/go-kivik/kivik/v3/session.go b/vendor/github.com/go-kivik/kivik/v3/session.go new file mode 100644 index 00000000000..56a6f4647b8 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/session.go @@ -0,0 +1,42 @@ +package kivik + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +// Session represents an authentication session. +type Session struct { + // Name is the name of the authenticated user. + Name string + // Roles is a list of roles the user belongs to. + Roles []string + // AuthenticationMethod is the authentication method that was used for this + // session. + AuthenticationMethod string + // AuthenticationDB is the user database against which authentication was + // performed. + AuthenticationDB string + // AuthenticationHandlers is a list of authentication handlers configured on + // the server. + AuthenticationHandlers []string + // RawResponse is the raw JSON response sent by the server, useful for + // custom backends which may provide additional fields. + RawResponse json.RawMessage +} + +// Session returns information about the currently authenticated user. +func (c *Client) Session(ctx context.Context) (*Session, error) { + if sessioner, ok := c.driverClient.(driver.Sessioner); ok { + session, err := sessioner.Session(ctx) + if err != nil { + return nil, err + } + ses := Session(*session) + return &ses, nil + } + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support sessions"} +} diff --git a/vendor/github.com/go-kivik/kivik/v3/updates.go b/vendor/github.com/go-kivik/kivik/v3/updates.go new file mode 100644 index 00000000000..e6bd1596601 --- /dev/null +++ b/vendor/github.com/go-kivik/kivik/v3/updates.go @@ -0,0 +1,90 @@ +package kivik + +import ( + "context" + "net/http" + + "github.com/go-kivik/kivik/v3/driver" +) + +// DBUpdates provides access to database updates. +type DBUpdates struct { + *iter + updatesi driver.DBUpdates +} + +// Next returns the next DBUpdate from the feed. This function will block +// until an event is received. If an error occurs, it will be returned and +// the feed closed. If the feed was closed normally, io.EOF will be returned +// when there are no more events in the buffer. +func (f *DBUpdates) Next() bool { + return f.iter.Next() +} + +// Close closes the feed. Any unread updates will still be accessible via +// Next(). +func (f *DBUpdates) Close() error { + return f.iter.Close() +} + +// Err returns the error, if any, that was encountered during iteration. Err +// may be called after an explicit or implicit Close. +func (f *DBUpdates) Err() error { + return f.iter.Err() +} + +type updatesIterator struct{ driver.DBUpdates } + +var _ iterator = &updatesIterator{} + +func (r *updatesIterator) Next(i interface{}) error { return r.DBUpdates.Next(i.(*driver.DBUpdate)) } + +func newDBUpdates(ctx context.Context, updatesi driver.DBUpdates) *DBUpdates { + return &DBUpdates{ + iter: newIterator(ctx, &updatesIterator{updatesi}, &driver.DBUpdate{}), + updatesi: updatesi, + } +} + +// DBName returns the database name for the current update. +func (f *DBUpdates) DBName() string { + runlock, err := f.rlock() + if err != nil { + return "" + } + defer runlock() + return f.curVal.(*driver.DBUpdate).DBName +} + +// Type returns the type of the current update. +func (f *DBUpdates) Type() string { + runlock, err := f.rlock() + if err != nil { + return "" + } + defer runlock() + return f.curVal.(*driver.DBUpdate).Type +} + +// Seq returns the update sequence of the current update. +func (f *DBUpdates) Seq() string { + runlock, err := f.rlock() + if err != nil { + return "" + } + defer runlock() + return f.curVal.(*driver.DBUpdate).Seq +} + +// DBUpdates begins polling for database updates. +func (c *Client) DBUpdates(ctx context.Context) (*DBUpdates, error) { + updater, ok := c.driverClient.(driver.DBUpdater) + if !ok { + return nil, &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not implement DBUpdater"} + } + updatesi, err := updater.DBUpdates(ctx) + if err != nil { + return nil, err + } + return newDBUpdates(context.Background(), updatesi), nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index e5b7d7974b7..a7d04462ab7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -346,7 +346,7 @@ github.com/eapache/go-xerial-snappy # github.com/eapache/queue v1.1.0 ## explicit github.com/eapache/queue -# github.com/elastic/go-elasticsearch/v7 v7.17.7 +# github.com/elastic/go-elasticsearch/v7 v7.17.1 ## explicit; go 1.11 github.com/elastic/go-elasticsearch/v7 github.com/elastic/go-elasticsearch/v7/esapi @@ -374,6 +374,15 @@ github.com/fsnotify/fsnotify # github.com/go-errors/errors v1.0.1 ## explicit github.com/go-errors/errors +# github.com/go-kivik/couchdb/v3 v3.3.0 +## explicit; go 1.13 +github.com/go-kivik/couchdb/v3 +github.com/go-kivik/couchdb/v3/chttp +# github.com/go-kivik/kivik/v3 v3.2.3 +## explicit; go 1.13 +github.com/go-kivik/kivik/v3 +github.com/go-kivik/kivik/v3/driver +github.com/go-kivik/kivik/v3/internal/registry # github.com/go-logr/logr v1.2.3 ## explicit; go 1.16 github.com/go-logr/logr