Completed
Pull Request — master (#370)
by Maxence
02:03
created
lib/Vendor/Elastic/Elasticsearch/Endpoints/Connector.php 3 patches
Indentation   +573 added lines, -573 removed lines patch added patch discarded remove patch
@@ -25,577 +25,577 @@
 block discarded – undo
25 25
  */
26 26
 class Connector extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Updates the last_seen timestamp in the connector document.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html
32
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
33
-     *
34
-     * @param array{
35
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
36
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
37
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
38
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
39
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
40
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
41
-     * } $params
42
-     *
43
-     * @throws MissingParameterException if a required parameter is missing
44
-     * @throws NoNodeAvailableException if all the hosts are offline
45
-     * @throws ClientResponseException if the status code of response is 4xx
46
-     * @throws ServerResponseException if the status code of response is 5xx
47
-     *
48
-     * @return Elasticsearch|Promise
49
-     */
50
-    public function checkIn(array $params = [])
51
-    {
52
-        $this->checkRequiredParameters(['connector_id'], $params);
53
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_check_in';
54
-        $method = 'PUT';
55
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
56
-        $headers = ['Accept' => 'application/json'];
57
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
58
-    }
59
-    /**
60
-     * Deletes a connector.
61
-     *
62
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html
63
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
64
-     *
65
-     * @param array{
66
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be deleted.
67
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
-     * } $params
73
-     *
74
-     * @throws MissingParameterException if a required parameter is missing
75
-     * @throws NoNodeAvailableException if all the hosts are offline
76
-     * @throws ClientResponseException if the status code of response is 4xx
77
-     * @throws ServerResponseException if the status code of response is 5xx
78
-     *
79
-     * @return Elasticsearch|Promise
80
-     */
81
-    public function delete(array $params = [])
82
-    {
83
-        $this->checkRequiredParameters(['connector_id'], $params);
84
-        $url = '/_connector/' . $this->encode($params['connector_id']);
85
-        $method = 'DELETE';
86
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
-        $headers = ['Accept' => 'application/json'];
88
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
89
-    }
90
-    /**
91
-     * Returns the details about a connector.
92
-     *
93
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html
94
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
95
-     *
96
-     * @param array{
97
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be returned.
98
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
99
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
100
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
101
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
102
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
103
-     * } $params
104
-     *
105
-     * @throws MissingParameterException if a required parameter is missing
106
-     * @throws NoNodeAvailableException if all the hosts are offline
107
-     * @throws ClientResponseException if the status code of response is 4xx
108
-     * @throws ServerResponseException if the status code of response is 5xx
109
-     *
110
-     * @return Elasticsearch|Promise
111
-     */
112
-    public function get(array $params = [])
113
-    {
114
-        $this->checkRequiredParameters(['connector_id'], $params);
115
-        $url = '/_connector/' . $this->encode($params['connector_id']);
116
-        $method = 'GET';
117
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
118
-        $headers = ['Accept' => 'application/json'];
119
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
120
-    }
121
-    /**
122
-     * Updates the stats of last sync in the connector document.
123
-     *
124
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html
125
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
126
-     *
127
-     * @param array{
128
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
129
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
130
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
131
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
132
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
133
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
134
-     *     body: array, // (REQUIRED) Object with stats related to the last connector sync run.
135
-     * } $params
136
-     *
137
-     * @throws MissingParameterException if a required parameter is missing
138
-     * @throws NoNodeAvailableException if all the hosts are offline
139
-     * @throws ClientResponseException if the status code of response is 4xx
140
-     * @throws ServerResponseException if the status code of response is 5xx
141
-     *
142
-     * @return Elasticsearch|Promise
143
-     */
144
-    public function lastSync(array $params = [])
145
-    {
146
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
147
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync';
148
-        $method = 'PUT';
149
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
150
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
151
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
152
-    }
153
-    /**
154
-     * Lists all connectors.
155
-     *
156
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html
157
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
158
-     *
159
-     * @param array{
160
-     *     from: int, // Starting offset (default: 0)
161
-     *     size: int, // Specifies a max number of results to get (default: 100)
162
-     *     index_name: list, // A comma-separated list of connector index names to fetch connector documents for
163
-     *     connector_name: list, // A comma-separated list of connector names to fetch connector documents for
164
-     *     service_type: list, // A comma-separated list of connector service types to fetch connector documents for
165
-     *     query: string, // A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names
166
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
167
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
168
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
169
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
170
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
171
-     * } $params
172
-     *
173
-     * @throws NoNodeAvailableException if all the hosts are offline
174
-     * @throws ClientResponseException if the status code of response is 4xx
175
-     * @throws ServerResponseException if the status code of response is 5xx
176
-     *
177
-     * @return Elasticsearch|Promise
178
-     */
179
-    public function list(array $params = [])
180
-    {
181
-        $url = '/_connector';
182
-        $method = 'GET';
183
-        $url = $this->addQueryString($url, $params, ['from', 'size', 'index_name', 'connector_name', 'service_type', 'query', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
184
-        $headers = ['Accept' => 'application/json'];
185
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
186
-    }
187
-    /**
188
-     * Creates a connector.
189
-     *
190
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html
191
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
192
-     *
193
-     * @param array{
194
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
195
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
196
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
197
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
198
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
199
-     *     body: array, // (REQUIRED) The connector configuration.
200
-     * } $params
201
-     *
202
-     * @throws NoNodeAvailableException if all the hosts are offline
203
-     * @throws ClientResponseException if the status code of response is 4xx
204
-     * @throws ServerResponseException if the status code of response is 5xx
205
-     *
206
-     * @return Elasticsearch|Promise
207
-     */
208
-    public function post(array $params = [])
209
-    {
210
-        $this->checkRequiredParameters(['body'], $params);
211
-        $url = '/_connector';
212
-        $method = 'POST';
213
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
214
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
215
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
216
-    }
217
-    /**
218
-     * Creates or updates a connector.
219
-     *
220
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html
221
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
222
-     *
223
-     * @param array{
224
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be created or updated.
225
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
226
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
227
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
228
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
229
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
230
-     *     body: array, // (REQUIRED) The connector configuration.
231
-     * } $params
232
-     *
233
-     * @throws MissingParameterException if a required parameter is missing
234
-     * @throws NoNodeAvailableException if all the hosts are offline
235
-     * @throws ClientResponseException if the status code of response is 4xx
236
-     * @throws ServerResponseException if the status code of response is 5xx
237
-     *
238
-     * @return Elasticsearch|Promise
239
-     */
240
-    public function put(array $params = [])
241
-    {
242
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
243
-        $url = '/_connector/' . $this->encode($params['connector_id']);
244
-        $method = 'PUT';
245
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
246
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
247
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
248
-    }
249
-    /**
250
-     * Updates the API key id and/or API key secret id fields in the connector document.
251
-     *
252
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html
253
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
254
-     *
255
-     * @param array{
256
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
257
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
258
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
259
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
260
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
261
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
262
-     *     body: array, // (REQUIRED) An object containing the connector's API key id and/or Connector Secret document id for that API key.
263
-     * } $params
264
-     *
265
-     * @throws MissingParameterException if a required parameter is missing
266
-     * @throws NoNodeAvailableException if all the hosts are offline
267
-     * @throws ClientResponseException if the status code of response is 4xx
268
-     * @throws ServerResponseException if the status code of response is 5xx
269
-     *
270
-     * @return Elasticsearch|Promise
271
-     */
272
-    public function updateApiKeyId(array $params = [])
273
-    {
274
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
275
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id';
276
-        $method = 'PUT';
277
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
278
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
279
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
280
-    }
281
-    /**
282
-     * Updates the connector configuration.
283
-     *
284
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html
285
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
286
-     *
287
-     * @param array{
288
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
289
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
290
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
291
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
292
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
293
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
294
-     *     body: array, // (REQUIRED) Mapping between field names to configuration.
295
-     * } $params
296
-     *
297
-     * @throws MissingParameterException if a required parameter is missing
298
-     * @throws NoNodeAvailableException if all the hosts are offline
299
-     * @throws ClientResponseException if the status code of response is 4xx
300
-     * @throws ServerResponseException if the status code of response is 5xx
301
-     *
302
-     * @return Elasticsearch|Promise
303
-     */
304
-    public function updateConfiguration(array $params = [])
305
-    {
306
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
307
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_configuration';
308
-        $method = 'PUT';
309
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
310
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
311
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
312
-    }
313
-    /**
314
-     * Updates the error field in the connector document.
315
-     *
316
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html
317
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
318
-     *
319
-     * @param array{
320
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
321
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
322
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
323
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
324
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
325
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
326
-     *     body: array, // (REQUIRED) An object containing the connector's error.
327
-     * } $params
328
-     *
329
-     * @throws MissingParameterException if a required parameter is missing
330
-     * @throws NoNodeAvailableException if all the hosts are offline
331
-     * @throws ClientResponseException if the status code of response is 4xx
332
-     * @throws ServerResponseException if the status code of response is 5xx
333
-     *
334
-     * @return Elasticsearch|Promise
335
-     */
336
-    public function updateError(array $params = [])
337
-    {
338
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
339
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_error';
340
-        $method = 'PUT';
341
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
342
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
343
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
344
-    }
345
-    /**
346
-     * Updates the filtering field in the connector document.
347
-     *
348
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html
349
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
350
-     *
351
-     * @param array{
352
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
353
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
354
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
355
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
356
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
357
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
358
-     *     body: array, // (REQUIRED) A list of connector filtering configurations.
359
-     * } $params
360
-     *
361
-     * @throws MissingParameterException if a required parameter is missing
362
-     * @throws NoNodeAvailableException if all the hosts are offline
363
-     * @throws ClientResponseException if the status code of response is 4xx
364
-     * @throws ServerResponseException if the status code of response is 5xx
365
-     *
366
-     * @return Elasticsearch|Promise
367
-     */
368
-    public function updateFiltering(array $params = [])
369
-    {
370
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
371
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering';
372
-        $method = 'PUT';
373
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
374
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
375
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
376
-    }
377
-    /**
378
-     * Updates the index name of the connector.
379
-     *
380
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html
381
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
382
-     *
383
-     * @param array{
384
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
385
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
386
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
387
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
388
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
389
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
390
-     *     body: array, // (REQUIRED) An object containing the connector's index name.
391
-     * } $params
392
-     *
393
-     * @throws MissingParameterException if a required parameter is missing
394
-     * @throws NoNodeAvailableException if all the hosts are offline
395
-     * @throws ClientResponseException if the status code of response is 4xx
396
-     * @throws ServerResponseException if the status code of response is 5xx
397
-     *
398
-     * @return Elasticsearch|Promise
399
-     */
400
-    public function updateIndexName(array $params = [])
401
-    {
402
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
403
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name';
404
-        $method = 'PUT';
405
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
406
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
407
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
408
-    }
409
-    /**
410
-     * Updates the name and/or description fields in the connector document.
411
-     *
412
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html
413
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
414
-     *
415
-     * @param array{
416
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
417
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
418
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
419
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
420
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
421
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
422
-     *     body: array, // (REQUIRED) An object containing the connector's name and/or description.
423
-     * } $params
424
-     *
425
-     * @throws MissingParameterException if a required parameter is missing
426
-     * @throws NoNodeAvailableException if all the hosts are offline
427
-     * @throws ClientResponseException if the status code of response is 4xx
428
-     * @throws ServerResponseException if the status code of response is 5xx
429
-     *
430
-     * @return Elasticsearch|Promise
431
-     */
432
-    public function updateName(array $params = [])
433
-    {
434
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
435
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_name';
436
-        $method = 'PUT';
437
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
438
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
439
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
440
-    }
441
-    /**
442
-     * Updates the is_native flag of the connector.
443
-     *
444
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html
445
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
446
-     *
447
-     * @param array{
448
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
449
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
450
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
451
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
452
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
453
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
454
-     *     body: array, // (REQUIRED) An object containing the connector's is_native flag
455
-     * } $params
456
-     *
457
-     * @throws MissingParameterException if a required parameter is missing
458
-     * @throws NoNodeAvailableException if all the hosts are offline
459
-     * @throws ClientResponseException if the status code of response is 4xx
460
-     * @throws ServerResponseException if the status code of response is 5xx
461
-     *
462
-     * @return Elasticsearch|Promise
463
-     */
464
-    public function updateNative(array $params = [])
465
-    {
466
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
467
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_native';
468
-        $method = 'PUT';
469
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
470
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
471
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
472
-    }
473
-    /**
474
-     * Updates the pipeline field in the connector document.
475
-     *
476
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html
477
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
478
-     *
479
-     * @param array{
480
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
481
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
482
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
483
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
484
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
485
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
486
-     *     body: array, // (REQUIRED) An object with connector ingest pipeline configuration.
487
-     * } $params
488
-     *
489
-     * @throws MissingParameterException if a required parameter is missing
490
-     * @throws NoNodeAvailableException if all the hosts are offline
491
-     * @throws ClientResponseException if the status code of response is 4xx
492
-     * @throws ServerResponseException if the status code of response is 5xx
493
-     *
494
-     * @return Elasticsearch|Promise
495
-     */
496
-    public function updatePipeline(array $params = [])
497
-    {
498
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
499
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_pipeline';
500
-        $method = 'PUT';
501
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
502
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
503
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
504
-    }
505
-    /**
506
-     * Updates the scheduling field in the connector document.
507
-     *
508
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html
509
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
510
-     *
511
-     * @param array{
512
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
513
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
514
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
515
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
516
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
517
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
518
-     *     body: array, // (REQUIRED) An object containing the connector's scheduling configuration.
519
-     * } $params
520
-     *
521
-     * @throws MissingParameterException if a required parameter is missing
522
-     * @throws NoNodeAvailableException if all the hosts are offline
523
-     * @throws ClientResponseException if the status code of response is 4xx
524
-     * @throws ServerResponseException if the status code of response is 5xx
525
-     *
526
-     * @return Elasticsearch|Promise
527
-     */
528
-    public function updateScheduling(array $params = [])
529
-    {
530
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
531
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_scheduling';
532
-        $method = 'PUT';
533
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
534
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
535
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
536
-    }
537
-    /**
538
-     * Updates the service type of the connector.
539
-     *
540
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html
541
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
542
-     *
543
-     * @param array{
544
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
545
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
546
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
547
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
548
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
549
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
550
-     *     body: array, // (REQUIRED) An object containing the connector's service type.
551
-     * } $params
552
-     *
553
-     * @throws MissingParameterException if a required parameter is missing
554
-     * @throws NoNodeAvailableException if all the hosts are offline
555
-     * @throws ClientResponseException if the status code of response is 4xx
556
-     * @throws ServerResponseException if the status code of response is 5xx
557
-     *
558
-     * @return Elasticsearch|Promise
559
-     */
560
-    public function updateServiceType(array $params = [])
561
-    {
562
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
563
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type';
564
-        $method = 'PUT';
565
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
566
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
567
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
568
-    }
569
-    /**
570
-     * Updates the status of the connector.
571
-     *
572
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html
573
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
574
-     *
575
-     * @param array{
576
-     *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
577
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
578
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
579
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
580
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
581
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
582
-     *     body: array, // (REQUIRED) An object containing the connector's status.
583
-     * } $params
584
-     *
585
-     * @throws MissingParameterException if a required parameter is missing
586
-     * @throws NoNodeAvailableException if all the hosts are offline
587
-     * @throws ClientResponseException if the status code of response is 4xx
588
-     * @throws ServerResponseException if the status code of response is 5xx
589
-     *
590
-     * @return Elasticsearch|Promise
591
-     */
592
-    public function updateStatus(array $params = [])
593
-    {
594
-        $this->checkRequiredParameters(['connector_id', 'body'], $params);
595
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_status';
596
-        $method = 'PUT';
597
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
598
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
599
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
600
-    }
28
+	/**
29
+	 * Updates the last_seen timestamp in the connector document.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html
32
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
33
+	 *
34
+	 * @param array{
35
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
36
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
37
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
38
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
39
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
40
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
41
+	 * } $params
42
+	 *
43
+	 * @throws MissingParameterException if a required parameter is missing
44
+	 * @throws NoNodeAvailableException if all the hosts are offline
45
+	 * @throws ClientResponseException if the status code of response is 4xx
46
+	 * @throws ServerResponseException if the status code of response is 5xx
47
+	 *
48
+	 * @return Elasticsearch|Promise
49
+	 */
50
+	public function checkIn(array $params = [])
51
+	{
52
+		$this->checkRequiredParameters(['connector_id'], $params);
53
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_check_in';
54
+		$method = 'PUT';
55
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
56
+		$headers = ['Accept' => 'application/json'];
57
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
58
+	}
59
+	/**
60
+	 * Deletes a connector.
61
+	 *
62
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html
63
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
64
+	 *
65
+	 * @param array{
66
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be deleted.
67
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
+	 * } $params
73
+	 *
74
+	 * @throws MissingParameterException if a required parameter is missing
75
+	 * @throws NoNodeAvailableException if all the hosts are offline
76
+	 * @throws ClientResponseException if the status code of response is 4xx
77
+	 * @throws ServerResponseException if the status code of response is 5xx
78
+	 *
79
+	 * @return Elasticsearch|Promise
80
+	 */
81
+	public function delete(array $params = [])
82
+	{
83
+		$this->checkRequiredParameters(['connector_id'], $params);
84
+		$url = '/_connector/' . $this->encode($params['connector_id']);
85
+		$method = 'DELETE';
86
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
+		$headers = ['Accept' => 'application/json'];
88
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
89
+	}
90
+	/**
91
+	 * Returns the details about a connector.
92
+	 *
93
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html
94
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
95
+	 *
96
+	 * @param array{
97
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be returned.
98
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
99
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
100
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
101
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
102
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
103
+	 * } $params
104
+	 *
105
+	 * @throws MissingParameterException if a required parameter is missing
106
+	 * @throws NoNodeAvailableException if all the hosts are offline
107
+	 * @throws ClientResponseException if the status code of response is 4xx
108
+	 * @throws ServerResponseException if the status code of response is 5xx
109
+	 *
110
+	 * @return Elasticsearch|Promise
111
+	 */
112
+	public function get(array $params = [])
113
+	{
114
+		$this->checkRequiredParameters(['connector_id'], $params);
115
+		$url = '/_connector/' . $this->encode($params['connector_id']);
116
+		$method = 'GET';
117
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
118
+		$headers = ['Accept' => 'application/json'];
119
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
120
+	}
121
+	/**
122
+	 * Updates the stats of last sync in the connector document.
123
+	 *
124
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html
125
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
126
+	 *
127
+	 * @param array{
128
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
129
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
130
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
131
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
132
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
133
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
134
+	 *     body: array, // (REQUIRED) Object with stats related to the last connector sync run.
135
+	 * } $params
136
+	 *
137
+	 * @throws MissingParameterException if a required parameter is missing
138
+	 * @throws NoNodeAvailableException if all the hosts are offline
139
+	 * @throws ClientResponseException if the status code of response is 4xx
140
+	 * @throws ServerResponseException if the status code of response is 5xx
141
+	 *
142
+	 * @return Elasticsearch|Promise
143
+	 */
144
+	public function lastSync(array $params = [])
145
+	{
146
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
147
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync';
148
+		$method = 'PUT';
149
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
150
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
151
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
152
+	}
153
+	/**
154
+	 * Lists all connectors.
155
+	 *
156
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html
157
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
158
+	 *
159
+	 * @param array{
160
+	 *     from: int, // Starting offset (default: 0)
161
+	 *     size: int, // Specifies a max number of results to get (default: 100)
162
+	 *     index_name: list, // A comma-separated list of connector index names to fetch connector documents for
163
+	 *     connector_name: list, // A comma-separated list of connector names to fetch connector documents for
164
+	 *     service_type: list, // A comma-separated list of connector service types to fetch connector documents for
165
+	 *     query: string, // A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names
166
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
167
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
168
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
169
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
170
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
171
+	 * } $params
172
+	 *
173
+	 * @throws NoNodeAvailableException if all the hosts are offline
174
+	 * @throws ClientResponseException if the status code of response is 4xx
175
+	 * @throws ServerResponseException if the status code of response is 5xx
176
+	 *
177
+	 * @return Elasticsearch|Promise
178
+	 */
179
+	public function list(array $params = [])
180
+	{
181
+		$url = '/_connector';
182
+		$method = 'GET';
183
+		$url = $this->addQueryString($url, $params, ['from', 'size', 'index_name', 'connector_name', 'service_type', 'query', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
184
+		$headers = ['Accept' => 'application/json'];
185
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
186
+	}
187
+	/**
188
+	 * Creates a connector.
189
+	 *
190
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html
191
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
192
+	 *
193
+	 * @param array{
194
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
195
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
196
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
197
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
198
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
199
+	 *     body: array, // (REQUIRED) The connector configuration.
200
+	 * } $params
201
+	 *
202
+	 * @throws NoNodeAvailableException if all the hosts are offline
203
+	 * @throws ClientResponseException if the status code of response is 4xx
204
+	 * @throws ServerResponseException if the status code of response is 5xx
205
+	 *
206
+	 * @return Elasticsearch|Promise
207
+	 */
208
+	public function post(array $params = [])
209
+	{
210
+		$this->checkRequiredParameters(['body'], $params);
211
+		$url = '/_connector';
212
+		$method = 'POST';
213
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
214
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
215
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
216
+	}
217
+	/**
218
+	 * Creates or updates a connector.
219
+	 *
220
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html
221
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
222
+	 *
223
+	 * @param array{
224
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be created or updated.
225
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
226
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
227
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
228
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
229
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
230
+	 *     body: array, // (REQUIRED) The connector configuration.
231
+	 * } $params
232
+	 *
233
+	 * @throws MissingParameterException if a required parameter is missing
234
+	 * @throws NoNodeAvailableException if all the hosts are offline
235
+	 * @throws ClientResponseException if the status code of response is 4xx
236
+	 * @throws ServerResponseException if the status code of response is 5xx
237
+	 *
238
+	 * @return Elasticsearch|Promise
239
+	 */
240
+	public function put(array $params = [])
241
+	{
242
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
243
+		$url = '/_connector/' . $this->encode($params['connector_id']);
244
+		$method = 'PUT';
245
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
246
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
247
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
248
+	}
249
+	/**
250
+	 * Updates the API key id and/or API key secret id fields in the connector document.
251
+	 *
252
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html
253
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
254
+	 *
255
+	 * @param array{
256
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
257
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
258
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
259
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
260
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
261
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
262
+	 *     body: array, // (REQUIRED) An object containing the connector's API key id and/or Connector Secret document id for that API key.
263
+	 * } $params
264
+	 *
265
+	 * @throws MissingParameterException if a required parameter is missing
266
+	 * @throws NoNodeAvailableException if all the hosts are offline
267
+	 * @throws ClientResponseException if the status code of response is 4xx
268
+	 * @throws ServerResponseException if the status code of response is 5xx
269
+	 *
270
+	 * @return Elasticsearch|Promise
271
+	 */
272
+	public function updateApiKeyId(array $params = [])
273
+	{
274
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
275
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id';
276
+		$method = 'PUT';
277
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
278
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
279
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
280
+	}
281
+	/**
282
+	 * Updates the connector configuration.
283
+	 *
284
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html
285
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
286
+	 *
287
+	 * @param array{
288
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
289
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
290
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
291
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
292
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
293
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
294
+	 *     body: array, // (REQUIRED) Mapping between field names to configuration.
295
+	 * } $params
296
+	 *
297
+	 * @throws MissingParameterException if a required parameter is missing
298
+	 * @throws NoNodeAvailableException if all the hosts are offline
299
+	 * @throws ClientResponseException if the status code of response is 4xx
300
+	 * @throws ServerResponseException if the status code of response is 5xx
301
+	 *
302
+	 * @return Elasticsearch|Promise
303
+	 */
304
+	public function updateConfiguration(array $params = [])
305
+	{
306
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
307
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_configuration';
308
+		$method = 'PUT';
309
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
310
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
311
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
312
+	}
313
+	/**
314
+	 * Updates the error field in the connector document.
315
+	 *
316
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html
317
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
318
+	 *
319
+	 * @param array{
320
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
321
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
322
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
323
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
324
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
325
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
326
+	 *     body: array, // (REQUIRED) An object containing the connector's error.
327
+	 * } $params
328
+	 *
329
+	 * @throws MissingParameterException if a required parameter is missing
330
+	 * @throws NoNodeAvailableException if all the hosts are offline
331
+	 * @throws ClientResponseException if the status code of response is 4xx
332
+	 * @throws ServerResponseException if the status code of response is 5xx
333
+	 *
334
+	 * @return Elasticsearch|Promise
335
+	 */
336
+	public function updateError(array $params = [])
337
+	{
338
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
339
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_error';
340
+		$method = 'PUT';
341
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
342
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
343
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
344
+	}
345
+	/**
346
+	 * Updates the filtering field in the connector document.
347
+	 *
348
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html
349
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
350
+	 *
351
+	 * @param array{
352
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
353
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
354
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
355
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
356
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
357
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
358
+	 *     body: array, // (REQUIRED) A list of connector filtering configurations.
359
+	 * } $params
360
+	 *
361
+	 * @throws MissingParameterException if a required parameter is missing
362
+	 * @throws NoNodeAvailableException if all the hosts are offline
363
+	 * @throws ClientResponseException if the status code of response is 4xx
364
+	 * @throws ServerResponseException if the status code of response is 5xx
365
+	 *
366
+	 * @return Elasticsearch|Promise
367
+	 */
368
+	public function updateFiltering(array $params = [])
369
+	{
370
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
371
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering';
372
+		$method = 'PUT';
373
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
374
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
375
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
376
+	}
377
+	/**
378
+	 * Updates the index name of the connector.
379
+	 *
380
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html
381
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
382
+	 *
383
+	 * @param array{
384
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
385
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
386
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
387
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
388
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
389
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
390
+	 *     body: array, // (REQUIRED) An object containing the connector's index name.
391
+	 * } $params
392
+	 *
393
+	 * @throws MissingParameterException if a required parameter is missing
394
+	 * @throws NoNodeAvailableException if all the hosts are offline
395
+	 * @throws ClientResponseException if the status code of response is 4xx
396
+	 * @throws ServerResponseException if the status code of response is 5xx
397
+	 *
398
+	 * @return Elasticsearch|Promise
399
+	 */
400
+	public function updateIndexName(array $params = [])
401
+	{
402
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
403
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name';
404
+		$method = 'PUT';
405
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
406
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
407
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
408
+	}
409
+	/**
410
+	 * Updates the name and/or description fields in the connector document.
411
+	 *
412
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html
413
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
414
+	 *
415
+	 * @param array{
416
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
417
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
418
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
419
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
420
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
421
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
422
+	 *     body: array, // (REQUIRED) An object containing the connector's name and/or description.
423
+	 * } $params
424
+	 *
425
+	 * @throws MissingParameterException if a required parameter is missing
426
+	 * @throws NoNodeAvailableException if all the hosts are offline
427
+	 * @throws ClientResponseException if the status code of response is 4xx
428
+	 * @throws ServerResponseException if the status code of response is 5xx
429
+	 *
430
+	 * @return Elasticsearch|Promise
431
+	 */
432
+	public function updateName(array $params = [])
433
+	{
434
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
435
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_name';
436
+		$method = 'PUT';
437
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
438
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
439
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
440
+	}
441
+	/**
442
+	 * Updates the is_native flag of the connector.
443
+	 *
444
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html
445
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
446
+	 *
447
+	 * @param array{
448
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
449
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
450
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
451
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
452
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
453
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
454
+	 *     body: array, // (REQUIRED) An object containing the connector's is_native flag
455
+	 * } $params
456
+	 *
457
+	 * @throws MissingParameterException if a required parameter is missing
458
+	 * @throws NoNodeAvailableException if all the hosts are offline
459
+	 * @throws ClientResponseException if the status code of response is 4xx
460
+	 * @throws ServerResponseException if the status code of response is 5xx
461
+	 *
462
+	 * @return Elasticsearch|Promise
463
+	 */
464
+	public function updateNative(array $params = [])
465
+	{
466
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
467
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_native';
468
+		$method = 'PUT';
469
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
470
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
471
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
472
+	}
473
+	/**
474
+	 * Updates the pipeline field in the connector document.
475
+	 *
476
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html
477
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
478
+	 *
479
+	 * @param array{
480
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
481
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
482
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
483
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
484
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
485
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
486
+	 *     body: array, // (REQUIRED) An object with connector ingest pipeline configuration.
487
+	 * } $params
488
+	 *
489
+	 * @throws MissingParameterException if a required parameter is missing
490
+	 * @throws NoNodeAvailableException if all the hosts are offline
491
+	 * @throws ClientResponseException if the status code of response is 4xx
492
+	 * @throws ServerResponseException if the status code of response is 5xx
493
+	 *
494
+	 * @return Elasticsearch|Promise
495
+	 */
496
+	public function updatePipeline(array $params = [])
497
+	{
498
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
499
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_pipeline';
500
+		$method = 'PUT';
501
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
502
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
503
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
504
+	}
505
+	/**
506
+	 * Updates the scheduling field in the connector document.
507
+	 *
508
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html
509
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
510
+	 *
511
+	 * @param array{
512
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
513
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
514
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
515
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
516
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
517
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
518
+	 *     body: array, // (REQUIRED) An object containing the connector's scheduling configuration.
519
+	 * } $params
520
+	 *
521
+	 * @throws MissingParameterException if a required parameter is missing
522
+	 * @throws NoNodeAvailableException if all the hosts are offline
523
+	 * @throws ClientResponseException if the status code of response is 4xx
524
+	 * @throws ServerResponseException if the status code of response is 5xx
525
+	 *
526
+	 * @return Elasticsearch|Promise
527
+	 */
528
+	public function updateScheduling(array $params = [])
529
+	{
530
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
531
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_scheduling';
532
+		$method = 'PUT';
533
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
534
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
535
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
536
+	}
537
+	/**
538
+	 * Updates the service type of the connector.
539
+	 *
540
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html
541
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
542
+	 *
543
+	 * @param array{
544
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
545
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
546
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
547
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
548
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
549
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
550
+	 *     body: array, // (REQUIRED) An object containing the connector's service type.
551
+	 * } $params
552
+	 *
553
+	 * @throws MissingParameterException if a required parameter is missing
554
+	 * @throws NoNodeAvailableException if all the hosts are offline
555
+	 * @throws ClientResponseException if the status code of response is 4xx
556
+	 * @throws ServerResponseException if the status code of response is 5xx
557
+	 *
558
+	 * @return Elasticsearch|Promise
559
+	 */
560
+	public function updateServiceType(array $params = [])
561
+	{
562
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
563
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type';
564
+		$method = 'PUT';
565
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
566
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
567
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
568
+	}
569
+	/**
570
+	 * Updates the status of the connector.
571
+	 *
572
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html
573
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
574
+	 *
575
+	 * @param array{
576
+	 *     connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
577
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
578
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
579
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
580
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
581
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
582
+	 *     body: array, // (REQUIRED) An object containing the connector's status.
583
+	 * } $params
584
+	 *
585
+	 * @throws MissingParameterException if a required parameter is missing
586
+	 * @throws NoNodeAvailableException if all the hosts are offline
587
+	 * @throws ClientResponseException if the status code of response is 4xx
588
+	 * @throws ServerResponseException if the status code of response is 5xx
589
+	 *
590
+	 * @return Elasticsearch|Promise
591
+	 */
592
+	public function updateStatus(array $params = [])
593
+	{
594
+		$this->checkRequiredParameters(['connector_id', 'body'], $params);
595
+		$url = '/_connector/' . $this->encode($params['connector_id']) . '/_status';
596
+		$method = 'PUT';
597
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
598
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
599
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
600
+	}
601 601
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function checkIn(array $params = [])
51 51
     {
52 52
         $this->checkRequiredParameters(['connector_id'], $params);
53
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_check_in';
53
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_check_in';
54 54
         $method = 'PUT';
55 55
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
56 56
         $headers = ['Accept' => 'application/json'];
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function delete(array $params = [])
82 82
     {
83 83
         $this->checkRequiredParameters(['connector_id'], $params);
84
-        $url = '/_connector/' . $this->encode($params['connector_id']);
84
+        $url = '/_connector/'.$this->encode($params['connector_id']);
85 85
         $method = 'DELETE';
86 86
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87 87
         $headers = ['Accept' => 'application/json'];
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function get(array $params = [])
113 113
     {
114 114
         $this->checkRequiredParameters(['connector_id'], $params);
115
-        $url = '/_connector/' . $this->encode($params['connector_id']);
115
+        $url = '/_connector/'.$this->encode($params['connector_id']);
116 116
         $method = 'GET';
117 117
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
118 118
         $headers = ['Accept' => 'application/json'];
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     public function lastSync(array $params = [])
145 145
     {
146 146
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
147
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync';
147
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_last_sync';
148 148
         $method = 'PUT';
149 149
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
150 150
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     public function put(array $params = [])
241 241
     {
242 242
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
243
-        $url = '/_connector/' . $this->encode($params['connector_id']);
243
+        $url = '/_connector/'.$this->encode($params['connector_id']);
244 244
         $method = 'PUT';
245 245
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
246 246
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     public function updateApiKeyId(array $params = [])
273 273
     {
274 274
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
275
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id';
275
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_api_key_id';
276 276
         $method = 'PUT';
277 277
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
278 278
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     public function updateConfiguration(array $params = [])
305 305
     {
306 306
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
307
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_configuration';
307
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_configuration';
308 308
         $method = 'PUT';
309 309
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
310 310
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     public function updateError(array $params = [])
337 337
     {
338 338
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
339
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_error';
339
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_error';
340 340
         $method = 'PUT';
341 341
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
342 342
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     public function updateFiltering(array $params = [])
369 369
     {
370 370
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
371
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering';
371
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_filtering';
372 372
         $method = 'PUT';
373 373
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
374 374
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
     public function updateIndexName(array $params = [])
401 401
     {
402 402
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
403
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name';
403
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_index_name';
404 404
         $method = 'PUT';
405 405
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
406 406
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
     public function updateName(array $params = [])
433 433
     {
434 434
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
435
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_name';
435
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_name';
436 436
         $method = 'PUT';
437 437
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
438 438
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
     public function updateNative(array $params = [])
465 465
     {
466 466
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
467
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_native';
467
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_native';
468 468
         $method = 'PUT';
469 469
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
470 470
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
     public function updatePipeline(array $params = [])
497 497
     {
498 498
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
499
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_pipeline';
499
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_pipeline';
500 500
         $method = 'PUT';
501 501
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
502 502
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     public function updateScheduling(array $params = [])
529 529
     {
530 530
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
531
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_scheduling';
531
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_scheduling';
532 532
         $method = 'PUT';
533 533
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
534 534
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
     public function updateServiceType(array $params = [])
561 561
     {
562 562
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
563
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type';
563
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_service_type';
564 564
         $method = 'PUT';
565 565
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
566 566
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
     public function updateStatus(array $params = [])
593 593
     {
594 594
         $this->checkRequiredParameters(['connector_id', 'body'], $params);
595
-        $url = '/_connector/' . $this->encode($params['connector_id']) . '/_status';
595
+        $url = '/_connector/'.$this->encode($params['connector_id']).'/_status';
596 596
         $method = 'PUT';
597 597
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
598 598
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Connector extends AbstractEndpoint
27
-{
26
+class Connector extends AbstractEndpoint {
28 27
     /**
29 28
      * Updates the last_seen timestamp in the connector document.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Ingest.php 3 patches
Indentation   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -25,195 +25,195 @@
 block discarded – undo
25 25
  */
26 26
 class Ingest extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Deletes a pipeline.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html
32
-     *
33
-     * @param array{
34
-     *     id: string, // (REQUIRED) Pipeline ID
35
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
36
-     *     timeout: time, // Explicit operation timeout
37
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
38
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
39
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
40
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
41
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
42
-     * } $params
43
-     *
44
-     * @throws MissingParameterException if a required parameter is missing
45
-     * @throws NoNodeAvailableException if all the hosts are offline
46
-     * @throws ClientResponseException if the status code of response is 4xx
47
-     * @throws ServerResponseException if the status code of response is 5xx
48
-     *
49
-     * @return Elasticsearch|Promise
50
-     */
51
-    public function deletePipeline(array $params = [])
52
-    {
53
-        $this->checkRequiredParameters(['id'], $params);
54
-        $url = '/_ingest/pipeline/' . $this->encode($params['id']);
55
-        $method = 'DELETE';
56
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
57
-        $headers = ['Accept' => 'application/json'];
58
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
59
-    }
60
-    /**
61
-     * Returns statistical information about geoip databases
62
-     *
63
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html
64
-     *
65
-     * @param array{
66
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
67
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
68
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
69
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
70
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
71
-     * } $params
72
-     *
73
-     * @throws NoNodeAvailableException if all the hosts are offline
74
-     * @throws ClientResponseException if the status code of response is 4xx
75
-     * @throws ServerResponseException if the status code of response is 5xx
76
-     *
77
-     * @return Elasticsearch|Promise
78
-     */
79
-    public function geoIpStats(array $params = [])
80
-    {
81
-        $url = '/_ingest/geoip/stats';
82
-        $method = 'GET';
83
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
84
-        $headers = ['Accept' => 'application/json'];
85
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
86
-    }
87
-    /**
88
-     * Returns a pipeline.
89
-     *
90
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html
91
-     *
92
-     * @param array{
93
-     *     id: string, //  Comma separated list of pipeline ids. Wildcards supported
94
-     *     summary: boolean, // Return pipelines without their definitions (default: false)
95
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
96
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
97
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
98
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
99
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
100
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
101
-     * } $params
102
-     *
103
-     * @throws NoNodeAvailableException if all the hosts are offline
104
-     * @throws ClientResponseException if the status code of response is 4xx
105
-     * @throws ServerResponseException if the status code of response is 5xx
106
-     *
107
-     * @return Elasticsearch|Promise
108
-     */
109
-    public function getPipeline(array $params = [])
110
-    {
111
-        if (isset($params['id'])) {
112
-            $url = '/_ingest/pipeline/' . $this->encode($params['id']);
113
-            $method = 'GET';
114
-        } else {
115
-            $url = '/_ingest/pipeline';
116
-            $method = 'GET';
117
-        }
118
-        $url = $this->addQueryString($url, $params, ['summary', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
119
-        $headers = ['Accept' => 'application/json'];
120
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
121
-    }
122
-    /**
123
-     * Returns a list of the built-in patterns.
124
-     *
125
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get
126
-     *
127
-     * @param array{
128
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
129
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
130
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
131
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
132
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
133
-     * } $params
134
-     *
135
-     * @throws NoNodeAvailableException if all the hosts are offline
136
-     * @throws ClientResponseException if the status code of response is 4xx
137
-     * @throws ServerResponseException if the status code of response is 5xx
138
-     *
139
-     * @return Elasticsearch|Promise
140
-     */
141
-    public function processorGrok(array $params = [])
142
-    {
143
-        $url = '/_ingest/processor/grok';
144
-        $method = 'GET';
145
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
146
-        $headers = ['Accept' => 'application/json'];
147
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
148
-    }
149
-    /**
150
-     * Creates or updates a pipeline.
151
-     *
152
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html
153
-     *
154
-     * @param array{
155
-     *     id: string, // (REQUIRED) Pipeline ID
156
-     *     if_version: int, // Required version for optimistic concurrency control for pipeline updates
157
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
158
-     *     timeout: time, // Explicit operation timeout
159
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
160
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
161
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
162
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
163
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
164
-     *     body: array, // (REQUIRED) The ingest definition
165
-     * } $params
166
-     *
167
-     * @throws MissingParameterException if a required parameter is missing
168
-     * @throws NoNodeAvailableException if all the hosts are offline
169
-     * @throws ClientResponseException if the status code of response is 4xx
170
-     * @throws ServerResponseException if the status code of response is 5xx
171
-     *
172
-     * @return Elasticsearch|Promise
173
-     */
174
-    public function putPipeline(array $params = [])
175
-    {
176
-        $this->checkRequiredParameters(['id', 'body'], $params);
177
-        $url = '/_ingest/pipeline/' . $this->encode($params['id']);
178
-        $method = 'PUT';
179
-        $url = $this->addQueryString($url, $params, ['if_version', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
180
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
181
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
182
-    }
183
-    /**
184
-     * Allows to simulate a pipeline with example documents.
185
-     *
186
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html
187
-     *
188
-     * @param array{
189
-     *     id: string, //  Pipeline ID
190
-     *     verbose: boolean, // Verbose mode. Display data output for each processor in executed pipeline
191
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
192
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
193
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
194
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
195
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
196
-     *     body: array, // (REQUIRED) The simulate definition
197
-     * } $params
198
-     *
199
-     * @throws NoNodeAvailableException if all the hosts are offline
200
-     * @throws ClientResponseException if the status code of response is 4xx
201
-     * @throws ServerResponseException if the status code of response is 5xx
202
-     *
203
-     * @return Elasticsearch|Promise
204
-     */
205
-    public function simulate(array $params = [])
206
-    {
207
-        $this->checkRequiredParameters(['body'], $params);
208
-        if (isset($params['id'])) {
209
-            $url = '/_ingest/pipeline/' . $this->encode($params['id']) . '/_simulate';
210
-            $method = empty($params['body']) ? 'GET' : 'POST';
211
-        } else {
212
-            $url = '/_ingest/pipeline/_simulate';
213
-            $method = empty($params['body']) ? 'GET' : 'POST';
214
-        }
215
-        $url = $this->addQueryString($url, $params, ['verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
216
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
217
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
218
-    }
28
+	/**
29
+	 * Deletes a pipeline.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html
32
+	 *
33
+	 * @param array{
34
+	 *     id: string, // (REQUIRED) Pipeline ID
35
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
36
+	 *     timeout: time, // Explicit operation timeout
37
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
38
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
39
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
40
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
41
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
42
+	 * } $params
43
+	 *
44
+	 * @throws MissingParameterException if a required parameter is missing
45
+	 * @throws NoNodeAvailableException if all the hosts are offline
46
+	 * @throws ClientResponseException if the status code of response is 4xx
47
+	 * @throws ServerResponseException if the status code of response is 5xx
48
+	 *
49
+	 * @return Elasticsearch|Promise
50
+	 */
51
+	public function deletePipeline(array $params = [])
52
+	{
53
+		$this->checkRequiredParameters(['id'], $params);
54
+		$url = '/_ingest/pipeline/' . $this->encode($params['id']);
55
+		$method = 'DELETE';
56
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
57
+		$headers = ['Accept' => 'application/json'];
58
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
59
+	}
60
+	/**
61
+	 * Returns statistical information about geoip databases
62
+	 *
63
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html
64
+	 *
65
+	 * @param array{
66
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
67
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
68
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
69
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
70
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
71
+	 * } $params
72
+	 *
73
+	 * @throws NoNodeAvailableException if all the hosts are offline
74
+	 * @throws ClientResponseException if the status code of response is 4xx
75
+	 * @throws ServerResponseException if the status code of response is 5xx
76
+	 *
77
+	 * @return Elasticsearch|Promise
78
+	 */
79
+	public function geoIpStats(array $params = [])
80
+	{
81
+		$url = '/_ingest/geoip/stats';
82
+		$method = 'GET';
83
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
84
+		$headers = ['Accept' => 'application/json'];
85
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
86
+	}
87
+	/**
88
+	 * Returns a pipeline.
89
+	 *
90
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html
91
+	 *
92
+	 * @param array{
93
+	 *     id: string, //  Comma separated list of pipeline ids. Wildcards supported
94
+	 *     summary: boolean, // Return pipelines without their definitions (default: false)
95
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
96
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
97
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
98
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
99
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
100
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
101
+	 * } $params
102
+	 *
103
+	 * @throws NoNodeAvailableException if all the hosts are offline
104
+	 * @throws ClientResponseException if the status code of response is 4xx
105
+	 * @throws ServerResponseException if the status code of response is 5xx
106
+	 *
107
+	 * @return Elasticsearch|Promise
108
+	 */
109
+	public function getPipeline(array $params = [])
110
+	{
111
+		if (isset($params['id'])) {
112
+			$url = '/_ingest/pipeline/' . $this->encode($params['id']);
113
+			$method = 'GET';
114
+		} else {
115
+			$url = '/_ingest/pipeline';
116
+			$method = 'GET';
117
+		}
118
+		$url = $this->addQueryString($url, $params, ['summary', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
119
+		$headers = ['Accept' => 'application/json'];
120
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
121
+	}
122
+	/**
123
+	 * Returns a list of the built-in patterns.
124
+	 *
125
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get
126
+	 *
127
+	 * @param array{
128
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
129
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
130
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
131
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
132
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
133
+	 * } $params
134
+	 *
135
+	 * @throws NoNodeAvailableException if all the hosts are offline
136
+	 * @throws ClientResponseException if the status code of response is 4xx
137
+	 * @throws ServerResponseException if the status code of response is 5xx
138
+	 *
139
+	 * @return Elasticsearch|Promise
140
+	 */
141
+	public function processorGrok(array $params = [])
142
+	{
143
+		$url = '/_ingest/processor/grok';
144
+		$method = 'GET';
145
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
146
+		$headers = ['Accept' => 'application/json'];
147
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
148
+	}
149
+	/**
150
+	 * Creates or updates a pipeline.
151
+	 *
152
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html
153
+	 *
154
+	 * @param array{
155
+	 *     id: string, // (REQUIRED) Pipeline ID
156
+	 *     if_version: int, // Required version for optimistic concurrency control for pipeline updates
157
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
158
+	 *     timeout: time, // Explicit operation timeout
159
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
160
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
161
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
162
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
163
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
164
+	 *     body: array, // (REQUIRED) The ingest definition
165
+	 * } $params
166
+	 *
167
+	 * @throws MissingParameterException if a required parameter is missing
168
+	 * @throws NoNodeAvailableException if all the hosts are offline
169
+	 * @throws ClientResponseException if the status code of response is 4xx
170
+	 * @throws ServerResponseException if the status code of response is 5xx
171
+	 *
172
+	 * @return Elasticsearch|Promise
173
+	 */
174
+	public function putPipeline(array $params = [])
175
+	{
176
+		$this->checkRequiredParameters(['id', 'body'], $params);
177
+		$url = '/_ingest/pipeline/' . $this->encode($params['id']);
178
+		$method = 'PUT';
179
+		$url = $this->addQueryString($url, $params, ['if_version', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
180
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
181
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
182
+	}
183
+	/**
184
+	 * Allows to simulate a pipeline with example documents.
185
+	 *
186
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html
187
+	 *
188
+	 * @param array{
189
+	 *     id: string, //  Pipeline ID
190
+	 *     verbose: boolean, // Verbose mode. Display data output for each processor in executed pipeline
191
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
192
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
193
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
194
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
195
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
196
+	 *     body: array, // (REQUIRED) The simulate definition
197
+	 * } $params
198
+	 *
199
+	 * @throws NoNodeAvailableException if all the hosts are offline
200
+	 * @throws ClientResponseException if the status code of response is 4xx
201
+	 * @throws ServerResponseException if the status code of response is 5xx
202
+	 *
203
+	 * @return Elasticsearch|Promise
204
+	 */
205
+	public function simulate(array $params = [])
206
+	{
207
+		$this->checkRequiredParameters(['body'], $params);
208
+		if (isset($params['id'])) {
209
+			$url = '/_ingest/pipeline/' . $this->encode($params['id']) . '/_simulate';
210
+			$method = empty($params['body']) ? 'GET' : 'POST';
211
+		} else {
212
+			$url = '/_ingest/pipeline/_simulate';
213
+			$method = empty($params['body']) ? 'GET' : 'POST';
214
+		}
215
+		$url = $this->addQueryString($url, $params, ['verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
216
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
217
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
218
+	}
219 219
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public function deletePipeline(array $params = [])
52 52
     {
53 53
         $this->checkRequiredParameters(['id'], $params);
54
-        $url = '/_ingest/pipeline/' . $this->encode($params['id']);
54
+        $url = '/_ingest/pipeline/'.$this->encode($params['id']);
55 55
         $method = 'DELETE';
56 56
         $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
57 57
         $headers = ['Accept' => 'application/json'];
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     public function getPipeline(array $params = [])
110 110
     {
111 111
         if (isset($params['id'])) {
112
-            $url = '/_ingest/pipeline/' . $this->encode($params['id']);
112
+            $url = '/_ingest/pipeline/'.$this->encode($params['id']);
113 113
             $method = 'GET';
114 114
         } else {
115 115
             $url = '/_ingest/pipeline';
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     public function putPipeline(array $params = [])
175 175
     {
176 176
         $this->checkRequiredParameters(['id', 'body'], $params);
177
-        $url = '/_ingest/pipeline/' . $this->encode($params['id']);
177
+        $url = '/_ingest/pipeline/'.$this->encode($params['id']);
178 178
         $method = 'PUT';
179 179
         $url = $this->addQueryString($url, $params, ['if_version', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
180 180
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     {
207 207
         $this->checkRequiredParameters(['body'], $params);
208 208
         if (isset($params['id'])) {
209
-            $url = '/_ingest/pipeline/' . $this->encode($params['id']) . '/_simulate';
209
+            $url = '/_ingest/pipeline/'.$this->encode($params['id']).'/_simulate';
210 210
             $method = empty($params['body']) ? 'GET' : 'POST';
211 211
         } else {
212 212
             $url = '/_ingest/pipeline/_simulate';
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Ingest extends AbstractEndpoint
27
-{
26
+class Ingest extends AbstractEndpoint {
28 27
     /**
29 28
      * Deletes a pipeline.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Cluster.php 3 patches
Indentation   +532 added lines, -532 removed lines patch added patch discarded remove patch
@@ -25,536 +25,536 @@
 block discarded – undo
25 25
  */
26 26
 class Cluster extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Provides explanations for shard allocations in the cluster.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html
32
-     *
33
-     * @param array{
34
-     *     include_yes_decisions: boolean, // Return 'YES' decisions in explanation (default: false)
35
-     *     include_disk_info: boolean, // Return information about disk usage and shard sizes (default: false)
36
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
37
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
38
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
39
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
40
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
41
-     *     body: array, //  The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard'
42
-     * } $params
43
-     *
44
-     * @throws NoNodeAvailableException if all the hosts are offline
45
-     * @throws ClientResponseException if the status code of response is 4xx
46
-     * @throws ServerResponseException if the status code of response is 5xx
47
-     *
48
-     * @return Elasticsearch|Promise
49
-     */
50
-    public function allocationExplain(array $params = [])
51
-    {
52
-        $url = '/_cluster/allocation/explain';
53
-        $method = empty($params['body']) ? 'GET' : 'POST';
54
-        $url = $this->addQueryString($url, $params, ['include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
56
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
57
-    }
58
-    /**
59
-     * Deletes a component template
60
-     *
61
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
62
-     *
63
-     * @param array{
64
-     *     name: string, // (REQUIRED) The name of the template
65
-     *     timeout: time, // Explicit operation timeout
66
-     *     master_timeout: time, // Specify timeout for connection to master
67
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
-     * } $params
73
-     *
74
-     * @throws MissingParameterException if a required parameter is missing
75
-     * @throws NoNodeAvailableException if all the hosts are offline
76
-     * @throws ClientResponseException if the status code of response is 4xx
77
-     * @throws ServerResponseException if the status code of response is 5xx
78
-     *
79
-     * @return Elasticsearch|Promise
80
-     */
81
-    public function deleteComponentTemplate(array $params = [])
82
-    {
83
-        $this->checkRequiredParameters(['name'], $params);
84
-        $url = '/_component_template/' . $this->encode($params['name']);
85
-        $method = 'DELETE';
86
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
-        $headers = ['Accept' => 'application/json'];
88
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
89
-    }
90
-    /**
91
-     * Clears cluster voting config exclusions.
92
-     *
93
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
94
-     *
95
-     * @param array{
96
-     *     wait_for_removal: boolean, // Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.
97
-     *     master_timeout: time, // Timeout for submitting request to master
98
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
99
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
100
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
101
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
102
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
103
-     * } $params
104
-     *
105
-     * @throws NoNodeAvailableException if all the hosts are offline
106
-     * @throws ClientResponseException if the status code of response is 4xx
107
-     * @throws ServerResponseException if the status code of response is 5xx
108
-     *
109
-     * @return Elasticsearch|Promise
110
-     */
111
-    public function deleteVotingConfigExclusions(array $params = [])
112
-    {
113
-        $url = '/_cluster/voting_config_exclusions';
114
-        $method = 'DELETE';
115
-        $url = $this->addQueryString($url, $params, ['wait_for_removal', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
116
-        $headers = ['Accept' => 'application/json'];
117
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
118
-    }
119
-    /**
120
-     * Returns information about whether a particular component template exist
121
-     *
122
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
123
-     *
124
-     * @param array{
125
-     *     name: string, // (REQUIRED) The name of the template
126
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
127
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
128
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
129
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
130
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
131
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
132
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
133
-     * } $params
134
-     *
135
-     * @throws MissingParameterException if a required parameter is missing
136
-     * @throws NoNodeAvailableException if all the hosts are offline
137
-     * @throws ClientResponseException if the status code of response is 4xx
138
-     * @throws ServerResponseException if the status code of response is 5xx
139
-     *
140
-     * @return Elasticsearch|Promise
141
-     */
142
-    public function existsComponentTemplate(array $params = [])
143
-    {
144
-        $this->checkRequiredParameters(['name'], $params);
145
-        $url = '/_component_template/' . $this->encode($params['name']);
146
-        $method = 'HEAD';
147
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
148
-        $headers = ['Accept' => 'application/json'];
149
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
150
-    }
151
-    /**
152
-     * Returns one or more component templates
153
-     *
154
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
155
-     *
156
-     * @param array{
157
-     *     name: list, //  The comma separated names of the component templates
158
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
159
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
160
-     *     include_defaults: boolean, // Return all default configurations for the component template (default: false)
161
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
162
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
163
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
164
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
165
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
166
-     * } $params
167
-     *
168
-     * @throws NoNodeAvailableException if all the hosts are offline
169
-     * @throws ClientResponseException if the status code of response is 4xx
170
-     * @throws ServerResponseException if the status code of response is 5xx
171
-     *
172
-     * @return Elasticsearch|Promise
173
-     */
174
-    public function getComponentTemplate(array $params = [])
175
-    {
176
-        if (isset($params['name'])) {
177
-            $url = '/_component_template/' . $this->encode($params['name']);
178
-            $method = 'GET';
179
-        } else {
180
-            $url = '/_component_template';
181
-            $method = 'GET';
182
-        }
183
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
184
-        $headers = ['Accept' => 'application/json'];
185
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
186
-    }
187
-    /**
188
-     * Returns cluster settings.
189
-     *
190
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html
191
-     *
192
-     * @param array{
193
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
194
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
195
-     *     timeout: time, // Explicit operation timeout
196
-     *     include_defaults: boolean, // Whether to return all default clusters setting.
197
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
198
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
199
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
200
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
201
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
202
-     * } $params
203
-     *
204
-     * @throws NoNodeAvailableException if all the hosts are offline
205
-     * @throws ClientResponseException if the status code of response is 4xx
206
-     * @throws ServerResponseException if the status code of response is 5xx
207
-     *
208
-     * @return Elasticsearch|Promise
209
-     */
210
-    public function getSettings(array $params = [])
211
-    {
212
-        $url = '/_cluster/settings';
213
-        $method = 'GET';
214
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
215
-        $headers = ['Accept' => 'application/json'];
216
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
217
-    }
218
-    /**
219
-     * Returns basic information about the health of the cluster.
220
-     *
221
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html
222
-     *
223
-     * @param array{
224
-     *     index: list, //  Limit the information returned to a specific index
225
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
226
-     *     level: enum, // Specify the level of detail for returned information
227
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
228
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
229
-     *     timeout: time, // Explicit operation timeout
230
-     *     wait_for_active_shards: string, // Wait until the specified number of shards is active
231
-     *     wait_for_nodes: string, // Wait until the specified number of nodes is available
232
-     *     wait_for_events: enum, // Wait until all currently queued events with the given priority are processed
233
-     *     wait_for_no_relocating_shards: boolean, // Whether to wait until there are no relocating shards in the cluster
234
-     *     wait_for_no_initializing_shards: boolean, // Whether to wait until there are no initializing shards in the cluster
235
-     *     wait_for_status: enum, // Wait until cluster is in a specific state
236
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
237
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
238
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
239
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
240
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
241
-     * } $params
242
-     *
243
-     * @throws NoNodeAvailableException if all the hosts are offline
244
-     * @throws ClientResponseException if the status code of response is 4xx
245
-     * @throws ServerResponseException if the status code of response is 5xx
246
-     *
247
-     * @return Elasticsearch|Promise
248
-     */
249
-    public function health(array $params = [])
250
-    {
251
-        if (isset($params['index'])) {
252
-            $url = '/_cluster/health/' . $this->encode($params['index']);
253
-            $method = 'GET';
254
-        } else {
255
-            $url = '/_cluster/health';
256
-            $method = 'GET';
257
-        }
258
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'level', 'local', 'master_timeout', 'timeout', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
259
-        $headers = ['Accept' => 'application/json'];
260
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
261
-    }
262
-    /**
263
-     * Returns different information about the cluster.
264
-     *
265
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html
266
-     *
267
-     * @param array{
268
-     *     target: list, // (REQUIRED) Limit the information returned to the specified target.
269
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
270
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
271
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
272
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
273
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
274
-     * } $params
275
-     *
276
-     * @throws MissingParameterException if a required parameter is missing
277
-     * @throws NoNodeAvailableException if all the hosts are offline
278
-     * @throws ClientResponseException if the status code of response is 4xx
279
-     * @throws ServerResponseException if the status code of response is 5xx
280
-     *
281
-     * @return Elasticsearch|Promise
282
-     */
283
-    public function info(array $params = [])
284
-    {
285
-        $this->checkRequiredParameters(['target'], $params);
286
-        $url = '/_info/' . $this->encode($params['target']);
287
-        $method = 'GET';
288
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
289
-        $headers = ['Accept' => 'application/json'];
290
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
291
-    }
292
-    /**
293
-     * Returns a list of any cluster-level changes (e.g. create index, update mapping,
294
-     * allocate or fail shard) which have not yet been executed.
295
-     *
296
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html
297
-     *
298
-     * @param array{
299
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
300
-     *     master_timeout: time, // Specify timeout for connection to master
301
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
302
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
303
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
304
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
305
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
306
-     * } $params
307
-     *
308
-     * @throws NoNodeAvailableException if all the hosts are offline
309
-     * @throws ClientResponseException if the status code of response is 4xx
310
-     * @throws ServerResponseException if the status code of response is 5xx
311
-     *
312
-     * @return Elasticsearch|Promise
313
-     */
314
-    public function pendingTasks(array $params = [])
315
-    {
316
-        $url = '/_cluster/pending_tasks';
317
-        $method = 'GET';
318
-        $url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
319
-        $headers = ['Accept' => 'application/json'];
320
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
321
-    }
322
-    /**
323
-     * Updates the cluster voting config exclusions by node ids or node names.
324
-     *
325
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
326
-     *
327
-     * @param array{
328
-     *     node_ids: string, // A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names.
329
-     *     node_names: string, // A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids.
330
-     *     timeout: time, // Explicit operation timeout
331
-     *     master_timeout: time, // Timeout for submitting request to master
332
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
333
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
334
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
335
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
336
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
337
-     * } $params
338
-     *
339
-     * @throws NoNodeAvailableException if all the hosts are offline
340
-     * @throws ClientResponseException if the status code of response is 4xx
341
-     * @throws ServerResponseException if the status code of response is 5xx
342
-     *
343
-     * @return Elasticsearch|Promise
344
-     */
345
-    public function postVotingConfigExclusions(array $params = [])
346
-    {
347
-        $url = '/_cluster/voting_config_exclusions';
348
-        $method = 'POST';
349
-        $url = $this->addQueryString($url, $params, ['node_ids', 'node_names', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
350
-        $headers = ['Accept' => 'application/json'];
351
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
352
-    }
353
-    /**
354
-     * Creates or updates a component template
355
-     *
356
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
357
-     *
358
-     * @param array{
359
-     *     name: string, // (REQUIRED) The name of the template
360
-     *     create: boolean, // Whether the index template should only be added if new or can also replace an existing one
361
-     *     timeout: time, // Explicit operation timeout
362
-     *     master_timeout: time, // Specify timeout for connection to master
363
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
364
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
365
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
366
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
367
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
368
-     *     body: array, // (REQUIRED) The template definition
369
-     * } $params
370
-     *
371
-     * @throws MissingParameterException if a required parameter is missing
372
-     * @throws NoNodeAvailableException if all the hosts are offline
373
-     * @throws ClientResponseException if the status code of response is 4xx
374
-     * @throws ServerResponseException if the status code of response is 5xx
375
-     *
376
-     * @return Elasticsearch|Promise
377
-     */
378
-    public function putComponentTemplate(array $params = [])
379
-    {
380
-        $this->checkRequiredParameters(['name', 'body'], $params);
381
-        $url = '/_component_template/' . $this->encode($params['name']);
382
-        $method = 'PUT';
383
-        $url = $this->addQueryString($url, $params, ['create', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
384
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
385
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
386
-    }
387
-    /**
388
-     * Updates the cluster settings.
389
-     *
390
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
391
-     *
392
-     * @param array{
393
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
394
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
395
-     *     timeout: time, // Explicit operation timeout
396
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
397
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
398
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
399
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
400
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
401
-     *     body: array, // (REQUIRED) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).
402
-     * } $params
403
-     *
404
-     * @throws NoNodeAvailableException if all the hosts are offline
405
-     * @throws ClientResponseException if the status code of response is 4xx
406
-     * @throws ServerResponseException if the status code of response is 5xx
407
-     *
408
-     * @return Elasticsearch|Promise
409
-     */
410
-    public function putSettings(array $params = [])
411
-    {
412
-        $this->checkRequiredParameters(['body'], $params);
413
-        $url = '/_cluster/settings';
414
-        $method = 'PUT';
415
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
416
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
417
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
418
-    }
419
-    /**
420
-     * Returns the information about configured remote clusters.
421
-     *
422
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html
423
-     *
424
-     * @param array{
425
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
426
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
427
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
428
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
429
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
430
-     * } $params
431
-     *
432
-     * @throws NoNodeAvailableException if all the hosts are offline
433
-     * @throws ClientResponseException if the status code of response is 4xx
434
-     * @throws ServerResponseException if the status code of response is 5xx
435
-     *
436
-     * @return Elasticsearch|Promise
437
-     */
438
-    public function remoteInfo(array $params = [])
439
-    {
440
-        $url = '/_remote/info';
441
-        $method = 'GET';
442
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
443
-        $headers = ['Accept' => 'application/json'];
444
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
445
-    }
446
-    /**
447
-     * Allows to manually change the allocation of individual shards in the cluster.
448
-     *
449
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html
450
-     *
451
-     * @param array{
452
-     *     dry_run: boolean, // Simulate the operation only and return the resulting state
453
-     *     explain: boolean, // Return an explanation of why the commands can or cannot be executed
454
-     *     retry_failed: boolean, // Retries allocation of shards that are blocked due to too many subsequent allocation failures
455
-     *     metric: list, // Limit the information returned to the specified metrics. Defaults to all but metadata
456
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
457
-     *     timeout: time, // Explicit operation timeout
458
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
459
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
460
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
461
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
462
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
463
-     *     body: array, //  The definition of `commands` to perform (`move`, `cancel`, `allocate`)
464
-     * } $params
465
-     *
466
-     * @throws NoNodeAvailableException if all the hosts are offline
467
-     * @throws ClientResponseException if the status code of response is 4xx
468
-     * @throws ServerResponseException if the status code of response is 5xx
469
-     *
470
-     * @return Elasticsearch|Promise
471
-     */
472
-    public function reroute(array $params = [])
473
-    {
474
-        $url = '/_cluster/reroute';
475
-        $method = 'POST';
476
-        $url = $this->addQueryString($url, $params, ['dry_run', 'explain', 'retry_failed', 'metric', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
477
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
478
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
479
-    }
480
-    /**
481
-     * Returns a comprehensive information about the state of the cluster.
482
-     *
483
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html
484
-     *
485
-     * @param array{
486
-     *     metric: list, //  Limit the information returned to the specified metrics
487
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
488
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
489
-     *     master_timeout: time, // Specify timeout for connection to master
490
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
491
-     *     wait_for_metadata_version: number, // Wait for the metadata version to be equal or greater than the specified metadata version
492
-     *     wait_for_timeout: time, // The maximum time to wait for wait_for_metadata_version before timing out
493
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
494
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
495
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
496
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
497
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
498
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
499
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
500
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
501
-     * } $params
502
-     *
503
-     * @throws NoNodeAvailableException if all the hosts are offline
504
-     * @throws ClientResponseException if the status code of response is 4xx
505
-     * @throws ServerResponseException if the status code of response is 5xx
506
-     *
507
-     * @return Elasticsearch|Promise
508
-     */
509
-    public function state(array $params = [])
510
-    {
511
-        if (isset($params['index']) && isset($params['metric'])) {
512
-            $url = '/_cluster/state/' . $this->encode($params['metric']) . '/' . $this->encode($params['index']);
513
-            $method = 'GET';
514
-        } elseif (isset($params['metric'])) {
515
-            $url = '/_cluster/state/' . $this->encode($params['metric']);
516
-            $method = 'GET';
517
-        } else {
518
-            $url = '/_cluster/state';
519
-            $method = 'GET';
520
-        }
521
-        $url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'flat_settings', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
522
-        $headers = ['Accept' => 'application/json'];
523
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
524
-    }
525
-    /**
526
-     * Returns high-level overview of cluster statistics.
527
-     *
528
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html
529
-     *
530
-     * @param array{
531
-     *     node_id: list, //  A comma-separated 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
532
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
533
-     *     timeout: time, // Explicit operation timeout
534
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
535
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
536
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
537
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
538
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
539
-     * } $params
540
-     *
541
-     * @throws NoNodeAvailableException if all the hosts are offline
542
-     * @throws ClientResponseException if the status code of response is 4xx
543
-     * @throws ServerResponseException if the status code of response is 5xx
544
-     *
545
-     * @return Elasticsearch|Promise
546
-     */
547
-    public function stats(array $params = [])
548
-    {
549
-        if (isset($params['node_id'])) {
550
-            $url = '/_cluster/stats/nodes/' . $this->encode($params['node_id']);
551
-            $method = 'GET';
552
-        } else {
553
-            $url = '/_cluster/stats';
554
-            $method = 'GET';
555
-        }
556
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
557
-        $headers = ['Accept' => 'application/json'];
558
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
559
-    }
28
+	/**
29
+	 * Provides explanations for shard allocations in the cluster.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html
32
+	 *
33
+	 * @param array{
34
+	 *     include_yes_decisions: boolean, // Return 'YES' decisions in explanation (default: false)
35
+	 *     include_disk_info: boolean, // Return information about disk usage and shard sizes (default: false)
36
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
37
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
38
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
39
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
40
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
41
+	 *     body: array, //  The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard'
42
+	 * } $params
43
+	 *
44
+	 * @throws NoNodeAvailableException if all the hosts are offline
45
+	 * @throws ClientResponseException if the status code of response is 4xx
46
+	 * @throws ServerResponseException if the status code of response is 5xx
47
+	 *
48
+	 * @return Elasticsearch|Promise
49
+	 */
50
+	public function allocationExplain(array $params = [])
51
+	{
52
+		$url = '/_cluster/allocation/explain';
53
+		$method = empty($params['body']) ? 'GET' : 'POST';
54
+		$url = $this->addQueryString($url, $params, ['include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
56
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
57
+	}
58
+	/**
59
+	 * Deletes a component template
60
+	 *
61
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
62
+	 *
63
+	 * @param array{
64
+	 *     name: string, // (REQUIRED) The name of the template
65
+	 *     timeout: time, // Explicit operation timeout
66
+	 *     master_timeout: time, // Specify timeout for connection to master
67
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
+	 * } $params
73
+	 *
74
+	 * @throws MissingParameterException if a required parameter is missing
75
+	 * @throws NoNodeAvailableException if all the hosts are offline
76
+	 * @throws ClientResponseException if the status code of response is 4xx
77
+	 * @throws ServerResponseException if the status code of response is 5xx
78
+	 *
79
+	 * @return Elasticsearch|Promise
80
+	 */
81
+	public function deleteComponentTemplate(array $params = [])
82
+	{
83
+		$this->checkRequiredParameters(['name'], $params);
84
+		$url = '/_component_template/' . $this->encode($params['name']);
85
+		$method = 'DELETE';
86
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
+		$headers = ['Accept' => 'application/json'];
88
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
89
+	}
90
+	/**
91
+	 * Clears cluster voting config exclusions.
92
+	 *
93
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
94
+	 *
95
+	 * @param array{
96
+	 *     wait_for_removal: boolean, // Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.
97
+	 *     master_timeout: time, // Timeout for submitting request to master
98
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
99
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
100
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
101
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
102
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
103
+	 * } $params
104
+	 *
105
+	 * @throws NoNodeAvailableException if all the hosts are offline
106
+	 * @throws ClientResponseException if the status code of response is 4xx
107
+	 * @throws ServerResponseException if the status code of response is 5xx
108
+	 *
109
+	 * @return Elasticsearch|Promise
110
+	 */
111
+	public function deleteVotingConfigExclusions(array $params = [])
112
+	{
113
+		$url = '/_cluster/voting_config_exclusions';
114
+		$method = 'DELETE';
115
+		$url = $this->addQueryString($url, $params, ['wait_for_removal', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
116
+		$headers = ['Accept' => 'application/json'];
117
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
118
+	}
119
+	/**
120
+	 * Returns information about whether a particular component template exist
121
+	 *
122
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
123
+	 *
124
+	 * @param array{
125
+	 *     name: string, // (REQUIRED) The name of the template
126
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
127
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
128
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
129
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
130
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
131
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
132
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
133
+	 * } $params
134
+	 *
135
+	 * @throws MissingParameterException if a required parameter is missing
136
+	 * @throws NoNodeAvailableException if all the hosts are offline
137
+	 * @throws ClientResponseException if the status code of response is 4xx
138
+	 * @throws ServerResponseException if the status code of response is 5xx
139
+	 *
140
+	 * @return Elasticsearch|Promise
141
+	 */
142
+	public function existsComponentTemplate(array $params = [])
143
+	{
144
+		$this->checkRequiredParameters(['name'], $params);
145
+		$url = '/_component_template/' . $this->encode($params['name']);
146
+		$method = 'HEAD';
147
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
148
+		$headers = ['Accept' => 'application/json'];
149
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
150
+	}
151
+	/**
152
+	 * Returns one or more component templates
153
+	 *
154
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
155
+	 *
156
+	 * @param array{
157
+	 *     name: list, //  The comma separated names of the component templates
158
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
159
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
160
+	 *     include_defaults: boolean, // Return all default configurations for the component template (default: false)
161
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
162
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
163
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
164
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
165
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
166
+	 * } $params
167
+	 *
168
+	 * @throws NoNodeAvailableException if all the hosts are offline
169
+	 * @throws ClientResponseException if the status code of response is 4xx
170
+	 * @throws ServerResponseException if the status code of response is 5xx
171
+	 *
172
+	 * @return Elasticsearch|Promise
173
+	 */
174
+	public function getComponentTemplate(array $params = [])
175
+	{
176
+		if (isset($params['name'])) {
177
+			$url = '/_component_template/' . $this->encode($params['name']);
178
+			$method = 'GET';
179
+		} else {
180
+			$url = '/_component_template';
181
+			$method = 'GET';
182
+		}
183
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
184
+		$headers = ['Accept' => 'application/json'];
185
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
186
+	}
187
+	/**
188
+	 * Returns cluster settings.
189
+	 *
190
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html
191
+	 *
192
+	 * @param array{
193
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
194
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
195
+	 *     timeout: time, // Explicit operation timeout
196
+	 *     include_defaults: boolean, // Whether to return all default clusters setting.
197
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
198
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
199
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
200
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
201
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
202
+	 * } $params
203
+	 *
204
+	 * @throws NoNodeAvailableException if all the hosts are offline
205
+	 * @throws ClientResponseException if the status code of response is 4xx
206
+	 * @throws ServerResponseException if the status code of response is 5xx
207
+	 *
208
+	 * @return Elasticsearch|Promise
209
+	 */
210
+	public function getSettings(array $params = [])
211
+	{
212
+		$url = '/_cluster/settings';
213
+		$method = 'GET';
214
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
215
+		$headers = ['Accept' => 'application/json'];
216
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
217
+	}
218
+	/**
219
+	 * Returns basic information about the health of the cluster.
220
+	 *
221
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html
222
+	 *
223
+	 * @param array{
224
+	 *     index: list, //  Limit the information returned to a specific index
225
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
226
+	 *     level: enum, // Specify the level of detail for returned information
227
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
228
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
229
+	 *     timeout: time, // Explicit operation timeout
230
+	 *     wait_for_active_shards: string, // Wait until the specified number of shards is active
231
+	 *     wait_for_nodes: string, // Wait until the specified number of nodes is available
232
+	 *     wait_for_events: enum, // Wait until all currently queued events with the given priority are processed
233
+	 *     wait_for_no_relocating_shards: boolean, // Whether to wait until there are no relocating shards in the cluster
234
+	 *     wait_for_no_initializing_shards: boolean, // Whether to wait until there are no initializing shards in the cluster
235
+	 *     wait_for_status: enum, // Wait until cluster is in a specific state
236
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
237
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
238
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
239
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
240
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
241
+	 * } $params
242
+	 *
243
+	 * @throws NoNodeAvailableException if all the hosts are offline
244
+	 * @throws ClientResponseException if the status code of response is 4xx
245
+	 * @throws ServerResponseException if the status code of response is 5xx
246
+	 *
247
+	 * @return Elasticsearch|Promise
248
+	 */
249
+	public function health(array $params = [])
250
+	{
251
+		if (isset($params['index'])) {
252
+			$url = '/_cluster/health/' . $this->encode($params['index']);
253
+			$method = 'GET';
254
+		} else {
255
+			$url = '/_cluster/health';
256
+			$method = 'GET';
257
+		}
258
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'level', 'local', 'master_timeout', 'timeout', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
259
+		$headers = ['Accept' => 'application/json'];
260
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
261
+	}
262
+	/**
263
+	 * Returns different information about the cluster.
264
+	 *
265
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html
266
+	 *
267
+	 * @param array{
268
+	 *     target: list, // (REQUIRED) Limit the information returned to the specified target.
269
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
270
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
271
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
272
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
273
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
274
+	 * } $params
275
+	 *
276
+	 * @throws MissingParameterException if a required parameter is missing
277
+	 * @throws NoNodeAvailableException if all the hosts are offline
278
+	 * @throws ClientResponseException if the status code of response is 4xx
279
+	 * @throws ServerResponseException if the status code of response is 5xx
280
+	 *
281
+	 * @return Elasticsearch|Promise
282
+	 */
283
+	public function info(array $params = [])
284
+	{
285
+		$this->checkRequiredParameters(['target'], $params);
286
+		$url = '/_info/' . $this->encode($params['target']);
287
+		$method = 'GET';
288
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
289
+		$headers = ['Accept' => 'application/json'];
290
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
291
+	}
292
+	/**
293
+	 * Returns a list of any cluster-level changes (e.g. create index, update mapping,
294
+	 * allocate or fail shard) which have not yet been executed.
295
+	 *
296
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html
297
+	 *
298
+	 * @param array{
299
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
300
+	 *     master_timeout: time, // Specify timeout for connection to master
301
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
302
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
303
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
304
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
305
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
306
+	 * } $params
307
+	 *
308
+	 * @throws NoNodeAvailableException if all the hosts are offline
309
+	 * @throws ClientResponseException if the status code of response is 4xx
310
+	 * @throws ServerResponseException if the status code of response is 5xx
311
+	 *
312
+	 * @return Elasticsearch|Promise
313
+	 */
314
+	public function pendingTasks(array $params = [])
315
+	{
316
+		$url = '/_cluster/pending_tasks';
317
+		$method = 'GET';
318
+		$url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
319
+		$headers = ['Accept' => 'application/json'];
320
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
321
+	}
322
+	/**
323
+	 * Updates the cluster voting config exclusions by node ids or node names.
324
+	 *
325
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
326
+	 *
327
+	 * @param array{
328
+	 *     node_ids: string, // A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names.
329
+	 *     node_names: string, // A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids.
330
+	 *     timeout: time, // Explicit operation timeout
331
+	 *     master_timeout: time, // Timeout for submitting request to master
332
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
333
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
334
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
335
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
336
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
337
+	 * } $params
338
+	 *
339
+	 * @throws NoNodeAvailableException if all the hosts are offline
340
+	 * @throws ClientResponseException if the status code of response is 4xx
341
+	 * @throws ServerResponseException if the status code of response is 5xx
342
+	 *
343
+	 * @return Elasticsearch|Promise
344
+	 */
345
+	public function postVotingConfigExclusions(array $params = [])
346
+	{
347
+		$url = '/_cluster/voting_config_exclusions';
348
+		$method = 'POST';
349
+		$url = $this->addQueryString($url, $params, ['node_ids', 'node_names', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
350
+		$headers = ['Accept' => 'application/json'];
351
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
352
+	}
353
+	/**
354
+	 * Creates or updates a component template
355
+	 *
356
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html
357
+	 *
358
+	 * @param array{
359
+	 *     name: string, // (REQUIRED) The name of the template
360
+	 *     create: boolean, // Whether the index template should only be added if new or can also replace an existing one
361
+	 *     timeout: time, // Explicit operation timeout
362
+	 *     master_timeout: time, // Specify timeout for connection to master
363
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
364
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
365
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
366
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
367
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
368
+	 *     body: array, // (REQUIRED) The template definition
369
+	 * } $params
370
+	 *
371
+	 * @throws MissingParameterException if a required parameter is missing
372
+	 * @throws NoNodeAvailableException if all the hosts are offline
373
+	 * @throws ClientResponseException if the status code of response is 4xx
374
+	 * @throws ServerResponseException if the status code of response is 5xx
375
+	 *
376
+	 * @return Elasticsearch|Promise
377
+	 */
378
+	public function putComponentTemplate(array $params = [])
379
+	{
380
+		$this->checkRequiredParameters(['name', 'body'], $params);
381
+		$url = '/_component_template/' . $this->encode($params['name']);
382
+		$method = 'PUT';
383
+		$url = $this->addQueryString($url, $params, ['create', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
384
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
385
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
386
+	}
387
+	/**
388
+	 * Updates the cluster settings.
389
+	 *
390
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
391
+	 *
392
+	 * @param array{
393
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
394
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
395
+	 *     timeout: time, // Explicit operation timeout
396
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
397
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
398
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
399
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
400
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
401
+	 *     body: array, // (REQUIRED) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).
402
+	 * } $params
403
+	 *
404
+	 * @throws NoNodeAvailableException if all the hosts are offline
405
+	 * @throws ClientResponseException if the status code of response is 4xx
406
+	 * @throws ServerResponseException if the status code of response is 5xx
407
+	 *
408
+	 * @return Elasticsearch|Promise
409
+	 */
410
+	public function putSettings(array $params = [])
411
+	{
412
+		$this->checkRequiredParameters(['body'], $params);
413
+		$url = '/_cluster/settings';
414
+		$method = 'PUT';
415
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
416
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
417
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
418
+	}
419
+	/**
420
+	 * Returns the information about configured remote clusters.
421
+	 *
422
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html
423
+	 *
424
+	 * @param array{
425
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
426
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
427
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
428
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
429
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
430
+	 * } $params
431
+	 *
432
+	 * @throws NoNodeAvailableException if all the hosts are offline
433
+	 * @throws ClientResponseException if the status code of response is 4xx
434
+	 * @throws ServerResponseException if the status code of response is 5xx
435
+	 *
436
+	 * @return Elasticsearch|Promise
437
+	 */
438
+	public function remoteInfo(array $params = [])
439
+	{
440
+		$url = '/_remote/info';
441
+		$method = 'GET';
442
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
443
+		$headers = ['Accept' => 'application/json'];
444
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
445
+	}
446
+	/**
447
+	 * Allows to manually change the allocation of individual shards in the cluster.
448
+	 *
449
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html
450
+	 *
451
+	 * @param array{
452
+	 *     dry_run: boolean, // Simulate the operation only and return the resulting state
453
+	 *     explain: boolean, // Return an explanation of why the commands can or cannot be executed
454
+	 *     retry_failed: boolean, // Retries allocation of shards that are blocked due to too many subsequent allocation failures
455
+	 *     metric: list, // Limit the information returned to the specified metrics. Defaults to all but metadata
456
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
457
+	 *     timeout: time, // Explicit operation timeout
458
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
459
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
460
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
461
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
462
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
463
+	 *     body: array, //  The definition of `commands` to perform (`move`, `cancel`, `allocate`)
464
+	 * } $params
465
+	 *
466
+	 * @throws NoNodeAvailableException if all the hosts are offline
467
+	 * @throws ClientResponseException if the status code of response is 4xx
468
+	 * @throws ServerResponseException if the status code of response is 5xx
469
+	 *
470
+	 * @return Elasticsearch|Promise
471
+	 */
472
+	public function reroute(array $params = [])
473
+	{
474
+		$url = '/_cluster/reroute';
475
+		$method = 'POST';
476
+		$url = $this->addQueryString($url, $params, ['dry_run', 'explain', 'retry_failed', 'metric', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
477
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
478
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
479
+	}
480
+	/**
481
+	 * Returns a comprehensive information about the state of the cluster.
482
+	 *
483
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html
484
+	 *
485
+	 * @param array{
486
+	 *     metric: list, //  Limit the information returned to the specified metrics
487
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
488
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
489
+	 *     master_timeout: time, // Specify timeout for connection to master
490
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
491
+	 *     wait_for_metadata_version: number, // Wait for the metadata version to be equal or greater than the specified metadata version
492
+	 *     wait_for_timeout: time, // The maximum time to wait for wait_for_metadata_version before timing out
493
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
494
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
495
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
496
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
497
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
498
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
499
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
500
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
501
+	 * } $params
502
+	 *
503
+	 * @throws NoNodeAvailableException if all the hosts are offline
504
+	 * @throws ClientResponseException if the status code of response is 4xx
505
+	 * @throws ServerResponseException if the status code of response is 5xx
506
+	 *
507
+	 * @return Elasticsearch|Promise
508
+	 */
509
+	public function state(array $params = [])
510
+	{
511
+		if (isset($params['index']) && isset($params['metric'])) {
512
+			$url = '/_cluster/state/' . $this->encode($params['metric']) . '/' . $this->encode($params['index']);
513
+			$method = 'GET';
514
+		} elseif (isset($params['metric'])) {
515
+			$url = '/_cluster/state/' . $this->encode($params['metric']);
516
+			$method = 'GET';
517
+		} else {
518
+			$url = '/_cluster/state';
519
+			$method = 'GET';
520
+		}
521
+		$url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'flat_settings', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
522
+		$headers = ['Accept' => 'application/json'];
523
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
524
+	}
525
+	/**
526
+	 * Returns high-level overview of cluster statistics.
527
+	 *
528
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html
529
+	 *
530
+	 * @param array{
531
+	 *     node_id: list, //  A comma-separated 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
532
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
533
+	 *     timeout: time, // Explicit operation timeout
534
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
535
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
536
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
537
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
538
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
539
+	 * } $params
540
+	 *
541
+	 * @throws NoNodeAvailableException if all the hosts are offline
542
+	 * @throws ClientResponseException if the status code of response is 4xx
543
+	 * @throws ServerResponseException if the status code of response is 5xx
544
+	 *
545
+	 * @return Elasticsearch|Promise
546
+	 */
547
+	public function stats(array $params = [])
548
+	{
549
+		if (isset($params['node_id'])) {
550
+			$url = '/_cluster/stats/nodes/' . $this->encode($params['node_id']);
551
+			$method = 'GET';
552
+		} else {
553
+			$url = '/_cluster/stats';
554
+			$method = 'GET';
555
+		}
556
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
557
+		$headers = ['Accept' => 'application/json'];
558
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
559
+	}
560 560
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function deleteComponentTemplate(array $params = [])
82 82
     {
83 83
         $this->checkRequiredParameters(['name'], $params);
84
-        $url = '/_component_template/' . $this->encode($params['name']);
84
+        $url = '/_component_template/'.$this->encode($params['name']);
85 85
         $method = 'DELETE';
86 86
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
87 87
         $headers = ['Accept' => 'application/json'];
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function existsComponentTemplate(array $params = [])
143 143
     {
144 144
         $this->checkRequiredParameters(['name'], $params);
145
-        $url = '/_component_template/' . $this->encode($params['name']);
145
+        $url = '/_component_template/'.$this->encode($params['name']);
146 146
         $method = 'HEAD';
147 147
         $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
148 148
         $headers = ['Accept' => 'application/json'];
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     public function getComponentTemplate(array $params = [])
175 175
     {
176 176
         if (isset($params['name'])) {
177
-            $url = '/_component_template/' . $this->encode($params['name']);
177
+            $url = '/_component_template/'.$this->encode($params['name']);
178 178
             $method = 'GET';
179 179
         } else {
180 180
             $url = '/_component_template';
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     public function health(array $params = [])
250 250
     {
251 251
         if (isset($params['index'])) {
252
-            $url = '/_cluster/health/' . $this->encode($params['index']);
252
+            $url = '/_cluster/health/'.$this->encode($params['index']);
253 253
             $method = 'GET';
254 254
         } else {
255 255
             $url = '/_cluster/health';
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     public function info(array $params = [])
284 284
     {
285 285
         $this->checkRequiredParameters(['target'], $params);
286
-        $url = '/_info/' . $this->encode($params['target']);
286
+        $url = '/_info/'.$this->encode($params['target']);
287 287
         $method = 'GET';
288 288
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
289 289
         $headers = ['Accept' => 'application/json'];
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
     public function putComponentTemplate(array $params = [])
379 379
     {
380 380
         $this->checkRequiredParameters(['name', 'body'], $params);
381
-        $url = '/_component_template/' . $this->encode($params['name']);
381
+        $url = '/_component_template/'.$this->encode($params['name']);
382 382
         $method = 'PUT';
383 383
         $url = $this->addQueryString($url, $params, ['create', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
384 384
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -509,10 +509,10 @@  discard block
 block discarded – undo
509 509
     public function state(array $params = [])
510 510
     {
511 511
         if (isset($params['index']) && isset($params['metric'])) {
512
-            $url = '/_cluster/state/' . $this->encode($params['metric']) . '/' . $this->encode($params['index']);
512
+            $url = '/_cluster/state/'.$this->encode($params['metric']).'/'.$this->encode($params['index']);
513 513
             $method = 'GET';
514 514
         } elseif (isset($params['metric'])) {
515
-            $url = '/_cluster/state/' . $this->encode($params['metric']);
515
+            $url = '/_cluster/state/'.$this->encode($params['metric']);
516 516
             $method = 'GET';
517 517
         } else {
518 518
             $url = '/_cluster/state';
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
     public function stats(array $params = [])
548 548
     {
549 549
         if (isset($params['node_id'])) {
550
-            $url = '/_cluster/stats/nodes/' . $this->encode($params['node_id']);
550
+            $url = '/_cluster/stats/nodes/'.$this->encode($params['node_id']);
551 551
             $method = 'GET';
552 552
         } else {
553 553
             $url = '/_cluster/stats';
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Cluster extends AbstractEndpoint
27
-{
26
+class Cluster extends AbstractEndpoint {
28 27
     /**
29 28
      * Provides explanations for shard allocations in the cluster.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Ilm.php 3 patches
Indentation   +327 added lines, -327 removed lines patch added patch discarded remove patch
@@ -25,331 +25,331 @@
 block discarded – undo
25 25
  */
26 26
 class Ilm extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html
32
-     *
33
-     * @param array{
34
-     *     policy: string, // (REQUIRED) The name of the index lifecycle policy
35
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
36
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
37
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
38
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
39
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
40
-     * } $params
41
-     *
42
-     * @throws MissingParameterException if a required parameter is missing
43
-     * @throws NoNodeAvailableException if all the hosts are offline
44
-     * @throws ClientResponseException if the status code of response is 4xx
45
-     * @throws ServerResponseException if the status code of response is 5xx
46
-     *
47
-     * @return Elasticsearch|Promise
48
-     */
49
-    public function deleteLifecycle(array $params = [])
50
-    {
51
-        $this->checkRequiredParameters(['policy'], $params);
52
-        $url = '/_ilm/policy/' . $this->encode($params['policy']);
53
-        $method = 'DELETE';
54
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
-        $headers = ['Accept' => 'application/json'];
56
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
57
-    }
58
-    /**
59
-     * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step.
60
-     *
61
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html
62
-     *
63
-     * @param array{
64
-     *     index: string, // (REQUIRED) The name of the index to explain
65
-     *     only_managed: boolean, // filters the indices included in the response to ones managed by ILM
66
-     *     only_errors: boolean, // filters the indices included in the response to ones in an ILM error state, implies only_managed
67
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
-     * } $params
73
-     *
74
-     * @throws MissingParameterException if a required parameter is missing
75
-     * @throws NoNodeAvailableException if all the hosts are offline
76
-     * @throws ClientResponseException if the status code of response is 4xx
77
-     * @throws ServerResponseException if the status code of response is 5xx
78
-     *
79
-     * @return Elasticsearch|Promise
80
-     */
81
-    public function explainLifecycle(array $params = [])
82
-    {
83
-        $this->checkRequiredParameters(['index'], $params);
84
-        $url = '/' . $this->encode($params['index']) . '/_ilm/explain';
85
-        $method = 'GET';
86
-        $url = $this->addQueryString($url, $params, ['only_managed', 'only_errors', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
-        $headers = ['Accept' => 'application/json'];
88
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
89
-    }
90
-    /**
91
-     * Returns the specified policy definition. Includes the policy version and last modified date.
92
-     *
93
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html
94
-     *
95
-     * @param array{
96
-     *     policy: string, //  The name of the index lifecycle policy
97
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
98
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
99
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
100
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
101
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
102
-     * } $params
103
-     *
104
-     * @throws NoNodeAvailableException if all the hosts are offline
105
-     * @throws ClientResponseException if the status code of response is 4xx
106
-     * @throws ServerResponseException if the status code of response is 5xx
107
-     *
108
-     * @return Elasticsearch|Promise
109
-     */
110
-    public function getLifecycle(array $params = [])
111
-    {
112
-        if (isset($params['policy'])) {
113
-            $url = '/_ilm/policy/' . $this->encode($params['policy']);
114
-            $method = 'GET';
115
-        } else {
116
-            $url = '/_ilm/policy';
117
-            $method = 'GET';
118
-        }
119
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
120
-        $headers = ['Accept' => 'application/json'];
121
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
122
-    }
123
-    /**
124
-     * Retrieves the current index lifecycle management (ILM) status.
125
-     *
126
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html
127
-     *
128
-     * @param array{
129
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
130
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
131
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
132
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
133
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
134
-     * } $params
135
-     *
136
-     * @throws NoNodeAvailableException if all the hosts are offline
137
-     * @throws ClientResponseException if the status code of response is 4xx
138
-     * @throws ServerResponseException if the status code of response is 5xx
139
-     *
140
-     * @return Elasticsearch|Promise
141
-     */
142
-    public function getStatus(array $params = [])
143
-    {
144
-        $url = '/_ilm/status';
145
-        $method = 'GET';
146
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
147
-        $headers = ['Accept' => 'application/json'];
148
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
149
-    }
150
-    /**
151
-     * Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing
152
-     *
153
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html
154
-     *
155
-     * @param array{
156
-     *     dry_run: boolean, // 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
157
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
158
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
159
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
160
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
161
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
162
-     *     body: array, //  Optionally specify a legacy index template name to delete and optionally specify a node attribute name used for index shard routing (defaults to "data")
163
-     * } $params
164
-     *
165
-     * @throws NoNodeAvailableException if all the hosts are offline
166
-     * @throws ClientResponseException if the status code of response is 4xx
167
-     * @throws ServerResponseException if the status code of response is 5xx
168
-     *
169
-     * @return Elasticsearch|Promise
170
-     */
171
-    public function migrateToDataTiers(array $params = [])
172
-    {
173
-        $url = '/_ilm/migrate_to_data_tiers';
174
-        $method = 'POST';
175
-        $url = $this->addQueryString($url, $params, ['dry_run', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
176
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
177
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
178
-    }
179
-    /**
180
-     * Manually moves an index into the specified step and executes that step.
181
-     *
182
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html
183
-     *
184
-     * @param array{
185
-     *     index: string, // (REQUIRED) The name of the index whose lifecycle step is to change
186
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
187
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
188
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
189
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
190
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
191
-     *     body: array, //  The new lifecycle step to move to
192
-     * } $params
193
-     *
194
-     * @throws MissingParameterException if a required parameter is missing
195
-     * @throws NoNodeAvailableException if all the hosts are offline
196
-     * @throws ClientResponseException if the status code of response is 4xx
197
-     * @throws ServerResponseException if the status code of response is 5xx
198
-     *
199
-     * @return Elasticsearch|Promise
200
-     */
201
-    public function moveToStep(array $params = [])
202
-    {
203
-        $this->checkRequiredParameters(['index'], $params);
204
-        $url = '/_ilm/move/' . $this->encode($params['index']);
205
-        $method = 'POST';
206
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
207
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
208
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
209
-    }
210
-    /**
211
-     * Creates a lifecycle policy
212
-     *
213
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html
214
-     *
215
-     * @param array{
216
-     *     policy: string, // (REQUIRED) The name of the index lifecycle policy
217
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
218
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
219
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
220
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
221
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
222
-     *     body: array, //  The lifecycle policy definition to register
223
-     * } $params
224
-     *
225
-     * @throws MissingParameterException if a required parameter is missing
226
-     * @throws NoNodeAvailableException if all the hosts are offline
227
-     * @throws ClientResponseException if the status code of response is 4xx
228
-     * @throws ServerResponseException if the status code of response is 5xx
229
-     *
230
-     * @return Elasticsearch|Promise
231
-     */
232
-    public function putLifecycle(array $params = [])
233
-    {
234
-        $this->checkRequiredParameters(['policy'], $params);
235
-        $url = '/_ilm/policy/' . $this->encode($params['policy']);
236
-        $method = 'PUT';
237
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
238
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
239
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
240
-    }
241
-    /**
242
-     * Removes the assigned lifecycle policy and stops managing the specified index
243
-     *
244
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html
245
-     *
246
-     * @param array{
247
-     *     index: string, // (REQUIRED) The name of the index to remove policy on
248
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
249
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
250
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
251
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
252
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
253
-     * } $params
254
-     *
255
-     * @throws MissingParameterException if a required parameter is missing
256
-     * @throws NoNodeAvailableException if all the hosts are offline
257
-     * @throws ClientResponseException if the status code of response is 4xx
258
-     * @throws ServerResponseException if the status code of response is 5xx
259
-     *
260
-     * @return Elasticsearch|Promise
261
-     */
262
-    public function removePolicy(array $params = [])
263
-    {
264
-        $this->checkRequiredParameters(['index'], $params);
265
-        $url = '/' . $this->encode($params['index']) . '/_ilm/remove';
266
-        $method = 'POST';
267
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
268
-        $headers = ['Accept' => 'application/json'];
269
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
270
-    }
271
-    /**
272
-     * Retries executing the policy for an index that is in the ERROR step.
273
-     *
274
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html
275
-     *
276
-     * @param array{
277
-     *     index: string, // (REQUIRED) The name of the indices (comma-separated) whose failed lifecycle step is to be retry
278
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
279
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
280
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
281
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
282
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
283
-     * } $params
284
-     *
285
-     * @throws MissingParameterException if a required parameter is missing
286
-     * @throws NoNodeAvailableException if all the hosts are offline
287
-     * @throws ClientResponseException if the status code of response is 4xx
288
-     * @throws ServerResponseException if the status code of response is 5xx
289
-     *
290
-     * @return Elasticsearch|Promise
291
-     */
292
-    public function retry(array $params = [])
293
-    {
294
-        $this->checkRequiredParameters(['index'], $params);
295
-        $url = '/' . $this->encode($params['index']) . '/_ilm/retry';
296
-        $method = 'POST';
297
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
298
-        $headers = ['Accept' => 'application/json'];
299
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
300
-    }
301
-    /**
302
-     * Start the index lifecycle management (ILM) plugin.
303
-     *
304
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html
305
-     *
306
-     * @param array{
307
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
308
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
309
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
310
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
311
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
312
-     * } $params
313
-     *
314
-     * @throws NoNodeAvailableException if all the hosts are offline
315
-     * @throws ClientResponseException if the status code of response is 4xx
316
-     * @throws ServerResponseException if the status code of response is 5xx
317
-     *
318
-     * @return Elasticsearch|Promise
319
-     */
320
-    public function start(array $params = [])
321
-    {
322
-        $url = '/_ilm/start';
323
-        $method = 'POST';
324
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
325
-        $headers = ['Accept' => 'application/json'];
326
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
327
-    }
328
-    /**
329
-     * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
330
-     *
331
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html
332
-     *
333
-     * @param array{
334
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
335
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
336
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
337
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
338
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
339
-     * } $params
340
-     *
341
-     * @throws NoNodeAvailableException if all the hosts are offline
342
-     * @throws ClientResponseException if the status code of response is 4xx
343
-     * @throws ServerResponseException if the status code of response is 5xx
344
-     *
345
-     * @return Elasticsearch|Promise
346
-     */
347
-    public function stop(array $params = [])
348
-    {
349
-        $url = '/_ilm/stop';
350
-        $method = 'POST';
351
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
352
-        $headers = ['Accept' => 'application/json'];
353
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
354
-    }
28
+	/**
29
+	 * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html
32
+	 *
33
+	 * @param array{
34
+	 *     policy: string, // (REQUIRED) The name of the index lifecycle policy
35
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
36
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
37
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
38
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
39
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
40
+	 * } $params
41
+	 *
42
+	 * @throws MissingParameterException if a required parameter is missing
43
+	 * @throws NoNodeAvailableException if all the hosts are offline
44
+	 * @throws ClientResponseException if the status code of response is 4xx
45
+	 * @throws ServerResponseException if the status code of response is 5xx
46
+	 *
47
+	 * @return Elasticsearch|Promise
48
+	 */
49
+	public function deleteLifecycle(array $params = [])
50
+	{
51
+		$this->checkRequiredParameters(['policy'], $params);
52
+		$url = '/_ilm/policy/' . $this->encode($params['policy']);
53
+		$method = 'DELETE';
54
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
+		$headers = ['Accept' => 'application/json'];
56
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
57
+	}
58
+	/**
59
+	 * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step.
60
+	 *
61
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html
62
+	 *
63
+	 * @param array{
64
+	 *     index: string, // (REQUIRED) The name of the index to explain
65
+	 *     only_managed: boolean, // filters the indices included in the response to ones managed by ILM
66
+	 *     only_errors: boolean, // filters the indices included in the response to ones in an ILM error state, implies only_managed
67
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
+	 * } $params
73
+	 *
74
+	 * @throws MissingParameterException if a required parameter is missing
75
+	 * @throws NoNodeAvailableException if all the hosts are offline
76
+	 * @throws ClientResponseException if the status code of response is 4xx
77
+	 * @throws ServerResponseException if the status code of response is 5xx
78
+	 *
79
+	 * @return Elasticsearch|Promise
80
+	 */
81
+	public function explainLifecycle(array $params = [])
82
+	{
83
+		$this->checkRequiredParameters(['index'], $params);
84
+		$url = '/' . $this->encode($params['index']) . '/_ilm/explain';
85
+		$method = 'GET';
86
+		$url = $this->addQueryString($url, $params, ['only_managed', 'only_errors', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
+		$headers = ['Accept' => 'application/json'];
88
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
89
+	}
90
+	/**
91
+	 * Returns the specified policy definition. Includes the policy version and last modified date.
92
+	 *
93
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html
94
+	 *
95
+	 * @param array{
96
+	 *     policy: string, //  The name of the index lifecycle policy
97
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
98
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
99
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
100
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
101
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
102
+	 * } $params
103
+	 *
104
+	 * @throws NoNodeAvailableException if all the hosts are offline
105
+	 * @throws ClientResponseException if the status code of response is 4xx
106
+	 * @throws ServerResponseException if the status code of response is 5xx
107
+	 *
108
+	 * @return Elasticsearch|Promise
109
+	 */
110
+	public function getLifecycle(array $params = [])
111
+	{
112
+		if (isset($params['policy'])) {
113
+			$url = '/_ilm/policy/' . $this->encode($params['policy']);
114
+			$method = 'GET';
115
+		} else {
116
+			$url = '/_ilm/policy';
117
+			$method = 'GET';
118
+		}
119
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
120
+		$headers = ['Accept' => 'application/json'];
121
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
122
+	}
123
+	/**
124
+	 * Retrieves the current index lifecycle management (ILM) status.
125
+	 *
126
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html
127
+	 *
128
+	 * @param array{
129
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
130
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
131
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
132
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
133
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
134
+	 * } $params
135
+	 *
136
+	 * @throws NoNodeAvailableException if all the hosts are offline
137
+	 * @throws ClientResponseException if the status code of response is 4xx
138
+	 * @throws ServerResponseException if the status code of response is 5xx
139
+	 *
140
+	 * @return Elasticsearch|Promise
141
+	 */
142
+	public function getStatus(array $params = [])
143
+	{
144
+		$url = '/_ilm/status';
145
+		$method = 'GET';
146
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
147
+		$headers = ['Accept' => 'application/json'];
148
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
149
+	}
150
+	/**
151
+	 * Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing
152
+	 *
153
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html
154
+	 *
155
+	 * @param array{
156
+	 *     dry_run: boolean, // 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
157
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
158
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
159
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
160
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
161
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
162
+	 *     body: array, //  Optionally specify a legacy index template name to delete and optionally specify a node attribute name used for index shard routing (defaults to "data")
163
+	 * } $params
164
+	 *
165
+	 * @throws NoNodeAvailableException if all the hosts are offline
166
+	 * @throws ClientResponseException if the status code of response is 4xx
167
+	 * @throws ServerResponseException if the status code of response is 5xx
168
+	 *
169
+	 * @return Elasticsearch|Promise
170
+	 */
171
+	public function migrateToDataTiers(array $params = [])
172
+	{
173
+		$url = '/_ilm/migrate_to_data_tiers';
174
+		$method = 'POST';
175
+		$url = $this->addQueryString($url, $params, ['dry_run', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
176
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
177
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
178
+	}
179
+	/**
180
+	 * Manually moves an index into the specified step and executes that step.
181
+	 *
182
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html
183
+	 *
184
+	 * @param array{
185
+	 *     index: string, // (REQUIRED) The name of the index whose lifecycle step is to change
186
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
187
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
188
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
189
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
190
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
191
+	 *     body: array, //  The new lifecycle step to move to
192
+	 * } $params
193
+	 *
194
+	 * @throws MissingParameterException if a required parameter is missing
195
+	 * @throws NoNodeAvailableException if all the hosts are offline
196
+	 * @throws ClientResponseException if the status code of response is 4xx
197
+	 * @throws ServerResponseException if the status code of response is 5xx
198
+	 *
199
+	 * @return Elasticsearch|Promise
200
+	 */
201
+	public function moveToStep(array $params = [])
202
+	{
203
+		$this->checkRequiredParameters(['index'], $params);
204
+		$url = '/_ilm/move/' . $this->encode($params['index']);
205
+		$method = 'POST';
206
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
207
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
208
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
209
+	}
210
+	/**
211
+	 * Creates a lifecycle policy
212
+	 *
213
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html
214
+	 *
215
+	 * @param array{
216
+	 *     policy: string, // (REQUIRED) The name of the index lifecycle policy
217
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
218
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
219
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
220
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
221
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
222
+	 *     body: array, //  The lifecycle policy definition to register
223
+	 * } $params
224
+	 *
225
+	 * @throws MissingParameterException if a required parameter is missing
226
+	 * @throws NoNodeAvailableException if all the hosts are offline
227
+	 * @throws ClientResponseException if the status code of response is 4xx
228
+	 * @throws ServerResponseException if the status code of response is 5xx
229
+	 *
230
+	 * @return Elasticsearch|Promise
231
+	 */
232
+	public function putLifecycle(array $params = [])
233
+	{
234
+		$this->checkRequiredParameters(['policy'], $params);
235
+		$url = '/_ilm/policy/' . $this->encode($params['policy']);
236
+		$method = 'PUT';
237
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
238
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
239
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
240
+	}
241
+	/**
242
+	 * Removes the assigned lifecycle policy and stops managing the specified index
243
+	 *
244
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html
245
+	 *
246
+	 * @param array{
247
+	 *     index: string, // (REQUIRED) The name of the index to remove policy on
248
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
249
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
250
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
251
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
252
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
253
+	 * } $params
254
+	 *
255
+	 * @throws MissingParameterException if a required parameter is missing
256
+	 * @throws NoNodeAvailableException if all the hosts are offline
257
+	 * @throws ClientResponseException if the status code of response is 4xx
258
+	 * @throws ServerResponseException if the status code of response is 5xx
259
+	 *
260
+	 * @return Elasticsearch|Promise
261
+	 */
262
+	public function removePolicy(array $params = [])
263
+	{
264
+		$this->checkRequiredParameters(['index'], $params);
265
+		$url = '/' . $this->encode($params['index']) . '/_ilm/remove';
266
+		$method = 'POST';
267
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
268
+		$headers = ['Accept' => 'application/json'];
269
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
270
+	}
271
+	/**
272
+	 * Retries executing the policy for an index that is in the ERROR step.
273
+	 *
274
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html
275
+	 *
276
+	 * @param array{
277
+	 *     index: string, // (REQUIRED) The name of the indices (comma-separated) whose failed lifecycle step is to be retry
278
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
279
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
280
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
281
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
282
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
283
+	 * } $params
284
+	 *
285
+	 * @throws MissingParameterException if a required parameter is missing
286
+	 * @throws NoNodeAvailableException if all the hosts are offline
287
+	 * @throws ClientResponseException if the status code of response is 4xx
288
+	 * @throws ServerResponseException if the status code of response is 5xx
289
+	 *
290
+	 * @return Elasticsearch|Promise
291
+	 */
292
+	public function retry(array $params = [])
293
+	{
294
+		$this->checkRequiredParameters(['index'], $params);
295
+		$url = '/' . $this->encode($params['index']) . '/_ilm/retry';
296
+		$method = 'POST';
297
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
298
+		$headers = ['Accept' => 'application/json'];
299
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
300
+	}
301
+	/**
302
+	 * Start the index lifecycle management (ILM) plugin.
303
+	 *
304
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html
305
+	 *
306
+	 * @param array{
307
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
308
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
309
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
310
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
311
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
312
+	 * } $params
313
+	 *
314
+	 * @throws NoNodeAvailableException if all the hosts are offline
315
+	 * @throws ClientResponseException if the status code of response is 4xx
316
+	 * @throws ServerResponseException if the status code of response is 5xx
317
+	 *
318
+	 * @return Elasticsearch|Promise
319
+	 */
320
+	public function start(array $params = [])
321
+	{
322
+		$url = '/_ilm/start';
323
+		$method = 'POST';
324
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
325
+		$headers = ['Accept' => 'application/json'];
326
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
327
+	}
328
+	/**
329
+	 * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
330
+	 *
331
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html
332
+	 *
333
+	 * @param array{
334
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
335
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
336
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
337
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
338
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
339
+	 * } $params
340
+	 *
341
+	 * @throws NoNodeAvailableException if all the hosts are offline
342
+	 * @throws ClientResponseException if the status code of response is 4xx
343
+	 * @throws ServerResponseException if the status code of response is 5xx
344
+	 *
345
+	 * @return Elasticsearch|Promise
346
+	 */
347
+	public function stop(array $params = [])
348
+	{
349
+		$url = '/_ilm/stop';
350
+		$method = 'POST';
351
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
352
+		$headers = ['Accept' => 'application/json'];
353
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
354
+	}
355 355
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function deleteLifecycle(array $params = [])
50 50
     {
51 51
         $this->checkRequiredParameters(['policy'], $params);
52
-        $url = '/_ilm/policy/' . $this->encode($params['policy']);
52
+        $url = '/_ilm/policy/'.$this->encode($params['policy']);
53 53
         $method = 'DELETE';
54 54
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55 55
         $headers = ['Accept' => 'application/json'];
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function explainLifecycle(array $params = [])
82 82
     {
83 83
         $this->checkRequiredParameters(['index'], $params);
84
-        $url = '/' . $this->encode($params['index']) . '/_ilm/explain';
84
+        $url = '/'.$this->encode($params['index']).'/_ilm/explain';
85 85
         $method = 'GET';
86 86
         $url = $this->addQueryString($url, $params, ['only_managed', 'only_errors', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
87 87
         $headers = ['Accept' => 'application/json'];
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     public function getLifecycle(array $params = [])
111 111
     {
112 112
         if (isset($params['policy'])) {
113
-            $url = '/_ilm/policy/' . $this->encode($params['policy']);
113
+            $url = '/_ilm/policy/'.$this->encode($params['policy']);
114 114
             $method = 'GET';
115 115
         } else {
116 116
             $url = '/_ilm/policy';
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     public function moveToStep(array $params = [])
202 202
     {
203 203
         $this->checkRequiredParameters(['index'], $params);
204
-        $url = '/_ilm/move/' . $this->encode($params['index']);
204
+        $url = '/_ilm/move/'.$this->encode($params['index']);
205 205
         $method = 'POST';
206 206
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
207 207
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     public function putLifecycle(array $params = [])
233 233
     {
234 234
         $this->checkRequiredParameters(['policy'], $params);
235
-        $url = '/_ilm/policy/' . $this->encode($params['policy']);
235
+        $url = '/_ilm/policy/'.$this->encode($params['policy']);
236 236
         $method = 'PUT';
237 237
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
238 238
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     public function removePolicy(array $params = [])
263 263
     {
264 264
         $this->checkRequiredParameters(['index'], $params);
265
-        $url = '/' . $this->encode($params['index']) . '/_ilm/remove';
265
+        $url = '/'.$this->encode($params['index']).'/_ilm/remove';
266 266
         $method = 'POST';
267 267
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
268 268
         $headers = ['Accept' => 'application/json'];
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     public function retry(array $params = [])
293 293
     {
294 294
         $this->checkRequiredParameters(['index'], $params);
295
-        $url = '/' . $this->encode($params['index']) . '/_ilm/retry';
295
+        $url = '/'.$this->encode($params['index']).'/_ilm/retry';
296 296
         $method = 'POST';
297 297
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
298 298
         $headers = ['Accept' => 'application/json'];
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Ilm extends AbstractEndpoint
27
-{
26
+class Ilm extends AbstractEndpoint {
28 27
     /**
29 28
      * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Migration.php 3 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -25,91 +25,91 @@
 block discarded – undo
25 25
  */
26 26
 class Migration extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * 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.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html
32
-     *
33
-     * @param array{
34
-     *     index: string, //  Index pattern
35
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
36
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
37
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
38
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
39
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
40
-     * } $params
41
-     *
42
-     * @throws NoNodeAvailableException if all the hosts are offline
43
-     * @throws ClientResponseException if the status code of response is 4xx
44
-     * @throws ServerResponseException if the status code of response is 5xx
45
-     *
46
-     * @return Elasticsearch|Promise
47
-     */
48
-    public function deprecations(array $params = [])
49
-    {
50
-        if (isset($params['index'])) {
51
-            $url = '/' . $this->encode($params['index']) . '/_migration/deprecations';
52
-            $method = 'GET';
53
-        } else {
54
-            $url = '/_migration/deprecations';
55
-            $method = 'GET';
56
-        }
57
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
58
-        $headers = ['Accept' => 'application/json'];
59
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
60
-    }
61
-    /**
62
-     * Find out whether system features need to be upgraded or not
63
-     *
64
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html
65
-     *
66
-     * @param array{
67
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
-     * } $params
73
-     *
74
-     * @throws NoNodeAvailableException if all the hosts are offline
75
-     * @throws ClientResponseException if the status code of response is 4xx
76
-     * @throws ServerResponseException if the status code of response is 5xx
77
-     *
78
-     * @return Elasticsearch|Promise
79
-     */
80
-    public function getFeatureUpgradeStatus(array $params = [])
81
-    {
82
-        $url = '/_migration/system_features';
83
-        $method = 'GET';
84
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
85
-        $headers = ['Accept' => 'application/json'];
86
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
87
-    }
88
-    /**
89
-     * Begin upgrades for system features
90
-     *
91
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html
92
-     *
93
-     * @param array{
94
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
95
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
96
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
97
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
98
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
99
-     * } $params
100
-     *
101
-     * @throws NoNodeAvailableException if all the hosts are offline
102
-     * @throws ClientResponseException if the status code of response is 4xx
103
-     * @throws ServerResponseException if the status code of response is 5xx
104
-     *
105
-     * @return Elasticsearch|Promise
106
-     */
107
-    public function postFeatureUpgrade(array $params = [])
108
-    {
109
-        $url = '/_migration/system_features';
110
-        $method = 'POST';
111
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
112
-        $headers = ['Accept' => 'application/json'];
113
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
114
-    }
28
+	/**
29
+	 * 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.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html
32
+	 *
33
+	 * @param array{
34
+	 *     index: string, //  Index pattern
35
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
36
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
37
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
38
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
39
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
40
+	 * } $params
41
+	 *
42
+	 * @throws NoNodeAvailableException if all the hosts are offline
43
+	 * @throws ClientResponseException if the status code of response is 4xx
44
+	 * @throws ServerResponseException if the status code of response is 5xx
45
+	 *
46
+	 * @return Elasticsearch|Promise
47
+	 */
48
+	public function deprecations(array $params = [])
49
+	{
50
+		if (isset($params['index'])) {
51
+			$url = '/' . $this->encode($params['index']) . '/_migration/deprecations';
52
+			$method = 'GET';
53
+		} else {
54
+			$url = '/_migration/deprecations';
55
+			$method = 'GET';
56
+		}
57
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
58
+		$headers = ['Accept' => 'application/json'];
59
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
60
+	}
61
+	/**
62
+	 * Find out whether system features need to be upgraded or not
63
+	 *
64
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html
65
+	 *
66
+	 * @param array{
67
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
68
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
69
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
70
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
71
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
72
+	 * } $params
73
+	 *
74
+	 * @throws NoNodeAvailableException if all the hosts are offline
75
+	 * @throws ClientResponseException if the status code of response is 4xx
76
+	 * @throws ServerResponseException if the status code of response is 5xx
77
+	 *
78
+	 * @return Elasticsearch|Promise
79
+	 */
80
+	public function getFeatureUpgradeStatus(array $params = [])
81
+	{
82
+		$url = '/_migration/system_features';
83
+		$method = 'GET';
84
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
85
+		$headers = ['Accept' => 'application/json'];
86
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
87
+	}
88
+	/**
89
+	 * Begin upgrades for system features
90
+	 *
91
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html
92
+	 *
93
+	 * @param array{
94
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
95
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
96
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
97
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
98
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
99
+	 * } $params
100
+	 *
101
+	 * @throws NoNodeAvailableException if all the hosts are offline
102
+	 * @throws ClientResponseException if the status code of response is 4xx
103
+	 * @throws ServerResponseException if the status code of response is 5xx
104
+	 *
105
+	 * @return Elasticsearch|Promise
106
+	 */
107
+	public function postFeatureUpgrade(array $params = [])
108
+	{
109
+		$url = '/_migration/system_features';
110
+		$method = 'POST';
111
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
112
+		$headers = ['Accept' => 'application/json'];
113
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
114
+	}
115 115
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function deprecations(array $params = [])
49 49
     {
50 50
         if (isset($params['index'])) {
51
-            $url = '/' . $this->encode($params['index']) . '/_migration/deprecations';
51
+            $url = '/'.$this->encode($params['index']).'/_migration/deprecations';
52 52
             $method = 'GET';
53 53
         } else {
54 54
             $url = '/_migration/deprecations';
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Migration extends AbstractEndpoint
27
-{
26
+class Migration extends AbstractEndpoint {
28 27
     /**
29 28
      * 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.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Autoscaling.php 3 patches
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -25,122 +25,122 @@
 block discarded – undo
25 25
  */
26 26
 class Autoscaling extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html
32
-     *
33
-     * @param array{
34
-     *     name: string, // (REQUIRED) the name of the autoscaling policy
35
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
36
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
37
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
38
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
39
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
40
-     * } $params
41
-     *
42
-     * @throws MissingParameterException if a required parameter is missing
43
-     * @throws NoNodeAvailableException if all the hosts are offline
44
-     * @throws ClientResponseException if the status code of response is 4xx
45
-     * @throws ServerResponseException if the status code of response is 5xx
46
-     *
47
-     * @return Elasticsearch|Promise
48
-     */
49
-    public function deleteAutoscalingPolicy(array $params = [])
50
-    {
51
-        $this->checkRequiredParameters(['name'], $params);
52
-        $url = '/_autoscaling/policy/' . $this->encode($params['name']);
53
-        $method = 'DELETE';
54
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
-        $headers = ['Accept' => 'application/json'];
56
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
57
-    }
58
-    /**
59
-     * 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.
60
-     *
61
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
62
-     *
63
-     * @param array{
64
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
65
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
66
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
67
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
68
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
69
-     * } $params
70
-     *
71
-     * @throws NoNodeAvailableException if all the hosts are offline
72
-     * @throws ClientResponseException if the status code of response is 4xx
73
-     * @throws ServerResponseException if the status code of response is 5xx
74
-     *
75
-     * @return Elasticsearch|Promise
76
-     */
77
-    public function getAutoscalingCapacity(array $params = [])
78
-    {
79
-        $url = '/_autoscaling/capacity';
80
-        $method = 'GET';
81
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
82
-        $headers = ['Accept' => 'application/json'];
83
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
84
-    }
85
-    /**
86
-     * Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
87
-     *
88
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html
89
-     *
90
-     * @param array{
91
-     *     name: string, // (REQUIRED) the name of the autoscaling policy
92
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
93
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
94
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
95
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
96
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
97
-     * } $params
98
-     *
99
-     * @throws MissingParameterException if a required parameter is missing
100
-     * @throws NoNodeAvailableException if all the hosts are offline
101
-     * @throws ClientResponseException if the status code of response is 4xx
102
-     * @throws ServerResponseException if the status code of response is 5xx
103
-     *
104
-     * @return Elasticsearch|Promise
105
-     */
106
-    public function getAutoscalingPolicy(array $params = [])
107
-    {
108
-        $this->checkRequiredParameters(['name'], $params);
109
-        $url = '/_autoscaling/policy/' . $this->encode($params['name']);
110
-        $method = 'GET';
111
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
112
-        $headers = ['Accept' => 'application/json'];
113
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
114
-    }
115
-    /**
116
-     * Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
117
-     *
118
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html
119
-     *
120
-     * @param array{
121
-     *     name: string, // (REQUIRED) the name of the autoscaling policy
122
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
123
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
124
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
125
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
126
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
127
-     *     body: array, // (REQUIRED) the specification of the autoscaling policy
128
-     * } $params
129
-     *
130
-     * @throws MissingParameterException if a required parameter is missing
131
-     * @throws NoNodeAvailableException if all the hosts are offline
132
-     * @throws ClientResponseException if the status code of response is 4xx
133
-     * @throws ServerResponseException if the status code of response is 5xx
134
-     *
135
-     * @return Elasticsearch|Promise
136
-     */
137
-    public function putAutoscalingPolicy(array $params = [])
138
-    {
139
-        $this->checkRequiredParameters(['name', 'body'], $params);
140
-        $url = '/_autoscaling/policy/' . $this->encode($params['name']);
141
-        $method = 'PUT';
142
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
143
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
144
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
145
-    }
28
+	/**
29
+	 * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html
32
+	 *
33
+	 * @param array{
34
+	 *     name: string, // (REQUIRED) the name of the autoscaling policy
35
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
36
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
37
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
38
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
39
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
40
+	 * } $params
41
+	 *
42
+	 * @throws MissingParameterException if a required parameter is missing
43
+	 * @throws NoNodeAvailableException if all the hosts are offline
44
+	 * @throws ClientResponseException if the status code of response is 4xx
45
+	 * @throws ServerResponseException if the status code of response is 5xx
46
+	 *
47
+	 * @return Elasticsearch|Promise
48
+	 */
49
+	public function deleteAutoscalingPolicy(array $params = [])
50
+	{
51
+		$this->checkRequiredParameters(['name'], $params);
52
+		$url = '/_autoscaling/policy/' . $this->encode($params['name']);
53
+		$method = 'DELETE';
54
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
+		$headers = ['Accept' => 'application/json'];
56
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
57
+	}
58
+	/**
59
+	 * 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.
60
+	 *
61
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
62
+	 *
63
+	 * @param array{
64
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
65
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
66
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
67
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
68
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
69
+	 * } $params
70
+	 *
71
+	 * @throws NoNodeAvailableException if all the hosts are offline
72
+	 * @throws ClientResponseException if the status code of response is 4xx
73
+	 * @throws ServerResponseException if the status code of response is 5xx
74
+	 *
75
+	 * @return Elasticsearch|Promise
76
+	 */
77
+	public function getAutoscalingCapacity(array $params = [])
78
+	{
79
+		$url = '/_autoscaling/capacity';
80
+		$method = 'GET';
81
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
82
+		$headers = ['Accept' => 'application/json'];
83
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
84
+	}
85
+	/**
86
+	 * Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
87
+	 *
88
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html
89
+	 *
90
+	 * @param array{
91
+	 *     name: string, // (REQUIRED) the name of the autoscaling policy
92
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
93
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
94
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
95
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
96
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
97
+	 * } $params
98
+	 *
99
+	 * @throws MissingParameterException if a required parameter is missing
100
+	 * @throws NoNodeAvailableException if all the hosts are offline
101
+	 * @throws ClientResponseException if the status code of response is 4xx
102
+	 * @throws ServerResponseException if the status code of response is 5xx
103
+	 *
104
+	 * @return Elasticsearch|Promise
105
+	 */
106
+	public function getAutoscalingPolicy(array $params = [])
107
+	{
108
+		$this->checkRequiredParameters(['name'], $params);
109
+		$url = '/_autoscaling/policy/' . $this->encode($params['name']);
110
+		$method = 'GET';
111
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
112
+		$headers = ['Accept' => 'application/json'];
113
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
114
+	}
115
+	/**
116
+	 * Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
117
+	 *
118
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html
119
+	 *
120
+	 * @param array{
121
+	 *     name: string, // (REQUIRED) the name of the autoscaling policy
122
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
123
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
124
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
125
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
126
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
127
+	 *     body: array, // (REQUIRED) the specification of the autoscaling policy
128
+	 * } $params
129
+	 *
130
+	 * @throws MissingParameterException if a required parameter is missing
131
+	 * @throws NoNodeAvailableException if all the hosts are offline
132
+	 * @throws ClientResponseException if the status code of response is 4xx
133
+	 * @throws ServerResponseException if the status code of response is 5xx
134
+	 *
135
+	 * @return Elasticsearch|Promise
136
+	 */
137
+	public function putAutoscalingPolicy(array $params = [])
138
+	{
139
+		$this->checkRequiredParameters(['name', 'body'], $params);
140
+		$url = '/_autoscaling/policy/' . $this->encode($params['name']);
141
+		$method = 'PUT';
142
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
143
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
144
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
145
+	}
146 146
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function deleteAutoscalingPolicy(array $params = [])
50 50
     {
51 51
         $this->checkRequiredParameters(['name'], $params);
52
-        $url = '/_autoscaling/policy/' . $this->encode($params['name']);
52
+        $url = '/_autoscaling/policy/'.$this->encode($params['name']);
53 53
         $method = 'DELETE';
54 54
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55 55
         $headers = ['Accept' => 'application/json'];
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     public function getAutoscalingPolicy(array $params = [])
107 107
     {
108 108
         $this->checkRequiredParameters(['name'], $params);
109
-        $url = '/_autoscaling/policy/' . $this->encode($params['name']);
109
+        $url = '/_autoscaling/policy/'.$this->encode($params['name']);
110 110
         $method = 'GET';
111 111
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
112 112
         $headers = ['Accept' => 'application/json'];
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function putAutoscalingPolicy(array $params = [])
138 138
     {
139 139
         $this->checkRequiredParameters(['name', 'body'], $params);
140
-        $url = '/_autoscaling/policy/' . $this->encode($params['name']);
140
+        $url = '/_autoscaling/policy/'.$this->encode($params['name']);
141 141
         $method = 'PUT';
142 142
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
143 143
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Autoscaling extends AbstractEndpoint
27
-{
26
+class Autoscaling extends AbstractEndpoint {
28 27
     /**
29 28
      * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Indices.php 3 patches
Indentation   +2115 added lines, -2115 removed lines patch added patch discarded remove patch
@@ -25,2119 +25,2119 @@
 block discarded – undo
25 25
  */
26 26
 class Indices extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Adds a block to an index.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html
32
-     *
33
-     * @param array{
34
-     *     index: list, // (REQUIRED) A comma separated list of indices to add a block to
35
-     *     block: string, // (REQUIRED) The block to add (one of read, write, read_only or metadata)
36
-     *     timeout: time, // Explicit operation timeout
37
-     *     master_timeout: time, // Specify timeout for connection to master
38
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
39
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
40
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
41
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
42
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
43
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
44
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
45
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
46
-     * } $params
47
-     *
48
-     * @throws MissingParameterException if a required parameter is missing
49
-     * @throws NoNodeAvailableException if all the hosts are offline
50
-     * @throws ClientResponseException if the status code of response is 4xx
51
-     * @throws ServerResponseException if the status code of response is 5xx
52
-     *
53
-     * @return Elasticsearch|Promise
54
-     */
55
-    public function addBlock(array $params = [])
56
-    {
57
-        $this->checkRequiredParameters(['index', 'block'], $params);
58
-        $url = '/' . $this->encode($params['index']) . '/_block/' . $this->encode($params['block']);
59
-        $method = 'PUT';
60
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
61
-        $headers = ['Accept' => 'application/json'];
62
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
63
-    }
64
-    /**
65
-     * Performs the analysis process on a text and return the tokens breakdown of the text.
66
-     *
67
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html
68
-     *
69
-     * @param array{
70
-     *     index: string, //  The name of the index to scope the operation
71
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
72
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
73
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
74
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
75
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
76
-     *     body: array, //  Define analyzer/tokenizer parameters and the text on which the analysis should be performed
77
-     * } $params
78
-     *
79
-     * @throws NoNodeAvailableException if all the hosts are offline
80
-     * @throws ClientResponseException if the status code of response is 4xx
81
-     * @throws ServerResponseException if the status code of response is 5xx
82
-     *
83
-     * @return Elasticsearch|Promise
84
-     */
85
-    public function analyze(array $params = [])
86
-    {
87
-        if (isset($params['index'])) {
88
-            $url = '/' . $this->encode($params['index']) . '/_analyze';
89
-            $method = empty($params['body']) ? 'GET' : 'POST';
90
-        } else {
91
-            $url = '/_analyze';
92
-            $method = empty($params['body']) ? 'GET' : 'POST';
93
-        }
94
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
95
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
96
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
97
-    }
98
-    /**
99
-     * Clears all or specific caches for one or more indices.
100
-     *
101
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html
102
-     *
103
-     * @param array{
104
-     *     index: list, //  A comma-separated list of index name to limit the operation
105
-     *     fielddata: boolean, // Clear field data
106
-     *     fields: list, // A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
107
-     *     query: boolean, // Clear query caches
108
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
109
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
110
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
111
-     *     request: boolean, // Clear request cache
112
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
113
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
114
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
115
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
116
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
117
-     * } $params
118
-     *
119
-     * @throws NoNodeAvailableException if all the hosts are offline
120
-     * @throws ClientResponseException if the status code of response is 4xx
121
-     * @throws ServerResponseException if the status code of response is 5xx
122
-     *
123
-     * @return Elasticsearch|Promise
124
-     */
125
-    public function clearCache(array $params = [])
126
-    {
127
-        if (isset($params['index'])) {
128
-            $url = '/' . $this->encode($params['index']) . '/_cache/clear';
129
-            $method = 'POST';
130
-        } else {
131
-            $url = '/_cache/clear';
132
-            $method = 'POST';
133
-        }
134
-        $url = $this->addQueryString($url, $params, ['fielddata', 'fields', 'query', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'request', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
135
-        $headers = ['Accept' => 'application/json'];
136
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
137
-    }
138
-    /**
139
-     * Clones an index
140
-     *
141
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html
142
-     *
143
-     * @param array{
144
-     *     index: string, // (REQUIRED) The name of the source index to clone
145
-     *     target: string, // (REQUIRED) The name of the target index to clone into
146
-     *     timeout: time, // Explicit operation timeout
147
-     *     master_timeout: time, // Specify timeout for connection to master
148
-     *     wait_for_active_shards: string, // Set the number of active shards to wait for on the cloned index before the operation returns.
149
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
150
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
151
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
152
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
153
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
154
-     *     body: array, //  The configuration for the target index (`settings` and `aliases`)
155
-     * } $params
156
-     *
157
-     * @throws MissingParameterException if a required parameter is missing
158
-     * @throws NoNodeAvailableException if all the hosts are offline
159
-     * @throws ClientResponseException if the status code of response is 4xx
160
-     * @throws ServerResponseException if the status code of response is 5xx
161
-     *
162
-     * @return Elasticsearch|Promise
163
-     */
164
-    public function clone(array $params = [])
165
-    {
166
-        $this->checkRequiredParameters(['index', 'target'], $params);
167
-        $url = '/' . $this->encode($params['index']) . '/_clone/' . $this->encode($params['target']);
168
-        $method = 'PUT';
169
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
170
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
171
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
172
-    }
173
-    /**
174
-     * Closes an index.
175
-     *
176
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
177
-     *
178
-     * @param array{
179
-     *     index: list, // (REQUIRED) A comma separated list of indices to close
180
-     *     timeout: time, // Explicit operation timeout
181
-     *     master_timeout: time, // Specify timeout for connection to master
182
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
183
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
184
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
185
-     *     wait_for_active_shards: string, // Sets the number of active shards to wait for before the operation returns.
186
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
187
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
188
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
189
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
190
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
191
-     * } $params
192
-     *
193
-     * @throws MissingParameterException if a required parameter is missing
194
-     * @throws NoNodeAvailableException if all the hosts are offline
195
-     * @throws ClientResponseException if the status code of response is 4xx
196
-     * @throws ServerResponseException if the status code of response is 5xx
197
-     *
198
-     * @return Elasticsearch|Promise
199
-     */
200
-    public function close(array $params = [])
201
-    {
202
-        $this->checkRequiredParameters(['index'], $params);
203
-        $url = '/' . $this->encode($params['index']) . '/_close';
204
-        $method = 'POST';
205
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
206
-        $headers = ['Accept' => 'application/json'];
207
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
208
-    }
209
-    /**
210
-     * Creates an index with optional settings and mappings.
211
-     *
212
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html
213
-     *
214
-     * @param array{
215
-     *     index: string, // (REQUIRED) The name of the index
216
-     *     wait_for_active_shards: string, // Set the number of active shards to wait for before the operation returns.
217
-     *     timeout: time, // Explicit operation timeout
218
-     *     master_timeout: time, // Specify timeout for connection to master
219
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
220
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
221
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
222
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
223
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
224
-     *     body: array, //  The configuration for the index (`settings` and `mappings`)
225
-     * } $params
226
-     *
227
-     * @throws MissingParameterException if a required parameter is missing
228
-     * @throws NoNodeAvailableException if all the hosts are offline
229
-     * @throws ClientResponseException if the status code of response is 4xx
230
-     * @throws ServerResponseException if the status code of response is 5xx
231
-     *
232
-     * @return Elasticsearch|Promise
233
-     */
234
-    public function create(array $params = [])
235
-    {
236
-        $this->checkRequiredParameters(['index'], $params);
237
-        $url = '/' . $this->encode($params['index']);
238
-        $method = 'PUT';
239
-        $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
240
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
241
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
242
-    }
243
-    /**
244
-     * Creates a data stream
245
-     *
246
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
247
-     *
248
-     * @param array{
249
-     *     name: string, // (REQUIRED) The name of the data stream
250
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
251
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
252
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
253
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
254
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
255
-     * } $params
256
-     *
257
-     * @throws MissingParameterException if a required parameter is missing
258
-     * @throws NoNodeAvailableException if all the hosts are offline
259
-     * @throws ClientResponseException if the status code of response is 4xx
260
-     * @throws ServerResponseException if the status code of response is 5xx
261
-     *
262
-     * @return Elasticsearch|Promise
263
-     */
264
-    public function createDataStream(array $params = [])
265
-    {
266
-        $this->checkRequiredParameters(['name'], $params);
267
-        $url = '/_data_stream/' . $this->encode($params['name']);
268
-        $method = 'PUT';
269
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
270
-        $headers = ['Accept' => 'application/json'];
271
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
272
-    }
273
-    /**
274
-     * Provides statistics on operations happening in a data stream.
275
-     *
276
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
277
-     *
278
-     * @param array{
279
-     *     name: list, //  A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams
280
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
281
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
282
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
283
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
284
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
285
-     * } $params
286
-     *
287
-     * @throws NoNodeAvailableException if all the hosts are offline
288
-     * @throws ClientResponseException if the status code of response is 4xx
289
-     * @throws ServerResponseException if the status code of response is 5xx
290
-     *
291
-     * @return Elasticsearch|Promise
292
-     */
293
-    public function dataStreamsStats(array $params = [])
294
-    {
295
-        if (isset($params['name'])) {
296
-            $url = '/_data_stream/' . $this->encode($params['name']) . '/_stats';
297
-            $method = 'GET';
298
-        } else {
299
-            $url = '/_data_stream/_stats';
300
-            $method = 'GET';
301
-        }
302
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
303
-        $headers = ['Accept' => 'application/json'];
304
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
305
-    }
306
-    /**
307
-     * Deletes an index.
308
-     *
309
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html
310
-     *
311
-     * @param array{
312
-     *     index: list, // (REQUIRED) A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
313
-     *     timeout: time, // Explicit operation timeout
314
-     *     master_timeout: time, // Specify timeout for connection to master
315
-     *     ignore_unavailable: boolean, // Ignore unavailable indexes (default: false)
316
-     *     allow_no_indices: boolean, // Ignore if a wildcard expression resolves to no concrete indices (default: false)
317
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open, closed, or hidden indices
318
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
319
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
320
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
321
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
322
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
323
-     * } $params
324
-     *
325
-     * @throws MissingParameterException if a required parameter is missing
326
-     * @throws NoNodeAvailableException if all the hosts are offline
327
-     * @throws ClientResponseException if the status code of response is 4xx
328
-     * @throws ServerResponseException if the status code of response is 5xx
329
-     *
330
-     * @return Elasticsearch|Promise
331
-     */
332
-    public function delete(array $params = [])
333
-    {
334
-        $this->checkRequiredParameters(['index'], $params);
335
-        $url = '/' . $this->encode($params['index']);
336
-        $method = 'DELETE';
337
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
338
-        $headers = ['Accept' => 'application/json'];
339
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
340
-    }
341
-    /**
342
-     * Deletes an alias.
343
-     *
344
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
345
-     *
346
-     * @param array{
347
-     *     index: list, // (REQUIRED) A comma-separated list of index names (supports wildcards); use `_all` for all indices
348
-     *     name: list, // (REQUIRED) A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
349
-     *     timeout: time, // Explicit timestamp for the document
350
-     *     master_timeout: time, // Specify timeout for connection to master
351
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
352
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
353
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
354
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
355
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
356
-     * } $params
357
-     *
358
-     * @throws MissingParameterException if a required parameter is missing
359
-     * @throws NoNodeAvailableException if all the hosts are offline
360
-     * @throws ClientResponseException if the status code of response is 4xx
361
-     * @throws ServerResponseException if the status code of response is 5xx
362
-     *
363
-     * @return Elasticsearch|Promise
364
-     */
365
-    public function deleteAlias(array $params = [])
366
-    {
367
-        $this->checkRequiredParameters(['index', 'name'], $params);
368
-        $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
369
-        $method = 'DELETE';
370
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
371
-        $headers = ['Accept' => 'application/json'];
372
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
373
-    }
374
-    /**
375
-     * Deletes the data stream lifecycle of the selected data streams.
376
-     *
377
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html
378
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
379
-     *
380
-     * @param array{
381
-     *     name: list, // (REQUIRED) A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams
382
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
383
-     *     timeout: time, // Explicit timestamp for the document
384
-     *     master_timeout: time, // Specify timeout for connection to master
385
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
386
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
387
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
388
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
389
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
390
-     * } $params
391
-     *
392
-     * @throws MissingParameterException if a required parameter is missing
393
-     * @throws NoNodeAvailableException if all the hosts are offline
394
-     * @throws ClientResponseException if the status code of response is 4xx
395
-     * @throws ServerResponseException if the status code of response is 5xx
396
-     *
397
-     * @return Elasticsearch|Promise
398
-     */
399
-    public function deleteDataLifecycle(array $params = [])
400
-    {
401
-        $this->checkRequiredParameters(['name'], $params);
402
-        $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
403
-        $method = 'DELETE';
404
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
405
-        $headers = ['Accept' => 'application/json'];
406
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
407
-    }
408
-    /**
409
-     * Deletes a data stream.
410
-     *
411
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
412
-     *
413
-     * @param array{
414
-     *     name: list, // (REQUIRED) A comma-separated list of data streams to delete; use `*` to delete all data streams
415
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
416
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
417
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
418
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
419
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
420
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
421
-     * } $params
422
-     *
423
-     * @throws MissingParameterException if a required parameter is missing
424
-     * @throws NoNodeAvailableException if all the hosts are offline
425
-     * @throws ClientResponseException if the status code of response is 4xx
426
-     * @throws ServerResponseException if the status code of response is 5xx
427
-     *
428
-     * @return Elasticsearch|Promise
429
-     */
430
-    public function deleteDataStream(array $params = [])
431
-    {
432
-        $this->checkRequiredParameters(['name'], $params);
433
-        $url = '/_data_stream/' . $this->encode($params['name']);
434
-        $method = 'DELETE';
435
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
436
-        $headers = ['Accept' => 'application/json'];
437
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
438
-    }
439
-    /**
440
-     * Deletes an index template.
441
-     *
442
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html
443
-     *
444
-     * @param array{
445
-     *     name: string, // (REQUIRED) The name of the template
446
-     *     timeout: time, // Explicit operation timeout
447
-     *     master_timeout: time, // Specify timeout for connection to master
448
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
449
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
450
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
451
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
452
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
453
-     * } $params
454
-     *
455
-     * @throws MissingParameterException if a required parameter is missing
456
-     * @throws NoNodeAvailableException if all the hosts are offline
457
-     * @throws ClientResponseException if the status code of response is 4xx
458
-     * @throws ServerResponseException if the status code of response is 5xx
459
-     *
460
-     * @return Elasticsearch|Promise
461
-     */
462
-    public function deleteIndexTemplate(array $params = [])
463
-    {
464
-        $this->checkRequiredParameters(['name'], $params);
465
-        $url = '/_index_template/' . $this->encode($params['name']);
466
-        $method = 'DELETE';
467
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
468
-        $headers = ['Accept' => 'application/json'];
469
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
470
-    }
471
-    /**
472
-     * Deletes an index template.
473
-     *
474
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template-v1.html
475
-     *
476
-     * @param array{
477
-     *     name: string, // (REQUIRED) The name of the template
478
-     *     timeout: time, // Explicit operation timeout
479
-     *     master_timeout: time, // Specify timeout for connection to master
480
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
481
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
482
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
483
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
484
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
485
-     * } $params
486
-     *
487
-     * @throws MissingParameterException if a required parameter is missing
488
-     * @throws NoNodeAvailableException if all the hosts are offline
489
-     * @throws ClientResponseException if the status code of response is 4xx
490
-     * @throws ServerResponseException if the status code of response is 5xx
491
-     *
492
-     * @return Elasticsearch|Promise
493
-     */
494
-    public function deleteTemplate(array $params = [])
495
-    {
496
-        $this->checkRequiredParameters(['name'], $params);
497
-        $url = '/_template/' . $this->encode($params['name']);
498
-        $method = 'DELETE';
499
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
500
-        $headers = ['Accept' => 'application/json'];
501
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
502
-    }
503
-    /**
504
-     * Analyzes the disk usage of each field of an index or data stream
505
-     *
506
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html
507
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
508
-     *
509
-     * @param array{
510
-     *     index: string, // (REQUIRED) Comma-separated list of indices or data streams to analyze the disk usage
511
-     *     run_expensive_tasks: boolean, // Must be set to [true] in order for the task to be performed. Defaults to false.
512
-     *     flush: boolean, // Whether flush or not before analyzing the index disk usage. Defaults to true
513
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
514
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
515
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
516
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
517
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
518
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
519
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
520
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
521
-     * } $params
522
-     *
523
-     * @throws MissingParameterException if a required parameter is missing
524
-     * @throws NoNodeAvailableException if all the hosts are offline
525
-     * @throws ClientResponseException if the status code of response is 4xx
526
-     * @throws ServerResponseException if the status code of response is 5xx
527
-     *
528
-     * @return Elasticsearch|Promise
529
-     */
530
-    public function diskUsage(array $params = [])
531
-    {
532
-        $this->checkRequiredParameters(['index'], $params);
533
-        $url = '/' . $this->encode($params['index']) . '/_disk_usage';
534
-        $method = 'POST';
535
-        $url = $this->addQueryString($url, $params, ['run_expensive_tasks', 'flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
536
-        $headers = ['Accept' => 'application/json'];
537
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
538
-    }
539
-    /**
540
-     * Downsample an index
541
-     *
542
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html
543
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
544
-     *
545
-     * @param array{
546
-     *     index: string, // (REQUIRED) The index to downsample
547
-     *     target_index: string, // (REQUIRED) The name of the target index to store downsampled data
548
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
549
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
550
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
551
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
552
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
553
-     *     body: array, // (REQUIRED) The downsampling configuration
554
-     * } $params
555
-     *
556
-     * @throws MissingParameterException if a required parameter is missing
557
-     * @throws NoNodeAvailableException if all the hosts are offline
558
-     * @throws ClientResponseException if the status code of response is 4xx
559
-     * @throws ServerResponseException if the status code of response is 5xx
560
-     *
561
-     * @return Elasticsearch|Promise
562
-     */
563
-    public function downsample(array $params = [])
564
-    {
565
-        $this->checkRequiredParameters(['index', 'target_index', 'body'], $params);
566
-        $url = '/' . $this->encode($params['index']) . '/_downsample/' . $this->encode($params['target_index']);
567
-        $method = 'POST';
568
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
569
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
570
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
571
-    }
572
-    /**
573
-     * Returns information about whether a particular index exists.
574
-     *
575
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html
576
-     *
577
-     * @param array{
578
-     *     index: list, // (REQUIRED) A comma-separated list of index names
579
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
580
-     *     ignore_unavailable: boolean, // Ignore unavailable indexes (default: false)
581
-     *     allow_no_indices: boolean, // Ignore if a wildcard expression resolves to no concrete indices (default: false)
582
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
583
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
584
-     *     include_defaults: boolean, // Whether to return all default setting for each of the indices.
585
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
586
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
587
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
588
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
589
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
590
-     * } $params
591
-     *
592
-     * @throws MissingParameterException if a required parameter is missing
593
-     * @throws NoNodeAvailableException if all the hosts are offline
594
-     * @throws ClientResponseException if the status code of response is 4xx
595
-     * @throws ServerResponseException if the status code of response is 5xx
596
-     *
597
-     * @return Elasticsearch|Promise
598
-     */
599
-    public function exists(array $params = [])
600
-    {
601
-        $this->checkRequiredParameters(['index'], $params);
602
-        $url = '/' . $this->encode($params['index']);
603
-        $method = 'HEAD';
604
-        $url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
605
-        $headers = ['Accept' => 'application/json'];
606
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
607
-    }
608
-    /**
609
-     * Returns information about whether a particular alias exists.
610
-     *
611
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
612
-     *
613
-     * @param array{
614
-     *     name: list, // (REQUIRED) A comma-separated list of alias names to return
615
-     *     index: list, //  A comma-separated list of index names to filter aliases
616
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
617
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
618
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
619
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
620
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
621
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
622
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
623
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
624
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
625
-     * } $params
626
-     *
627
-     * @throws MissingParameterException if a required parameter is missing
628
-     * @throws NoNodeAvailableException if all the hosts are offline
629
-     * @throws ClientResponseException if the status code of response is 4xx
630
-     * @throws ServerResponseException if the status code of response is 5xx
631
-     *
632
-     * @return Elasticsearch|Promise
633
-     */
634
-    public function existsAlias(array $params = [])
635
-    {
636
-        $this->checkRequiredParameters(['name'], $params);
637
-        if (isset($params['index'])) {
638
-            $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
639
-            $method = 'HEAD';
640
-        } else {
641
-            $url = '/_alias/' . $this->encode($params['name']);
642
-            $method = 'HEAD';
643
-        }
644
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
645
-        $headers = ['Accept' => 'application/json'];
646
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
647
-    }
648
-    /**
649
-     * Returns information about whether a particular index template exists.
650
-     *
651
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/index-templates.html
652
-     *
653
-     * @param array{
654
-     *     name: string, // (REQUIRED) The name of the template
655
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
656
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
657
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
658
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
659
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
660
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
661
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
662
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
663
-     * } $params
664
-     *
665
-     * @throws MissingParameterException if a required parameter is missing
666
-     * @throws NoNodeAvailableException if all the hosts are offline
667
-     * @throws ClientResponseException if the status code of response is 4xx
668
-     * @throws ServerResponseException if the status code of response is 5xx
669
-     *
670
-     * @return Elasticsearch|Promise
671
-     */
672
-    public function existsIndexTemplate(array $params = [])
673
-    {
674
-        $this->checkRequiredParameters(['name'], $params);
675
-        $url = '/_index_template/' . $this->encode($params['name']);
676
-        $method = 'HEAD';
677
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
678
-        $headers = ['Accept' => 'application/json'];
679
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
680
-    }
681
-    /**
682
-     * Returns information about whether a particular index template exists.
683
-     *
684
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html
685
-     *
686
-     * @param array{
687
-     *     name: list, // (REQUIRED) The comma separated names of the index templates
688
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
689
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
690
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
691
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
692
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
693
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
694
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
695
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
696
-     * } $params
697
-     *
698
-     * @throws MissingParameterException if a required parameter is missing
699
-     * @throws NoNodeAvailableException if all the hosts are offline
700
-     * @throws ClientResponseException if the status code of response is 4xx
701
-     * @throws ServerResponseException if the status code of response is 5xx
702
-     *
703
-     * @return Elasticsearch|Promise
704
-     */
705
-    public function existsTemplate(array $params = [])
706
-    {
707
-        $this->checkRequiredParameters(['name'], $params);
708
-        $url = '/_template/' . $this->encode($params['name']);
709
-        $method = 'HEAD';
710
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
711
-        $headers = ['Accept' => 'application/json'];
712
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
713
-    }
714
-    /**
715
-     * Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc.
716
-     *
717
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-explain-lifecycle.html
718
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
719
-     *
720
-     * @param array{
721
-     *     index: string, // (REQUIRED) The name of the index to explain
722
-     *     include_defaults: boolean, // indicates if the API should return the default values the system uses for the index's lifecycle
723
-     *     master_timeout: time, // Specify timeout for connection to master
724
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
725
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
726
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
727
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
728
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
729
-     * } $params
730
-     *
731
-     * @throws MissingParameterException if a required parameter is missing
732
-     * @throws NoNodeAvailableException if all the hosts are offline
733
-     * @throws ClientResponseException if the status code of response is 4xx
734
-     * @throws ServerResponseException if the status code of response is 5xx
735
-     *
736
-     * @return Elasticsearch|Promise
737
-     */
738
-    public function explainDataLifecycle(array $params = [])
739
-    {
740
-        $this->checkRequiredParameters(['index'], $params);
741
-        $url = '/' . $this->encode($params['index']) . '/_lifecycle/explain';
742
-        $method = 'GET';
743
-        $url = $this->addQueryString($url, $params, ['include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
744
-        $headers = ['Accept' => 'application/json'];
745
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
746
-    }
747
-    /**
748
-     * Returns the field usage stats for each field of an index
749
-     *
750
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html
751
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
752
-     *
753
-     * @param array{
754
-     *     index: string, // (REQUIRED) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
755
-     *     fields: list, // A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)
756
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
757
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
758
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
759
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
760
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
761
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
762
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
763
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
764
-     * } $params
765
-     *
766
-     * @throws MissingParameterException if a required parameter is missing
767
-     * @throws NoNodeAvailableException if all the hosts are offline
768
-     * @throws ClientResponseException if the status code of response is 4xx
769
-     * @throws ServerResponseException if the status code of response is 5xx
770
-     *
771
-     * @return Elasticsearch|Promise
772
-     */
773
-    public function fieldUsageStats(array $params = [])
774
-    {
775
-        $this->checkRequiredParameters(['index'], $params);
776
-        $url = '/' . $this->encode($params['index']) . '/_field_usage_stats';
777
-        $method = 'GET';
778
-        $url = $this->addQueryString($url, $params, ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
779
-        $headers = ['Accept' => 'application/json'];
780
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
781
-    }
782
-    /**
783
-     * Performs the flush operation on one or more indices.
784
-     *
785
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html
786
-     *
787
-     * @param array{
788
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string for all indices
789
-     *     force: boolean, // 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)
790
-     *     wait_if_ongoing: boolean, // 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.
791
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
792
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
793
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
794
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
795
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
796
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
797
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
798
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
799
-     * } $params
800
-     *
801
-     * @throws NoNodeAvailableException if all the hosts are offline
802
-     * @throws ClientResponseException if the status code of response is 4xx
803
-     * @throws ServerResponseException if the status code of response is 5xx
804
-     *
805
-     * @return Elasticsearch|Promise
806
-     */
807
-    public function flush(array $params = [])
808
-    {
809
-        if (isset($params['index'])) {
810
-            $url = '/' . $this->encode($params['index']) . '/_flush';
811
-            $method = empty($params['body']) ? 'GET' : 'POST';
812
-        } else {
813
-            $url = '/_flush';
814
-            $method = empty($params['body']) ? 'GET' : 'POST';
815
-        }
816
-        $url = $this->addQueryString($url, $params, ['force', 'wait_if_ongoing', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
817
-        $headers = ['Accept' => 'application/json'];
818
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
819
-    }
820
-    /**
821
-     * Performs the force merge operation on one or more indices.
822
-     *
823
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html
824
-     *
825
-     * @param array{
826
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
827
-     *     flush: boolean, // Specify whether the index should be flushed after performing the operation (default: true)
828
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
829
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
830
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
831
-     *     max_num_segments: number, // The number of segments the index should be merged into (default: dynamic)
832
-     *     only_expunge_deletes: boolean, // Specify whether the operation should only expunge deleted documents
833
-     *     wait_for_completion: boolean, // Should the request wait until the force merge is completed.
834
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
835
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
836
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
837
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
838
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
839
-     * } $params
840
-     *
841
-     * @throws NoNodeAvailableException if all the hosts are offline
842
-     * @throws ClientResponseException if the status code of response is 4xx
843
-     * @throws ServerResponseException if the status code of response is 5xx
844
-     *
845
-     * @return Elasticsearch|Promise
846
-     */
847
-    public function forcemerge(array $params = [])
848
-    {
849
-        if (isset($params['index'])) {
850
-            $url = '/' . $this->encode($params['index']) . '/_forcemerge';
851
-            $method = 'POST';
852
-        } else {
853
-            $url = '/_forcemerge';
854
-            $method = 'POST';
855
-        }
856
-        $url = $this->addQueryString($url, $params, ['flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'max_num_segments', 'only_expunge_deletes', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
857
-        $headers = ['Accept' => 'application/json'];
858
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
859
-    }
860
-    /**
861
-     * Returns information about one or more indices.
862
-     *
863
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html
864
-     *
865
-     * @param array{
866
-     *     index: list, // (REQUIRED) A comma-separated list of index names
867
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
868
-     *     ignore_unavailable: boolean, // Ignore unavailable indexes (default: false)
869
-     *     allow_no_indices: boolean, // Ignore if a wildcard expression resolves to no concrete indices (default: false)
870
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
871
-     *     features: enum, // Return only information on specified index features
872
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
873
-     *     include_defaults: boolean, // Whether to return all default setting for each of the indices.
874
-     *     master_timeout: time, // Specify timeout for connection to master
875
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
876
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
877
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
878
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
879
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
880
-     * } $params
881
-     *
882
-     * @throws MissingParameterException if a required parameter is missing
883
-     * @throws NoNodeAvailableException if all the hosts are offline
884
-     * @throws ClientResponseException if the status code of response is 4xx
885
-     * @throws ServerResponseException if the status code of response is 5xx
886
-     *
887
-     * @return Elasticsearch|Promise
888
-     */
889
-    public function get(array $params = [])
890
-    {
891
-        $this->checkRequiredParameters(['index'], $params);
892
-        $url = '/' . $this->encode($params['index']);
893
-        $method = 'GET';
894
-        $url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'features', 'flat_settings', 'include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
895
-        $headers = ['Accept' => 'application/json'];
896
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
897
-    }
898
-    /**
899
-     * Returns an alias.
900
-     *
901
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
902
-     *
903
-     * @param array{
904
-     *     name: list, //  A comma-separated list of alias names to return
905
-     *     index: list, //  A comma-separated list of index names to filter aliases
906
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
907
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
908
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
909
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
910
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
911
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
912
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
913
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
914
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
915
-     * } $params
916
-     *
917
-     * @throws NoNodeAvailableException if all the hosts are offline
918
-     * @throws ClientResponseException if the status code of response is 4xx
919
-     * @throws ServerResponseException if the status code of response is 5xx
920
-     *
921
-     * @return Elasticsearch|Promise
922
-     */
923
-    public function getAlias(array $params = [])
924
-    {
925
-        if (isset($params['index']) && isset($params['name'])) {
926
-            $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
927
-            $method = 'GET';
928
-        } elseif (isset($params['name'])) {
929
-            $url = '/_alias/' . $this->encode($params['name']);
930
-            $method = 'GET';
931
-        } elseif (isset($params['index'])) {
932
-            $url = '/' . $this->encode($params['index']) . '/_alias';
933
-            $method = 'GET';
934
-        } else {
935
-            $url = '/_alias';
936
-            $method = 'GET';
937
-        }
938
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
939
-        $headers = ['Accept' => 'application/json'];
940
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
941
-    }
942
-    /**
943
-     * Returns the data stream lifecycle of the selected data streams.
944
-     *
945
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html
946
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
947
-     *
948
-     * @param array{
949
-     *     name: list, // (REQUIRED) A comma-separated list of data streams to get; use `*` to get all data streams
950
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
951
-     *     include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
952
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
953
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
954
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
955
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
956
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
957
-     * } $params
958
-     *
959
-     * @throws MissingParameterException if a required parameter is missing
960
-     * @throws NoNodeAvailableException if all the hosts are offline
961
-     * @throws ClientResponseException if the status code of response is 4xx
962
-     * @throws ServerResponseException if the status code of response is 5xx
963
-     *
964
-     * @return Elasticsearch|Promise
965
-     */
966
-    public function getDataLifecycle(array $params = [])
967
-    {
968
-        $this->checkRequiredParameters(['name'], $params);
969
-        $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
970
-        $method = 'GET';
971
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
972
-        $headers = ['Accept' => 'application/json'];
973
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
974
-    }
975
-    /**
976
-     * Returns data streams.
977
-     *
978
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
979
-     *
980
-     * @param array{
981
-     *     name: list, //  A comma-separated list of data streams to get; use `*` to get all data streams
982
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
983
-     *     include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
984
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
985
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
986
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
987
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
988
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
989
-     * } $params
990
-     *
991
-     * @throws NoNodeAvailableException if all the hosts are offline
992
-     * @throws ClientResponseException if the status code of response is 4xx
993
-     * @throws ServerResponseException if the status code of response is 5xx
994
-     *
995
-     * @return Elasticsearch|Promise
996
-     */
997
-    public function getDataStream(array $params = [])
998
-    {
999
-        if (isset($params['name'])) {
1000
-            $url = '/_data_stream/' . $this->encode($params['name']);
1001
-            $method = 'GET';
1002
-        } else {
1003
-            $url = '/_data_stream';
1004
-            $method = 'GET';
1005
-        }
1006
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1007
-        $headers = ['Accept' => 'application/json'];
1008
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1009
-    }
1010
-    /**
1011
-     * Returns mapping for one or more fields.
1012
-     *
1013
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html
1014
-     *
1015
-     * @param array{
1016
-     *     fields: list, // (REQUIRED) A comma-separated list of fields
1017
-     *     index: list, //  A comma-separated list of index names
1018
-     *     include_defaults: boolean, // Whether the default mapping values should be returned as well
1019
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1020
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1021
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1022
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1023
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1024
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1025
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1026
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1027
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1028
-     * } $params
1029
-     *
1030
-     * @throws MissingParameterException if a required parameter is missing
1031
-     * @throws NoNodeAvailableException if all the hosts are offline
1032
-     * @throws ClientResponseException if the status code of response is 4xx
1033
-     * @throws ServerResponseException if the status code of response is 5xx
1034
-     *
1035
-     * @return Elasticsearch|Promise
1036
-     */
1037
-    public function getFieldMapping(array $params = [])
1038
-    {
1039
-        $this->checkRequiredParameters(['fields'], $params);
1040
-        if (isset($params['index'])) {
1041
-            $url = '/' . $this->encode($params['index']) . '/_mapping/field/' . $this->encode($params['fields']);
1042
-            $method = 'GET';
1043
-        } else {
1044
-            $url = '/_mapping/field/' . $this->encode($params['fields']);
1045
-            $method = 'GET';
1046
-        }
1047
-        $url = $this->addQueryString($url, $params, ['include_defaults', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1048
-        $headers = ['Accept' => 'application/json'];
1049
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1050
-    }
1051
-    /**
1052
-     * Returns an index template.
1053
-     *
1054
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html
1055
-     *
1056
-     * @param array{
1057
-     *     name: string, //  A pattern that returned template names must match
1058
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
1059
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
1060
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1061
-     *     include_defaults: boolean, // Return all relevant default configurations for the index template (default: false)
1062
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1063
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1064
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1065
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1066
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1067
-     * } $params
1068
-     *
1069
-     * @throws NoNodeAvailableException if all the hosts are offline
1070
-     * @throws ClientResponseException if the status code of response is 4xx
1071
-     * @throws ServerResponseException if the status code of response is 5xx
1072
-     *
1073
-     * @return Elasticsearch|Promise
1074
-     */
1075
-    public function getIndexTemplate(array $params = [])
1076
-    {
1077
-        if (isset($params['name'])) {
1078
-            $url = '/_index_template/' . $this->encode($params['name']);
1079
-            $method = 'GET';
1080
-        } else {
1081
-            $url = '/_index_template';
1082
-            $method = 'GET';
1083
-        }
1084
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1085
-        $headers = ['Accept' => 'application/json'];
1086
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1087
-    }
1088
-    /**
1089
-     * Returns mappings for one or more indices.
1090
-     *
1091
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
1092
-     *
1093
-     * @param array{
1094
-     *     index: list, //  A comma-separated list of index names
1095
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1096
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1097
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1098
-     *     master_timeout: time, // Specify timeout for connection to master
1099
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1100
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1101
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1102
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1103
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1104
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1105
-     * } $params
1106
-     *
1107
-     * @throws NoNodeAvailableException if all the hosts are offline
1108
-     * @throws ClientResponseException if the status code of response is 4xx
1109
-     * @throws ServerResponseException if the status code of response is 5xx
1110
-     *
1111
-     * @return Elasticsearch|Promise
1112
-     */
1113
-    public function getMapping(array $params = [])
1114
-    {
1115
-        if (isset($params['index'])) {
1116
-            $url = '/' . $this->encode($params['index']) . '/_mapping';
1117
-            $method = 'GET';
1118
-        } else {
1119
-            $url = '/_mapping';
1120
-            $method = 'GET';
1121
-        }
1122
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1123
-        $headers = ['Accept' => 'application/json'];
1124
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1125
-    }
1126
-    /**
1127
-     * Returns settings for one or more indices.
1128
-     *
1129
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html
1130
-     *
1131
-     * @param array{
1132
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1133
-     *     name: list, //  The name of the settings that should be included
1134
-     *     master_timeout: time, // Specify timeout for connection to master
1135
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1136
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1137
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1138
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
1139
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1140
-     *     include_defaults: boolean, // Whether to return all default setting for each of the indices.
1141
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1142
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1143
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1144
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1145
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1146
-     * } $params
1147
-     *
1148
-     * @throws NoNodeAvailableException if all the hosts are offline
1149
-     * @throws ClientResponseException if the status code of response is 4xx
1150
-     * @throws ServerResponseException if the status code of response is 5xx
1151
-     *
1152
-     * @return Elasticsearch|Promise
1153
-     */
1154
-    public function getSettings(array $params = [])
1155
-    {
1156
-        if (isset($params['index']) && isset($params['name'])) {
1157
-            $url = '/' . $this->encode($params['index']) . '/_settings/' . $this->encode($params['name']);
1158
-            $method = 'GET';
1159
-        } elseif (isset($params['index'])) {
1160
-            $url = '/' . $this->encode($params['index']) . '/_settings';
1161
-            $method = 'GET';
1162
-        } elseif (isset($params['name'])) {
1163
-            $url = '/_settings/' . $this->encode($params['name']);
1164
-            $method = 'GET';
1165
-        } else {
1166
-            $url = '/_settings';
1167
-            $method = 'GET';
1168
-        }
1169
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1170
-        $headers = ['Accept' => 'application/json'];
1171
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1172
-    }
1173
-    /**
1174
-     * Returns an index template.
1175
-     *
1176
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html
1177
-     *
1178
-     * @param array{
1179
-     *     name: list, //  The comma separated names of the index templates
1180
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
1181
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
1182
-     *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1183
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1184
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1185
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1186
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1187
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1188
-     * } $params
1189
-     *
1190
-     * @throws NoNodeAvailableException if all the hosts are offline
1191
-     * @throws ClientResponseException if the status code of response is 4xx
1192
-     * @throws ServerResponseException if the status code of response is 5xx
1193
-     *
1194
-     * @return Elasticsearch|Promise
1195
-     */
1196
-    public function getTemplate(array $params = [])
1197
-    {
1198
-        if (isset($params['name'])) {
1199
-            $url = '/_template/' . $this->encode($params['name']);
1200
-            $method = 'GET';
1201
-        } else {
1202
-            $url = '/_template';
1203
-            $method = 'GET';
1204
-        }
1205
-        $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1206
-        $headers = ['Accept' => 'application/json'];
1207
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1208
-    }
1209
-    /**
1210
-     * Migrates an alias to a data stream
1211
-     *
1212
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
1213
-     *
1214
-     * @param array{
1215
-     *     name: string, // (REQUIRED) The name of the alias to migrate
1216
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1217
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1218
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1219
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1220
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1221
-     * } $params
1222
-     *
1223
-     * @throws MissingParameterException if a required parameter is missing
1224
-     * @throws NoNodeAvailableException if all the hosts are offline
1225
-     * @throws ClientResponseException if the status code of response is 4xx
1226
-     * @throws ServerResponseException if the status code of response is 5xx
1227
-     *
1228
-     * @return Elasticsearch|Promise
1229
-     */
1230
-    public function migrateToDataStream(array $params = [])
1231
-    {
1232
-        $this->checkRequiredParameters(['name'], $params);
1233
-        $url = '/_data_stream/_migrate/' . $this->encode($params['name']);
1234
-        $method = 'POST';
1235
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1236
-        $headers = ['Accept' => 'application/json'];
1237
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1238
-    }
1239
-    /**
1240
-     * Modifies a data stream
1241
-     *
1242
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
1243
-     *
1244
-     * @param array{
1245
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1246
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1247
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1248
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1249
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1250
-     *     body: array, // (REQUIRED) The data stream modifications
1251
-     * } $params
1252
-     *
1253
-     * @throws NoNodeAvailableException if all the hosts are offline
1254
-     * @throws ClientResponseException if the status code of response is 4xx
1255
-     * @throws ServerResponseException if the status code of response is 5xx
1256
-     *
1257
-     * @return Elasticsearch|Promise
1258
-     */
1259
-    public function modifyDataStream(array $params = [])
1260
-    {
1261
-        $this->checkRequiredParameters(['body'], $params);
1262
-        $url = '/_data_stream/_modify';
1263
-        $method = 'POST';
1264
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1265
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1266
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1267
-    }
1268
-    /**
1269
-     * Opens an index.
1270
-     *
1271
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
1272
-     *
1273
-     * @param array{
1274
-     *     index: list, // (REQUIRED) A comma separated list of indices to open
1275
-     *     timeout: time, // Explicit operation timeout
1276
-     *     master_timeout: time, // Specify timeout for connection to master
1277
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1278
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1279
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1280
-     *     wait_for_active_shards: string, // Sets the number of active shards to wait for before the operation returns.
1281
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1282
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1283
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1284
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1285
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1286
-     * } $params
1287
-     *
1288
-     * @throws MissingParameterException if a required parameter is missing
1289
-     * @throws NoNodeAvailableException if all the hosts are offline
1290
-     * @throws ClientResponseException if the status code of response is 4xx
1291
-     * @throws ServerResponseException if the status code of response is 5xx
1292
-     *
1293
-     * @return Elasticsearch|Promise
1294
-     */
1295
-    public function open(array $params = [])
1296
-    {
1297
-        $this->checkRequiredParameters(['index'], $params);
1298
-        $url = '/' . $this->encode($params['index']) . '/_open';
1299
-        $method = 'POST';
1300
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1301
-        $headers = ['Accept' => 'application/json'];
1302
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1303
-    }
1304
-    /**
1305
-     * Promotes a data stream from a replicated data stream managed by CCR to a regular data stream
1306
-     *
1307
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
1308
-     *
1309
-     * @param array{
1310
-     *     name: string, // (REQUIRED) The name of the data stream
1311
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1312
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1313
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1314
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1315
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1316
-     * } $params
1317
-     *
1318
-     * @throws MissingParameterException if a required parameter is missing
1319
-     * @throws NoNodeAvailableException if all the hosts are offline
1320
-     * @throws ClientResponseException if the status code of response is 4xx
1321
-     * @throws ServerResponseException if the status code of response is 5xx
1322
-     *
1323
-     * @return Elasticsearch|Promise
1324
-     */
1325
-    public function promoteDataStream(array $params = [])
1326
-    {
1327
-        $this->checkRequiredParameters(['name'], $params);
1328
-        $url = '/_data_stream/_promote/' . $this->encode($params['name']);
1329
-        $method = 'POST';
1330
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1331
-        $headers = ['Accept' => 'application/json'];
1332
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1333
-    }
1334
-    /**
1335
-     * Creates or updates an alias.
1336
-     *
1337
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
1338
-     *
1339
-     * @param array{
1340
-     *     index: list, // (REQUIRED) A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
1341
-     *     name: string, // (REQUIRED) The name of the alias to be created or updated
1342
-     *     timeout: time, // Explicit timestamp for the document
1343
-     *     master_timeout: time, // Specify timeout for connection to master
1344
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1345
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1346
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1347
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1348
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1349
-     *     body: array, //  The settings for the alias, such as `routing` or `filter`
1350
-     * } $params
1351
-     *
1352
-     * @throws MissingParameterException if a required parameter is missing
1353
-     * @throws NoNodeAvailableException if all the hosts are offline
1354
-     * @throws ClientResponseException if the status code of response is 4xx
1355
-     * @throws ServerResponseException if the status code of response is 5xx
1356
-     *
1357
-     * @return Elasticsearch|Promise
1358
-     */
1359
-    public function putAlias(array $params = [])
1360
-    {
1361
-        $this->checkRequiredParameters(['index', 'name'], $params);
1362
-        $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
1363
-        $method = 'PUT';
1364
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1365
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1366
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1367
-    }
1368
-    /**
1369
-     * Updates the data stream lifecycle of the selected data streams.
1370
-     *
1371
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html
1372
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1373
-     *
1374
-     * @param array{
1375
-     *     name: list, // (REQUIRED) A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams
1376
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1377
-     *     timeout: time, // Explicit timestamp for the document
1378
-     *     master_timeout: time, // Specify timeout for connection to master
1379
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1380
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1381
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1382
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1383
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1384
-     *     body: array, //  The data stream lifecycle configuration that consist of the data retention
1385
-     * } $params
1386
-     *
1387
-     * @throws MissingParameterException if a required parameter is missing
1388
-     * @throws NoNodeAvailableException if all the hosts are offline
1389
-     * @throws ClientResponseException if the status code of response is 4xx
1390
-     * @throws ServerResponseException if the status code of response is 5xx
1391
-     *
1392
-     * @return Elasticsearch|Promise
1393
-     */
1394
-    public function putDataLifecycle(array $params = [])
1395
-    {
1396
-        $this->checkRequiredParameters(['name'], $params);
1397
-        $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
1398
-        $method = 'PUT';
1399
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1400
-        $headers = ['Accept' => 'application/json'];
1401
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1402
-    }
1403
-    /**
1404
-     * Creates or updates an index template.
1405
-     *
1406
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html
1407
-     *
1408
-     * @param array{
1409
-     *     name: string, // (REQUIRED) The name of the template
1410
-     *     create: boolean, // Whether the index template should only be added if new or can also replace an existing one
1411
-     *     cause: string, // User defined reason for creating/updating the index template
1412
-     *     master_timeout: time, // Specify timeout for connection to master
1413
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1414
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1415
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1416
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1417
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1418
-     *     body: array, // (REQUIRED) The template definition
1419
-     * } $params
1420
-     *
1421
-     * @throws MissingParameterException if a required parameter is missing
1422
-     * @throws NoNodeAvailableException if all the hosts are offline
1423
-     * @throws ClientResponseException if the status code of response is 4xx
1424
-     * @throws ServerResponseException if the status code of response is 5xx
1425
-     *
1426
-     * @return Elasticsearch|Promise
1427
-     */
1428
-    public function putIndexTemplate(array $params = [])
1429
-    {
1430
-        $this->checkRequiredParameters(['name', 'body'], $params);
1431
-        $url = '/_index_template/' . $this->encode($params['name']);
1432
-        $method = 'PUT';
1433
-        $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1434
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1435
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1436
-    }
1437
-    /**
1438
-     * Updates the index mappings.
1439
-     *
1440
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
1441
-     *
1442
-     * @param array{
1443
-     *     index: list, // (REQUIRED) A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.
1444
-     *     timeout: time, // Explicit operation timeout
1445
-     *     master_timeout: time, // Specify timeout for connection to master
1446
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1447
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1448
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1449
-     *     write_index_only: boolean, // When true, applies mappings only to the write index of an alias or data stream
1450
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1451
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1452
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1453
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1454
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1455
-     *     body: array, // (REQUIRED) The mapping definition
1456
-     * } $params
1457
-     *
1458
-     * @throws MissingParameterException if a required parameter is missing
1459
-     * @throws NoNodeAvailableException if all the hosts are offline
1460
-     * @throws ClientResponseException if the status code of response is 4xx
1461
-     * @throws ServerResponseException if the status code of response is 5xx
1462
-     *
1463
-     * @return Elasticsearch|Promise
1464
-     */
1465
-    public function putMapping(array $params = [])
1466
-    {
1467
-        $this->checkRequiredParameters(['index', 'body'], $params);
1468
-        $url = '/' . $this->encode($params['index']) . '/_mapping';
1469
-        $method = 'PUT';
1470
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'write_index_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1471
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1472
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1473
-    }
1474
-    /**
1475
-     * Updates the index settings.
1476
-     *
1477
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html
1478
-     *
1479
-     * @param array{
1480
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1481
-     *     master_timeout: time, // Specify timeout for connection to master
1482
-     *     timeout: time, // Explicit operation timeout
1483
-     *     preserve_existing: boolean, // Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`
1484
-     *     reopen: boolean, // Whether to close and reopen the index to apply non-dynamic settings. If set to `true` the indices to which the settings are being applied will be closed temporarily and then reopened in order to apply the changes. The default is `false`
1485
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1486
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1487
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1488
-     *     flat_settings: boolean, // Return settings in flat format (default: false)
1489
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1490
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1491
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1492
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1493
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1494
-     *     body: array, // (REQUIRED) The index settings to be updated
1495
-     * } $params
1496
-     *
1497
-     * @throws NoNodeAvailableException if all the hosts are offline
1498
-     * @throws ClientResponseException if the status code of response is 4xx
1499
-     * @throws ServerResponseException if the status code of response is 5xx
1500
-     *
1501
-     * @return Elasticsearch|Promise
1502
-     */
1503
-    public function putSettings(array $params = [])
1504
-    {
1505
-        $this->checkRequiredParameters(['body'], $params);
1506
-        if (isset($params['index'])) {
1507
-            $url = '/' . $this->encode($params['index']) . '/_settings';
1508
-            $method = 'PUT';
1509
-        } else {
1510
-            $url = '/_settings';
1511
-            $method = 'PUT';
1512
-        }
1513
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'preserve_existing', 'reopen', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1514
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1515
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1516
-    }
1517
-    /**
1518
-     * Creates or updates an index template.
1519
-     *
1520
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html
1521
-     *
1522
-     * @param array{
1523
-     *     name: string, // (REQUIRED) The name of the template
1524
-     *     order: number, // The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
1525
-     *     create: boolean, // Whether the index template should only be added if new or can also replace an existing one
1526
-     *     master_timeout: time, // Specify timeout for connection to master
1527
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1528
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1529
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1530
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1531
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1532
-     *     body: array, // (REQUIRED) The template definition
1533
-     * } $params
1534
-     *
1535
-     * @throws MissingParameterException if a required parameter is missing
1536
-     * @throws NoNodeAvailableException if all the hosts are offline
1537
-     * @throws ClientResponseException if the status code of response is 4xx
1538
-     * @throws ServerResponseException if the status code of response is 5xx
1539
-     *
1540
-     * @return Elasticsearch|Promise
1541
-     */
1542
-    public function putTemplate(array $params = [])
1543
-    {
1544
-        $this->checkRequiredParameters(['name', 'body'], $params);
1545
-        $url = '/_template/' . $this->encode($params['name']);
1546
-        $method = 'PUT';
1547
-        $url = $this->addQueryString($url, $params, ['order', 'create', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1548
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1549
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1550
-    }
1551
-    /**
1552
-     * Returns information about ongoing index shard recoveries.
1553
-     *
1554
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html
1555
-     *
1556
-     * @param array{
1557
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1558
-     *     detailed: boolean, // Whether to display detailed information about shard recovery
1559
-     *     active_only: boolean, // Display only those recoveries that are currently on-going
1560
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1561
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1562
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1563
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1564
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1565
-     * } $params
1566
-     *
1567
-     * @throws NoNodeAvailableException if all the hosts are offline
1568
-     * @throws ClientResponseException if the status code of response is 4xx
1569
-     * @throws ServerResponseException if the status code of response is 5xx
1570
-     *
1571
-     * @return Elasticsearch|Promise
1572
-     */
1573
-    public function recovery(array $params = [])
1574
-    {
1575
-        if (isset($params['index'])) {
1576
-            $url = '/' . $this->encode($params['index']) . '/_recovery';
1577
-            $method = 'GET';
1578
-        } else {
1579
-            $url = '/_recovery';
1580
-            $method = 'GET';
1581
-        }
1582
-        $url = $this->addQueryString($url, $params, ['detailed', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1583
-        $headers = ['Accept' => 'application/json'];
1584
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1585
-    }
1586
-    /**
1587
-     * Performs the refresh operation in one or more indices.
1588
-     *
1589
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html
1590
-     *
1591
-     * @param array{
1592
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1593
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1594
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1595
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1596
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1597
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1598
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1599
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1600
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1601
-     * } $params
1602
-     *
1603
-     * @throws NoNodeAvailableException if all the hosts are offline
1604
-     * @throws ClientResponseException if the status code of response is 4xx
1605
-     * @throws ServerResponseException if the status code of response is 5xx
1606
-     *
1607
-     * @return Elasticsearch|Promise
1608
-     */
1609
-    public function refresh(array $params = [])
1610
-    {
1611
-        if (isset($params['index'])) {
1612
-            $url = '/' . $this->encode($params['index']) . '/_refresh';
1613
-            $method = empty($params['body']) ? 'GET' : 'POST';
1614
-        } else {
1615
-            $url = '/_refresh';
1616
-            $method = empty($params['body']) ? 'GET' : 'POST';
1617
-        }
1618
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1619
-        $headers = ['Accept' => 'application/json'];
1620
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1621
-    }
1622
-    /**
1623
-     * Reloads an index's search analyzers and their resources.
1624
-     *
1625
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html
1626
-     *
1627
-     * @param array{
1628
-     *     index: list, // (REQUIRED) A comma-separated list of index names to reload analyzers for
1629
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1630
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1631
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1632
-     *     resource: string, // changed resource to reload analyzers from if applicable
1633
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1634
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1635
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1636
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1637
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1638
-     * } $params
1639
-     *
1640
-     * @throws MissingParameterException if a required parameter is missing
1641
-     * @throws NoNodeAvailableException if all the hosts are offline
1642
-     * @throws ClientResponseException if the status code of response is 4xx
1643
-     * @throws ServerResponseException if the status code of response is 5xx
1644
-     *
1645
-     * @return Elasticsearch|Promise
1646
-     */
1647
-    public function reloadSearchAnalyzers(array $params = [])
1648
-    {
1649
-        $this->checkRequiredParameters(['index'], $params);
1650
-        $url = '/' . $this->encode($params['index']) . '/_reload_search_analyzers';
1651
-        $method = empty($params['body']) ? 'GET' : 'POST';
1652
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'resource', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1653
-        $headers = ['Accept' => 'application/json'];
1654
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1655
-    }
1656
-    /**
1657
-     * Resolves the specified index expressions to return information about each cluster, including the local cluster, if included.
1658
-     *
1659
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html
1660
-     *
1661
-     * @param array{
1662
-     *     name: list, // (REQUIRED) A comma-separated list of cluster:index names or wildcard expressions
1663
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1664
-     *     ignore_throttled: boolean, // Whether specified concrete, expanded or aliased indices should be ignored when throttled
1665
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1666
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1667
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1668
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1669
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1670
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1671
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1672
-     * } $params
1673
-     *
1674
-     * @throws MissingParameterException if a required parameter is missing
1675
-     * @throws NoNodeAvailableException if all the hosts are offline
1676
-     * @throws ClientResponseException if the status code of response is 4xx
1677
-     * @throws ServerResponseException if the status code of response is 5xx
1678
-     *
1679
-     * @return Elasticsearch|Promise
1680
-     */
1681
-    public function resolveCluster(array $params = [])
1682
-    {
1683
-        $this->checkRequiredParameters(['name'], $params);
1684
-        $url = '/_resolve/cluster/' . $this->encode($params['name']);
1685
-        $method = 'GET';
1686
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1687
-        $headers = ['Accept' => 'application/json'];
1688
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1689
-    }
1690
-    /**
1691
-     * Returns information about any matching indices, aliases, and data streams
1692
-     *
1693
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html
1694
-     *
1695
-     * @param array{
1696
-     *     name: list, // (REQUIRED) A comma-separated list of names or wildcard expressions
1697
-     *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1698
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1699
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1700
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1701
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1702
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1703
-     * } $params
1704
-     *
1705
-     * @throws MissingParameterException if a required parameter is missing
1706
-     * @throws NoNodeAvailableException if all the hosts are offline
1707
-     * @throws ClientResponseException if the status code of response is 4xx
1708
-     * @throws ServerResponseException if the status code of response is 5xx
1709
-     *
1710
-     * @return Elasticsearch|Promise
1711
-     */
1712
-    public function resolveIndex(array $params = [])
1713
-    {
1714
-        $this->checkRequiredParameters(['name'], $params);
1715
-        $url = '/_resolve/index/' . $this->encode($params['name']);
1716
-        $method = 'GET';
1717
-        $url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1718
-        $headers = ['Accept' => 'application/json'];
1719
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1720
-    }
1721
-    /**
1722
-     * Updates an alias to point to a new index when the existing index
1723
-     * is considered to be too large or too old.
1724
-     *
1725
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html
1726
-     *
1727
-     * @param array{
1728
-     *     alias: string, // (REQUIRED) The name of the alias to rollover
1729
-     *     new_index: string, //  The name of the rollover index
1730
-     *     timeout: time, // Explicit operation timeout
1731
-     *     dry_run: boolean, // If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
1732
-     *     master_timeout: time, // Specify timeout for connection to master
1733
-     *     wait_for_active_shards: string, // Set the number of active shards to wait for on the newly created rollover index before the operation returns.
1734
-     *     lazy: boolean, // If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams.
1735
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1736
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1737
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1738
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1739
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1740
-     *     body: array, //  The conditions that needs to be met for executing rollover
1741
-     * } $params
1742
-     *
1743
-     * @throws MissingParameterException if a required parameter is missing
1744
-     * @throws NoNodeAvailableException if all the hosts are offline
1745
-     * @throws ClientResponseException if the status code of response is 4xx
1746
-     * @throws ServerResponseException if the status code of response is 5xx
1747
-     *
1748
-     * @return Elasticsearch|Promise
1749
-     */
1750
-    public function rollover(array $params = [])
1751
-    {
1752
-        $this->checkRequiredParameters(['alias'], $params);
1753
-        if (isset($params['new_index'])) {
1754
-            $url = '/' . $this->encode($params['alias']) . '/_rollover/' . $this->encode($params['new_index']);
1755
-            $method = 'POST';
1756
-        } else {
1757
-            $url = '/' . $this->encode($params['alias']) . '/_rollover';
1758
-            $method = 'POST';
1759
-        }
1760
-        $url = $this->addQueryString($url, $params, ['timeout', 'dry_run', 'master_timeout', 'wait_for_active_shards', 'lazy', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1761
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1762
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1763
-    }
1764
-    /**
1765
-     * Provides low-level information about segments in a Lucene index.
1766
-     *
1767
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html
1768
-     *
1769
-     * @param array{
1770
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1771
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1772
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1773
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1774
-     *     verbose: boolean, // Includes detailed memory usage by Lucene.
1775
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1776
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1777
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1778
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1779
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1780
-     * } $params
1781
-     *
1782
-     * @throws NoNodeAvailableException if all the hosts are offline
1783
-     * @throws ClientResponseException if the status code of response is 4xx
1784
-     * @throws ServerResponseException if the status code of response is 5xx
1785
-     *
1786
-     * @return Elasticsearch|Promise
1787
-     */
1788
-    public function segments(array $params = [])
1789
-    {
1790
-        if (isset($params['index'])) {
1791
-            $url = '/' . $this->encode($params['index']) . '/_segments';
1792
-            $method = 'GET';
1793
-        } else {
1794
-            $url = '/_segments';
1795
-            $method = 'GET';
1796
-        }
1797
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1798
-        $headers = ['Accept' => 'application/json'];
1799
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1800
-    }
1801
-    /**
1802
-     * Provides store information for shard copies of indices.
1803
-     *
1804
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html
1805
-     *
1806
-     * @param array{
1807
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1808
-     *     status: list, // A comma-separated list of statuses used to filter on shards to get store information for
1809
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1810
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1811
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1812
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1813
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1814
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1815
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1816
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1817
-     * } $params
1818
-     *
1819
-     * @throws NoNodeAvailableException if all the hosts are offline
1820
-     * @throws ClientResponseException if the status code of response is 4xx
1821
-     * @throws ServerResponseException if the status code of response is 5xx
1822
-     *
1823
-     * @return Elasticsearch|Promise
1824
-     */
1825
-    public function shardStores(array $params = [])
1826
-    {
1827
-        if (isset($params['index'])) {
1828
-            $url = '/' . $this->encode($params['index']) . '/_shard_stores';
1829
-            $method = 'GET';
1830
-        } else {
1831
-            $url = '/_shard_stores';
1832
-            $method = 'GET';
1833
-        }
1834
-        $url = $this->addQueryString($url, $params, ['status', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1835
-        $headers = ['Accept' => 'application/json'];
1836
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1837
-    }
1838
-    /**
1839
-     * Allow to shrink an existing index into a new index with fewer primary shards.
1840
-     *
1841
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html
1842
-     *
1843
-     * @param array{
1844
-     *     index: string, // (REQUIRED) The name of the source index to shrink
1845
-     *     target: string, // (REQUIRED) The name of the target index to shrink into
1846
-     *     timeout: time, // Explicit operation timeout
1847
-     *     master_timeout: time, // Specify timeout for connection to master
1848
-     *     wait_for_active_shards: string, // Set the number of active shards to wait for on the shrunken index before the operation returns.
1849
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1850
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1851
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1852
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1853
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1854
-     *     body: array, //  The configuration for the target index (`settings` and `aliases`)
1855
-     * } $params
1856
-     *
1857
-     * @throws MissingParameterException if a required parameter is missing
1858
-     * @throws NoNodeAvailableException if all the hosts are offline
1859
-     * @throws ClientResponseException if the status code of response is 4xx
1860
-     * @throws ServerResponseException if the status code of response is 5xx
1861
-     *
1862
-     * @return Elasticsearch|Promise
1863
-     */
1864
-    public function shrink(array $params = [])
1865
-    {
1866
-        $this->checkRequiredParameters(['index', 'target'], $params);
1867
-        $url = '/' . $this->encode($params['index']) . '/_shrink/' . $this->encode($params['target']);
1868
-        $method = 'PUT';
1869
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1870
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1871
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1872
-    }
1873
-    /**
1874
-     * Simulate matching the given index name against the index templates in the system
1875
-     *
1876
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html
1877
-     *
1878
-     * @param array{
1879
-     *     name: string, // (REQUIRED) The name of the index (it must be a concrete index name)
1880
-     *     create: boolean, // 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
1881
-     *     cause: string, // User defined reason for dry-run creating the new template for simulation purposes
1882
-     *     master_timeout: time, // Specify timeout for connection to master
1883
-     *     include_defaults: boolean, // Return all relevant default configurations for this index template simulation (default: false)
1884
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1885
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1886
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1887
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1888
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1889
-     *     body: array, //  New index template definition, which will be included in the simulation, as if it already exists in the system
1890
-     * } $params
1891
-     *
1892
-     * @throws MissingParameterException if a required parameter is missing
1893
-     * @throws NoNodeAvailableException if all the hosts are offline
1894
-     * @throws ClientResponseException if the status code of response is 4xx
1895
-     * @throws ServerResponseException if the status code of response is 5xx
1896
-     *
1897
-     * @return Elasticsearch|Promise
1898
-     */
1899
-    public function simulateIndexTemplate(array $params = [])
1900
-    {
1901
-        $this->checkRequiredParameters(['name'], $params);
1902
-        $url = '/_index_template/_simulate_index/' . $this->encode($params['name']);
1903
-        $method = 'POST';
1904
-        $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1905
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1906
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1907
-    }
1908
-    /**
1909
-     * Simulate resolving the given template name or body
1910
-     *
1911
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html
1912
-     *
1913
-     * @param array{
1914
-     *     name: string, //  The name of the index template
1915
-     *     create: boolean, // 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
1916
-     *     cause: string, // User defined reason for dry-run creating the new template for simulation purposes
1917
-     *     master_timeout: time, // Specify timeout for connection to master
1918
-     *     include_defaults: boolean, // Return all relevant default configurations for this template simulation (default: false)
1919
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1920
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1921
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1922
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1923
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1924
-     *     body: array, //  New index template definition to be simulated, if no index template name is specified
1925
-     * } $params
1926
-     *
1927
-     * @throws NoNodeAvailableException if all the hosts are offline
1928
-     * @throws ClientResponseException if the status code of response is 4xx
1929
-     * @throws ServerResponseException if the status code of response is 5xx
1930
-     *
1931
-     * @return Elasticsearch|Promise
1932
-     */
1933
-    public function simulateTemplate(array $params = [])
1934
-    {
1935
-        if (isset($params['name'])) {
1936
-            $url = '/_index_template/_simulate/' . $this->encode($params['name']);
1937
-            $method = 'POST';
1938
-        } else {
1939
-            $url = '/_index_template/_simulate';
1940
-            $method = 'POST';
1941
-        }
1942
-        $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1943
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1944
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1945
-    }
1946
-    /**
1947
-     * Allows you to split an existing index into a new index with more primary shards.
1948
-     *
1949
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html
1950
-     *
1951
-     * @param array{
1952
-     *     index: string, // (REQUIRED) The name of the source index to split
1953
-     *     target: string, // (REQUIRED) The name of the target index to split into
1954
-     *     timeout: time, // Explicit operation timeout
1955
-     *     master_timeout: time, // Specify timeout for connection to master
1956
-     *     wait_for_active_shards: string, // Set the number of active shards to wait for on the shrunken index before the operation returns.
1957
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1958
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1959
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1960
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1961
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1962
-     *     body: array, //  The configuration for the target index (`settings` and `aliases`)
1963
-     * } $params
1964
-     *
1965
-     * @throws MissingParameterException if a required parameter is missing
1966
-     * @throws NoNodeAvailableException if all the hosts are offline
1967
-     * @throws ClientResponseException if the status code of response is 4xx
1968
-     * @throws ServerResponseException if the status code of response is 5xx
1969
-     *
1970
-     * @return Elasticsearch|Promise
1971
-     */
1972
-    public function split(array $params = [])
1973
-    {
1974
-        $this->checkRequiredParameters(['index', 'target'], $params);
1975
-        $url = '/' . $this->encode($params['index']) . '/_split/' . $this->encode($params['target']);
1976
-        $method = 'PUT';
1977
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1978
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1979
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1980
-    }
1981
-    /**
1982
-     * Provides statistics on operations happening in an index.
1983
-     *
1984
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html
1985
-     *
1986
-     * @param array{
1987
-     *     metric: list, //  Limit the information returned the specific metrics.
1988
-     *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1989
-     *     completion_fields: list, // A comma-separated list of fields for the `completion` index metric (supports wildcards)
1990
-     *     fielddata_fields: list, // A comma-separated list of fields for the `fielddata` index metric (supports wildcards)
1991
-     *     fields: list, // A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
1992
-     *     groups: list, // A comma-separated list of search groups for `search` index metric
1993
-     *     level: enum, // Return stats aggregated at cluster, index or shard level
1994
-     *     include_segment_file_sizes: boolean, // Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
1995
-     *     include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory
1996
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1997
-     *     forbid_closed_indices: boolean, // If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
1998
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1999
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2000
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2001
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2002
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2003
-     * } $params
2004
-     *
2005
-     * @throws NoNodeAvailableException if all the hosts are offline
2006
-     * @throws ClientResponseException if the status code of response is 4xx
2007
-     * @throws ServerResponseException if the status code of response is 5xx
2008
-     *
2009
-     * @return Elasticsearch|Promise
2010
-     */
2011
-    public function stats(array $params = [])
2012
-    {
2013
-        if (isset($params['index']) && isset($params['metric'])) {
2014
-            $url = '/' . $this->encode($params['index']) . '/_stats/' . $this->encode($params['metric']);
2015
-            $method = 'GET';
2016
-        } elseif (isset($params['metric'])) {
2017
-            $url = '/_stats/' . $this->encode($params['metric']);
2018
-            $method = 'GET';
2019
-        } elseif (isset($params['index'])) {
2020
-            $url = '/' . $this->encode($params['index']) . '/_stats';
2021
-            $method = 'GET';
2022
-        } else {
2023
-            $url = '/_stats';
2024
-            $method = 'GET';
2025
-        }
2026
-        $url = $this->addQueryString($url, $params, ['completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'include_segment_file_sizes', 'include_unloaded_segments', 'expand_wildcards', 'forbid_closed_indices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2027
-        $headers = ['Accept' => 'application/json'];
2028
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2029
-    }
2030
-    /**
2031
-     * Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.
2032
-     *
2033
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html
2034
-     *
2035
-     * @param array{
2036
-     *     index: string, // (REQUIRED) The name of the index to unfreeze
2037
-     *     timeout: time, // Explicit operation timeout
2038
-     *     master_timeout: time, // Specify timeout for connection to master
2039
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
2040
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2041
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
2042
-     *     wait_for_active_shards: string, // Sets the number of active shards to wait for before the operation returns.
2043
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2044
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2045
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2046
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2047
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2048
-     * } $params
2049
-     *
2050
-     * @throws MissingParameterException if a required parameter is missing
2051
-     * @throws NoNodeAvailableException if all the hosts are offline
2052
-     * @throws ClientResponseException if the status code of response is 4xx
2053
-     * @throws ServerResponseException if the status code of response is 5xx
2054
-     *
2055
-     * @return Elasticsearch|Promise
2056
-     */
2057
-    public function unfreeze(array $params = [])
2058
-    {
2059
-        $this->checkRequiredParameters(['index'], $params);
2060
-        $url = '/' . $this->encode($params['index']) . '/_unfreeze';
2061
-        $method = 'POST';
2062
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2063
-        $headers = ['Accept' => 'application/json'];
2064
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2065
-    }
2066
-    /**
2067
-     * Updates index aliases.
2068
-     *
2069
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
2070
-     *
2071
-     * @param array{
2072
-     *     timeout: time, // Request timeout
2073
-     *     master_timeout: time, // Specify timeout for connection to master
2074
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2075
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2076
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2077
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2078
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2079
-     *     body: array, // (REQUIRED) The definition of `actions` to perform
2080
-     * } $params
2081
-     *
2082
-     * @throws NoNodeAvailableException if all the hosts are offline
2083
-     * @throws ClientResponseException if the status code of response is 4xx
2084
-     * @throws ServerResponseException if the status code of response is 5xx
2085
-     *
2086
-     * @return Elasticsearch|Promise
2087
-     */
2088
-    public function updateAliases(array $params = [])
2089
-    {
2090
-        $this->checkRequiredParameters(['body'], $params);
2091
-        $url = '/_aliases';
2092
-        $method = 'POST';
2093
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2094
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2095
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2096
-    }
2097
-    /**
2098
-     * Allows a user to validate a potentially expensive query without executing it.
2099
-     *
2100
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html
2101
-     *
2102
-     * @param array{
2103
-     *     index: list, //  A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
2104
-     *     explain: boolean, // Return detailed information about the error
2105
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
2106
-     *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2107
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
2108
-     *     q: string, // Query in the Lucene query string syntax
2109
-     *     analyzer: string, // The analyzer to use for the query string
2110
-     *     analyze_wildcard: boolean, // Specify whether wildcard and prefix queries should be analyzed (default: false)
2111
-     *     default_operator: enum, // The default operator for query string query (AND or OR)
2112
-     *     df: string, // The field to use as default where no field prefix is given in the query string
2113
-     *     lenient: boolean, // Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
2114
-     *     rewrite: boolean, // Provide a more detailed explanation showing the actual Lucene query that will be executed.
2115
-     *     all_shards: boolean, // Execute validation on all shards instead of one random shard per index
2116
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2117
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2118
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2119
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2120
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2121
-     *     body: array, //  The query definition specified with the Query DSL
2122
-     * } $params
2123
-     *
2124
-     * @throws NoNodeAvailableException if all the hosts are offline
2125
-     * @throws ClientResponseException if the status code of response is 4xx
2126
-     * @throws ServerResponseException if the status code of response is 5xx
2127
-     *
2128
-     * @return Elasticsearch|Promise
2129
-     */
2130
-    public function validateQuery(array $params = [])
2131
-    {
2132
-        if (isset($params['index'])) {
2133
-            $url = '/' . $this->encode($params['index']) . '/_validate/query';
2134
-            $method = empty($params['body']) ? 'GET' : 'POST';
2135
-        } else {
2136
-            $url = '/_validate/query';
2137
-            $method = empty($params['body']) ? 'GET' : 'POST';
2138
-        }
2139
-        $url = $this->addQueryString($url, $params, ['explain', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2140
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2141
-        return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2142
-    }
28
+	/**
29
+	 * Adds a block to an index.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html
32
+	 *
33
+	 * @param array{
34
+	 *     index: list, // (REQUIRED) A comma separated list of indices to add a block to
35
+	 *     block: string, // (REQUIRED) The block to add (one of read, write, read_only or metadata)
36
+	 *     timeout: time, // Explicit operation timeout
37
+	 *     master_timeout: time, // Specify timeout for connection to master
38
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
39
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
40
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
41
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
42
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
43
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
44
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
45
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
46
+	 * } $params
47
+	 *
48
+	 * @throws MissingParameterException if a required parameter is missing
49
+	 * @throws NoNodeAvailableException if all the hosts are offline
50
+	 * @throws ClientResponseException if the status code of response is 4xx
51
+	 * @throws ServerResponseException if the status code of response is 5xx
52
+	 *
53
+	 * @return Elasticsearch|Promise
54
+	 */
55
+	public function addBlock(array $params = [])
56
+	{
57
+		$this->checkRequiredParameters(['index', 'block'], $params);
58
+		$url = '/' . $this->encode($params['index']) . '/_block/' . $this->encode($params['block']);
59
+		$method = 'PUT';
60
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
61
+		$headers = ['Accept' => 'application/json'];
62
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
63
+	}
64
+	/**
65
+	 * Performs the analysis process on a text and return the tokens breakdown of the text.
66
+	 *
67
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html
68
+	 *
69
+	 * @param array{
70
+	 *     index: string, //  The name of the index to scope the operation
71
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
72
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
73
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
74
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
75
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
76
+	 *     body: array, //  Define analyzer/tokenizer parameters and the text on which the analysis should be performed
77
+	 * } $params
78
+	 *
79
+	 * @throws NoNodeAvailableException if all the hosts are offline
80
+	 * @throws ClientResponseException if the status code of response is 4xx
81
+	 * @throws ServerResponseException if the status code of response is 5xx
82
+	 *
83
+	 * @return Elasticsearch|Promise
84
+	 */
85
+	public function analyze(array $params = [])
86
+	{
87
+		if (isset($params['index'])) {
88
+			$url = '/' . $this->encode($params['index']) . '/_analyze';
89
+			$method = empty($params['body']) ? 'GET' : 'POST';
90
+		} else {
91
+			$url = '/_analyze';
92
+			$method = empty($params['body']) ? 'GET' : 'POST';
93
+		}
94
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
95
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
96
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
97
+	}
98
+	/**
99
+	 * Clears all or specific caches for one or more indices.
100
+	 *
101
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html
102
+	 *
103
+	 * @param array{
104
+	 *     index: list, //  A comma-separated list of index name to limit the operation
105
+	 *     fielddata: boolean, // Clear field data
106
+	 *     fields: list, // A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
107
+	 *     query: boolean, // Clear query caches
108
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
109
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
110
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
111
+	 *     request: boolean, // Clear request cache
112
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
113
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
114
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
115
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
116
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
117
+	 * } $params
118
+	 *
119
+	 * @throws NoNodeAvailableException if all the hosts are offline
120
+	 * @throws ClientResponseException if the status code of response is 4xx
121
+	 * @throws ServerResponseException if the status code of response is 5xx
122
+	 *
123
+	 * @return Elasticsearch|Promise
124
+	 */
125
+	public function clearCache(array $params = [])
126
+	{
127
+		if (isset($params['index'])) {
128
+			$url = '/' . $this->encode($params['index']) . '/_cache/clear';
129
+			$method = 'POST';
130
+		} else {
131
+			$url = '/_cache/clear';
132
+			$method = 'POST';
133
+		}
134
+		$url = $this->addQueryString($url, $params, ['fielddata', 'fields', 'query', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'request', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
135
+		$headers = ['Accept' => 'application/json'];
136
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
137
+	}
138
+	/**
139
+	 * Clones an index
140
+	 *
141
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html
142
+	 *
143
+	 * @param array{
144
+	 *     index: string, // (REQUIRED) The name of the source index to clone
145
+	 *     target: string, // (REQUIRED) The name of the target index to clone into
146
+	 *     timeout: time, // Explicit operation timeout
147
+	 *     master_timeout: time, // Specify timeout for connection to master
148
+	 *     wait_for_active_shards: string, // Set the number of active shards to wait for on the cloned index before the operation returns.
149
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
150
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
151
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
152
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
153
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
154
+	 *     body: array, //  The configuration for the target index (`settings` and `aliases`)
155
+	 * } $params
156
+	 *
157
+	 * @throws MissingParameterException if a required parameter is missing
158
+	 * @throws NoNodeAvailableException if all the hosts are offline
159
+	 * @throws ClientResponseException if the status code of response is 4xx
160
+	 * @throws ServerResponseException if the status code of response is 5xx
161
+	 *
162
+	 * @return Elasticsearch|Promise
163
+	 */
164
+	public function clone(array $params = [])
165
+	{
166
+		$this->checkRequiredParameters(['index', 'target'], $params);
167
+		$url = '/' . $this->encode($params['index']) . '/_clone/' . $this->encode($params['target']);
168
+		$method = 'PUT';
169
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
170
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
171
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
172
+	}
173
+	/**
174
+	 * Closes an index.
175
+	 *
176
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
177
+	 *
178
+	 * @param array{
179
+	 *     index: list, // (REQUIRED) A comma separated list of indices to close
180
+	 *     timeout: time, // Explicit operation timeout
181
+	 *     master_timeout: time, // Specify timeout for connection to master
182
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
183
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
184
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
185
+	 *     wait_for_active_shards: string, // Sets the number of active shards to wait for before the operation returns.
186
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
187
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
188
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
189
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
190
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
191
+	 * } $params
192
+	 *
193
+	 * @throws MissingParameterException if a required parameter is missing
194
+	 * @throws NoNodeAvailableException if all the hosts are offline
195
+	 * @throws ClientResponseException if the status code of response is 4xx
196
+	 * @throws ServerResponseException if the status code of response is 5xx
197
+	 *
198
+	 * @return Elasticsearch|Promise
199
+	 */
200
+	public function close(array $params = [])
201
+	{
202
+		$this->checkRequiredParameters(['index'], $params);
203
+		$url = '/' . $this->encode($params['index']) . '/_close';
204
+		$method = 'POST';
205
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
206
+		$headers = ['Accept' => 'application/json'];
207
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
208
+	}
209
+	/**
210
+	 * Creates an index with optional settings and mappings.
211
+	 *
212
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html
213
+	 *
214
+	 * @param array{
215
+	 *     index: string, // (REQUIRED) The name of the index
216
+	 *     wait_for_active_shards: string, // Set the number of active shards to wait for before the operation returns.
217
+	 *     timeout: time, // Explicit operation timeout
218
+	 *     master_timeout: time, // Specify timeout for connection to master
219
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
220
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
221
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
222
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
223
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
224
+	 *     body: array, //  The configuration for the index (`settings` and `mappings`)
225
+	 * } $params
226
+	 *
227
+	 * @throws MissingParameterException if a required parameter is missing
228
+	 * @throws NoNodeAvailableException if all the hosts are offline
229
+	 * @throws ClientResponseException if the status code of response is 4xx
230
+	 * @throws ServerResponseException if the status code of response is 5xx
231
+	 *
232
+	 * @return Elasticsearch|Promise
233
+	 */
234
+	public function create(array $params = [])
235
+	{
236
+		$this->checkRequiredParameters(['index'], $params);
237
+		$url = '/' . $this->encode($params['index']);
238
+		$method = 'PUT';
239
+		$url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
240
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
241
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
242
+	}
243
+	/**
244
+	 * Creates a data stream
245
+	 *
246
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
247
+	 *
248
+	 * @param array{
249
+	 *     name: string, // (REQUIRED) The name of the data stream
250
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
251
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
252
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
253
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
254
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
255
+	 * } $params
256
+	 *
257
+	 * @throws MissingParameterException if a required parameter is missing
258
+	 * @throws NoNodeAvailableException if all the hosts are offline
259
+	 * @throws ClientResponseException if the status code of response is 4xx
260
+	 * @throws ServerResponseException if the status code of response is 5xx
261
+	 *
262
+	 * @return Elasticsearch|Promise
263
+	 */
264
+	public function createDataStream(array $params = [])
265
+	{
266
+		$this->checkRequiredParameters(['name'], $params);
267
+		$url = '/_data_stream/' . $this->encode($params['name']);
268
+		$method = 'PUT';
269
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
270
+		$headers = ['Accept' => 'application/json'];
271
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
272
+	}
273
+	/**
274
+	 * Provides statistics on operations happening in a data stream.
275
+	 *
276
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
277
+	 *
278
+	 * @param array{
279
+	 *     name: list, //  A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams
280
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
281
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
282
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
283
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
284
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
285
+	 * } $params
286
+	 *
287
+	 * @throws NoNodeAvailableException if all the hosts are offline
288
+	 * @throws ClientResponseException if the status code of response is 4xx
289
+	 * @throws ServerResponseException if the status code of response is 5xx
290
+	 *
291
+	 * @return Elasticsearch|Promise
292
+	 */
293
+	public function dataStreamsStats(array $params = [])
294
+	{
295
+		if (isset($params['name'])) {
296
+			$url = '/_data_stream/' . $this->encode($params['name']) . '/_stats';
297
+			$method = 'GET';
298
+		} else {
299
+			$url = '/_data_stream/_stats';
300
+			$method = 'GET';
301
+		}
302
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
303
+		$headers = ['Accept' => 'application/json'];
304
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
305
+	}
306
+	/**
307
+	 * Deletes an index.
308
+	 *
309
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html
310
+	 *
311
+	 * @param array{
312
+	 *     index: list, // (REQUIRED) A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
313
+	 *     timeout: time, // Explicit operation timeout
314
+	 *     master_timeout: time, // Specify timeout for connection to master
315
+	 *     ignore_unavailable: boolean, // Ignore unavailable indexes (default: false)
316
+	 *     allow_no_indices: boolean, // Ignore if a wildcard expression resolves to no concrete indices (default: false)
317
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open, closed, or hidden indices
318
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
319
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
320
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
321
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
322
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
323
+	 * } $params
324
+	 *
325
+	 * @throws MissingParameterException if a required parameter is missing
326
+	 * @throws NoNodeAvailableException if all the hosts are offline
327
+	 * @throws ClientResponseException if the status code of response is 4xx
328
+	 * @throws ServerResponseException if the status code of response is 5xx
329
+	 *
330
+	 * @return Elasticsearch|Promise
331
+	 */
332
+	public function delete(array $params = [])
333
+	{
334
+		$this->checkRequiredParameters(['index'], $params);
335
+		$url = '/' . $this->encode($params['index']);
336
+		$method = 'DELETE';
337
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
338
+		$headers = ['Accept' => 'application/json'];
339
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
340
+	}
341
+	/**
342
+	 * Deletes an alias.
343
+	 *
344
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
345
+	 *
346
+	 * @param array{
347
+	 *     index: list, // (REQUIRED) A comma-separated list of index names (supports wildcards); use `_all` for all indices
348
+	 *     name: list, // (REQUIRED) A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
349
+	 *     timeout: time, // Explicit timestamp for the document
350
+	 *     master_timeout: time, // Specify timeout for connection to master
351
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
352
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
353
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
354
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
355
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
356
+	 * } $params
357
+	 *
358
+	 * @throws MissingParameterException if a required parameter is missing
359
+	 * @throws NoNodeAvailableException if all the hosts are offline
360
+	 * @throws ClientResponseException if the status code of response is 4xx
361
+	 * @throws ServerResponseException if the status code of response is 5xx
362
+	 *
363
+	 * @return Elasticsearch|Promise
364
+	 */
365
+	public function deleteAlias(array $params = [])
366
+	{
367
+		$this->checkRequiredParameters(['index', 'name'], $params);
368
+		$url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
369
+		$method = 'DELETE';
370
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
371
+		$headers = ['Accept' => 'application/json'];
372
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
373
+	}
374
+	/**
375
+	 * Deletes the data stream lifecycle of the selected data streams.
376
+	 *
377
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html
378
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
379
+	 *
380
+	 * @param array{
381
+	 *     name: list, // (REQUIRED) A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams
382
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
383
+	 *     timeout: time, // Explicit timestamp for the document
384
+	 *     master_timeout: time, // Specify timeout for connection to master
385
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
386
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
387
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
388
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
389
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
390
+	 * } $params
391
+	 *
392
+	 * @throws MissingParameterException if a required parameter is missing
393
+	 * @throws NoNodeAvailableException if all the hosts are offline
394
+	 * @throws ClientResponseException if the status code of response is 4xx
395
+	 * @throws ServerResponseException if the status code of response is 5xx
396
+	 *
397
+	 * @return Elasticsearch|Promise
398
+	 */
399
+	public function deleteDataLifecycle(array $params = [])
400
+	{
401
+		$this->checkRequiredParameters(['name'], $params);
402
+		$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
403
+		$method = 'DELETE';
404
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
405
+		$headers = ['Accept' => 'application/json'];
406
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
407
+	}
408
+	/**
409
+	 * Deletes a data stream.
410
+	 *
411
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
412
+	 *
413
+	 * @param array{
414
+	 *     name: list, // (REQUIRED) A comma-separated list of data streams to delete; use `*` to delete all data streams
415
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
416
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
417
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
418
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
419
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
420
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
421
+	 * } $params
422
+	 *
423
+	 * @throws MissingParameterException if a required parameter is missing
424
+	 * @throws NoNodeAvailableException if all the hosts are offline
425
+	 * @throws ClientResponseException if the status code of response is 4xx
426
+	 * @throws ServerResponseException if the status code of response is 5xx
427
+	 *
428
+	 * @return Elasticsearch|Promise
429
+	 */
430
+	public function deleteDataStream(array $params = [])
431
+	{
432
+		$this->checkRequiredParameters(['name'], $params);
433
+		$url = '/_data_stream/' . $this->encode($params['name']);
434
+		$method = 'DELETE';
435
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
436
+		$headers = ['Accept' => 'application/json'];
437
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
438
+	}
439
+	/**
440
+	 * Deletes an index template.
441
+	 *
442
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html
443
+	 *
444
+	 * @param array{
445
+	 *     name: string, // (REQUIRED) The name of the template
446
+	 *     timeout: time, // Explicit operation timeout
447
+	 *     master_timeout: time, // Specify timeout for connection to master
448
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
449
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
450
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
451
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
452
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
453
+	 * } $params
454
+	 *
455
+	 * @throws MissingParameterException if a required parameter is missing
456
+	 * @throws NoNodeAvailableException if all the hosts are offline
457
+	 * @throws ClientResponseException if the status code of response is 4xx
458
+	 * @throws ServerResponseException if the status code of response is 5xx
459
+	 *
460
+	 * @return Elasticsearch|Promise
461
+	 */
462
+	public function deleteIndexTemplate(array $params = [])
463
+	{
464
+		$this->checkRequiredParameters(['name'], $params);
465
+		$url = '/_index_template/' . $this->encode($params['name']);
466
+		$method = 'DELETE';
467
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
468
+		$headers = ['Accept' => 'application/json'];
469
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
470
+	}
471
+	/**
472
+	 * Deletes an index template.
473
+	 *
474
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template-v1.html
475
+	 *
476
+	 * @param array{
477
+	 *     name: string, // (REQUIRED) The name of the template
478
+	 *     timeout: time, // Explicit operation timeout
479
+	 *     master_timeout: time, // Specify timeout for connection to master
480
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
481
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
482
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
483
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
484
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
485
+	 * } $params
486
+	 *
487
+	 * @throws MissingParameterException if a required parameter is missing
488
+	 * @throws NoNodeAvailableException if all the hosts are offline
489
+	 * @throws ClientResponseException if the status code of response is 4xx
490
+	 * @throws ServerResponseException if the status code of response is 5xx
491
+	 *
492
+	 * @return Elasticsearch|Promise
493
+	 */
494
+	public function deleteTemplate(array $params = [])
495
+	{
496
+		$this->checkRequiredParameters(['name'], $params);
497
+		$url = '/_template/' . $this->encode($params['name']);
498
+		$method = 'DELETE';
499
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
500
+		$headers = ['Accept' => 'application/json'];
501
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
502
+	}
503
+	/**
504
+	 * Analyzes the disk usage of each field of an index or data stream
505
+	 *
506
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html
507
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
508
+	 *
509
+	 * @param array{
510
+	 *     index: string, // (REQUIRED) Comma-separated list of indices or data streams to analyze the disk usage
511
+	 *     run_expensive_tasks: boolean, // Must be set to [true] in order for the task to be performed. Defaults to false.
512
+	 *     flush: boolean, // Whether flush or not before analyzing the index disk usage. Defaults to true
513
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
514
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
515
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
516
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
517
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
518
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
519
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
520
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
521
+	 * } $params
522
+	 *
523
+	 * @throws MissingParameterException if a required parameter is missing
524
+	 * @throws NoNodeAvailableException if all the hosts are offline
525
+	 * @throws ClientResponseException if the status code of response is 4xx
526
+	 * @throws ServerResponseException if the status code of response is 5xx
527
+	 *
528
+	 * @return Elasticsearch|Promise
529
+	 */
530
+	public function diskUsage(array $params = [])
531
+	{
532
+		$this->checkRequiredParameters(['index'], $params);
533
+		$url = '/' . $this->encode($params['index']) . '/_disk_usage';
534
+		$method = 'POST';
535
+		$url = $this->addQueryString($url, $params, ['run_expensive_tasks', 'flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
536
+		$headers = ['Accept' => 'application/json'];
537
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
538
+	}
539
+	/**
540
+	 * Downsample an index
541
+	 *
542
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html
543
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
544
+	 *
545
+	 * @param array{
546
+	 *     index: string, // (REQUIRED) The index to downsample
547
+	 *     target_index: string, // (REQUIRED) The name of the target index to store downsampled data
548
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
549
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
550
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
551
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
552
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
553
+	 *     body: array, // (REQUIRED) The downsampling configuration
554
+	 * } $params
555
+	 *
556
+	 * @throws MissingParameterException if a required parameter is missing
557
+	 * @throws NoNodeAvailableException if all the hosts are offline
558
+	 * @throws ClientResponseException if the status code of response is 4xx
559
+	 * @throws ServerResponseException if the status code of response is 5xx
560
+	 *
561
+	 * @return Elasticsearch|Promise
562
+	 */
563
+	public function downsample(array $params = [])
564
+	{
565
+		$this->checkRequiredParameters(['index', 'target_index', 'body'], $params);
566
+		$url = '/' . $this->encode($params['index']) . '/_downsample/' . $this->encode($params['target_index']);
567
+		$method = 'POST';
568
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
569
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
570
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
571
+	}
572
+	/**
573
+	 * Returns information about whether a particular index exists.
574
+	 *
575
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html
576
+	 *
577
+	 * @param array{
578
+	 *     index: list, // (REQUIRED) A comma-separated list of index names
579
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
580
+	 *     ignore_unavailable: boolean, // Ignore unavailable indexes (default: false)
581
+	 *     allow_no_indices: boolean, // Ignore if a wildcard expression resolves to no concrete indices (default: false)
582
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
583
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
584
+	 *     include_defaults: boolean, // Whether to return all default setting for each of the indices.
585
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
586
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
587
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
588
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
589
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
590
+	 * } $params
591
+	 *
592
+	 * @throws MissingParameterException if a required parameter is missing
593
+	 * @throws NoNodeAvailableException if all the hosts are offline
594
+	 * @throws ClientResponseException if the status code of response is 4xx
595
+	 * @throws ServerResponseException if the status code of response is 5xx
596
+	 *
597
+	 * @return Elasticsearch|Promise
598
+	 */
599
+	public function exists(array $params = [])
600
+	{
601
+		$this->checkRequiredParameters(['index'], $params);
602
+		$url = '/' . $this->encode($params['index']);
603
+		$method = 'HEAD';
604
+		$url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
605
+		$headers = ['Accept' => 'application/json'];
606
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
607
+	}
608
+	/**
609
+	 * Returns information about whether a particular alias exists.
610
+	 *
611
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
612
+	 *
613
+	 * @param array{
614
+	 *     name: list, // (REQUIRED) A comma-separated list of alias names to return
615
+	 *     index: list, //  A comma-separated list of index names to filter aliases
616
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
617
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
618
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
619
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
620
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
621
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
622
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
623
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
624
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
625
+	 * } $params
626
+	 *
627
+	 * @throws MissingParameterException if a required parameter is missing
628
+	 * @throws NoNodeAvailableException if all the hosts are offline
629
+	 * @throws ClientResponseException if the status code of response is 4xx
630
+	 * @throws ServerResponseException if the status code of response is 5xx
631
+	 *
632
+	 * @return Elasticsearch|Promise
633
+	 */
634
+	public function existsAlias(array $params = [])
635
+	{
636
+		$this->checkRequiredParameters(['name'], $params);
637
+		if (isset($params['index'])) {
638
+			$url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
639
+			$method = 'HEAD';
640
+		} else {
641
+			$url = '/_alias/' . $this->encode($params['name']);
642
+			$method = 'HEAD';
643
+		}
644
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
645
+		$headers = ['Accept' => 'application/json'];
646
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
647
+	}
648
+	/**
649
+	 * Returns information about whether a particular index template exists.
650
+	 *
651
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/index-templates.html
652
+	 *
653
+	 * @param array{
654
+	 *     name: string, // (REQUIRED) The name of the template
655
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
656
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
657
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
658
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
659
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
660
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
661
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
662
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
663
+	 * } $params
664
+	 *
665
+	 * @throws MissingParameterException if a required parameter is missing
666
+	 * @throws NoNodeAvailableException if all the hosts are offline
667
+	 * @throws ClientResponseException if the status code of response is 4xx
668
+	 * @throws ServerResponseException if the status code of response is 5xx
669
+	 *
670
+	 * @return Elasticsearch|Promise
671
+	 */
672
+	public function existsIndexTemplate(array $params = [])
673
+	{
674
+		$this->checkRequiredParameters(['name'], $params);
675
+		$url = '/_index_template/' . $this->encode($params['name']);
676
+		$method = 'HEAD';
677
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
678
+		$headers = ['Accept' => 'application/json'];
679
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
680
+	}
681
+	/**
682
+	 * Returns information about whether a particular index template exists.
683
+	 *
684
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html
685
+	 *
686
+	 * @param array{
687
+	 *     name: list, // (REQUIRED) The comma separated names of the index templates
688
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
689
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
690
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
691
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
692
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
693
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
694
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
695
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
696
+	 * } $params
697
+	 *
698
+	 * @throws MissingParameterException if a required parameter is missing
699
+	 * @throws NoNodeAvailableException if all the hosts are offline
700
+	 * @throws ClientResponseException if the status code of response is 4xx
701
+	 * @throws ServerResponseException if the status code of response is 5xx
702
+	 *
703
+	 * @return Elasticsearch|Promise
704
+	 */
705
+	public function existsTemplate(array $params = [])
706
+	{
707
+		$this->checkRequiredParameters(['name'], $params);
708
+		$url = '/_template/' . $this->encode($params['name']);
709
+		$method = 'HEAD';
710
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
711
+		$headers = ['Accept' => 'application/json'];
712
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
713
+	}
714
+	/**
715
+	 * Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc.
716
+	 *
717
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-explain-lifecycle.html
718
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
719
+	 *
720
+	 * @param array{
721
+	 *     index: string, // (REQUIRED) The name of the index to explain
722
+	 *     include_defaults: boolean, // indicates if the API should return the default values the system uses for the index's lifecycle
723
+	 *     master_timeout: time, // Specify timeout for connection to master
724
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
725
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
726
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
727
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
728
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
729
+	 * } $params
730
+	 *
731
+	 * @throws MissingParameterException if a required parameter is missing
732
+	 * @throws NoNodeAvailableException if all the hosts are offline
733
+	 * @throws ClientResponseException if the status code of response is 4xx
734
+	 * @throws ServerResponseException if the status code of response is 5xx
735
+	 *
736
+	 * @return Elasticsearch|Promise
737
+	 */
738
+	public function explainDataLifecycle(array $params = [])
739
+	{
740
+		$this->checkRequiredParameters(['index'], $params);
741
+		$url = '/' . $this->encode($params['index']) . '/_lifecycle/explain';
742
+		$method = 'GET';
743
+		$url = $this->addQueryString($url, $params, ['include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
744
+		$headers = ['Accept' => 'application/json'];
745
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
746
+	}
747
+	/**
748
+	 * Returns the field usage stats for each field of an index
749
+	 *
750
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html
751
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
752
+	 *
753
+	 * @param array{
754
+	 *     index: string, // (REQUIRED) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
755
+	 *     fields: list, // A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)
756
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
757
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
758
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
759
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
760
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
761
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
762
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
763
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
764
+	 * } $params
765
+	 *
766
+	 * @throws MissingParameterException if a required parameter is missing
767
+	 * @throws NoNodeAvailableException if all the hosts are offline
768
+	 * @throws ClientResponseException if the status code of response is 4xx
769
+	 * @throws ServerResponseException if the status code of response is 5xx
770
+	 *
771
+	 * @return Elasticsearch|Promise
772
+	 */
773
+	public function fieldUsageStats(array $params = [])
774
+	{
775
+		$this->checkRequiredParameters(['index'], $params);
776
+		$url = '/' . $this->encode($params['index']) . '/_field_usage_stats';
777
+		$method = 'GET';
778
+		$url = $this->addQueryString($url, $params, ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
779
+		$headers = ['Accept' => 'application/json'];
780
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
781
+	}
782
+	/**
783
+	 * Performs the flush operation on one or more indices.
784
+	 *
785
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html
786
+	 *
787
+	 * @param array{
788
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string for all indices
789
+	 *     force: boolean, // 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)
790
+	 *     wait_if_ongoing: boolean, // 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.
791
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
792
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
793
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
794
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
795
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
796
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
797
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
798
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
799
+	 * } $params
800
+	 *
801
+	 * @throws NoNodeAvailableException if all the hosts are offline
802
+	 * @throws ClientResponseException if the status code of response is 4xx
803
+	 * @throws ServerResponseException if the status code of response is 5xx
804
+	 *
805
+	 * @return Elasticsearch|Promise
806
+	 */
807
+	public function flush(array $params = [])
808
+	{
809
+		if (isset($params['index'])) {
810
+			$url = '/' . $this->encode($params['index']) . '/_flush';
811
+			$method = empty($params['body']) ? 'GET' : 'POST';
812
+		} else {
813
+			$url = '/_flush';
814
+			$method = empty($params['body']) ? 'GET' : 'POST';
815
+		}
816
+		$url = $this->addQueryString($url, $params, ['force', 'wait_if_ongoing', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
817
+		$headers = ['Accept' => 'application/json'];
818
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
819
+	}
820
+	/**
821
+	 * Performs the force merge operation on one or more indices.
822
+	 *
823
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html
824
+	 *
825
+	 * @param array{
826
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
827
+	 *     flush: boolean, // Specify whether the index should be flushed after performing the operation (default: true)
828
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
829
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
830
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
831
+	 *     max_num_segments: number, // The number of segments the index should be merged into (default: dynamic)
832
+	 *     only_expunge_deletes: boolean, // Specify whether the operation should only expunge deleted documents
833
+	 *     wait_for_completion: boolean, // Should the request wait until the force merge is completed.
834
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
835
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
836
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
837
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
838
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
839
+	 * } $params
840
+	 *
841
+	 * @throws NoNodeAvailableException if all the hosts are offline
842
+	 * @throws ClientResponseException if the status code of response is 4xx
843
+	 * @throws ServerResponseException if the status code of response is 5xx
844
+	 *
845
+	 * @return Elasticsearch|Promise
846
+	 */
847
+	public function forcemerge(array $params = [])
848
+	{
849
+		if (isset($params['index'])) {
850
+			$url = '/' . $this->encode($params['index']) . '/_forcemerge';
851
+			$method = 'POST';
852
+		} else {
853
+			$url = '/_forcemerge';
854
+			$method = 'POST';
855
+		}
856
+		$url = $this->addQueryString($url, $params, ['flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'max_num_segments', 'only_expunge_deletes', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
857
+		$headers = ['Accept' => 'application/json'];
858
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
859
+	}
860
+	/**
861
+	 * Returns information about one or more indices.
862
+	 *
863
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html
864
+	 *
865
+	 * @param array{
866
+	 *     index: list, // (REQUIRED) A comma-separated list of index names
867
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
868
+	 *     ignore_unavailable: boolean, // Ignore unavailable indexes (default: false)
869
+	 *     allow_no_indices: boolean, // Ignore if a wildcard expression resolves to no concrete indices (default: false)
870
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
871
+	 *     features: enum, // Return only information on specified index features
872
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
873
+	 *     include_defaults: boolean, // Whether to return all default setting for each of the indices.
874
+	 *     master_timeout: time, // Specify timeout for connection to master
875
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
876
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
877
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
878
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
879
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
880
+	 * } $params
881
+	 *
882
+	 * @throws MissingParameterException if a required parameter is missing
883
+	 * @throws NoNodeAvailableException if all the hosts are offline
884
+	 * @throws ClientResponseException if the status code of response is 4xx
885
+	 * @throws ServerResponseException if the status code of response is 5xx
886
+	 *
887
+	 * @return Elasticsearch|Promise
888
+	 */
889
+	public function get(array $params = [])
890
+	{
891
+		$this->checkRequiredParameters(['index'], $params);
892
+		$url = '/' . $this->encode($params['index']);
893
+		$method = 'GET';
894
+		$url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'features', 'flat_settings', 'include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
895
+		$headers = ['Accept' => 'application/json'];
896
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
897
+	}
898
+	/**
899
+	 * Returns an alias.
900
+	 *
901
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
902
+	 *
903
+	 * @param array{
904
+	 *     name: list, //  A comma-separated list of alias names to return
905
+	 *     index: list, //  A comma-separated list of index names to filter aliases
906
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
907
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
908
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
909
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
910
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
911
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
912
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
913
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
914
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
915
+	 * } $params
916
+	 *
917
+	 * @throws NoNodeAvailableException if all the hosts are offline
918
+	 * @throws ClientResponseException if the status code of response is 4xx
919
+	 * @throws ServerResponseException if the status code of response is 5xx
920
+	 *
921
+	 * @return Elasticsearch|Promise
922
+	 */
923
+	public function getAlias(array $params = [])
924
+	{
925
+		if (isset($params['index']) && isset($params['name'])) {
926
+			$url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
927
+			$method = 'GET';
928
+		} elseif (isset($params['name'])) {
929
+			$url = '/_alias/' . $this->encode($params['name']);
930
+			$method = 'GET';
931
+		} elseif (isset($params['index'])) {
932
+			$url = '/' . $this->encode($params['index']) . '/_alias';
933
+			$method = 'GET';
934
+		} else {
935
+			$url = '/_alias';
936
+			$method = 'GET';
937
+		}
938
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
939
+		$headers = ['Accept' => 'application/json'];
940
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
941
+	}
942
+	/**
943
+	 * Returns the data stream lifecycle of the selected data streams.
944
+	 *
945
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html
946
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
947
+	 *
948
+	 * @param array{
949
+	 *     name: list, // (REQUIRED) A comma-separated list of data streams to get; use `*` to get all data streams
950
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
951
+	 *     include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
952
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
953
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
954
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
955
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
956
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
957
+	 * } $params
958
+	 *
959
+	 * @throws MissingParameterException if a required parameter is missing
960
+	 * @throws NoNodeAvailableException if all the hosts are offline
961
+	 * @throws ClientResponseException if the status code of response is 4xx
962
+	 * @throws ServerResponseException if the status code of response is 5xx
963
+	 *
964
+	 * @return Elasticsearch|Promise
965
+	 */
966
+	public function getDataLifecycle(array $params = [])
967
+	{
968
+		$this->checkRequiredParameters(['name'], $params);
969
+		$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
970
+		$method = 'GET';
971
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
972
+		$headers = ['Accept' => 'application/json'];
973
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
974
+	}
975
+	/**
976
+	 * Returns data streams.
977
+	 *
978
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
979
+	 *
980
+	 * @param array{
981
+	 *     name: list, //  A comma-separated list of data streams to get; use `*` to get all data streams
982
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
983
+	 *     include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
984
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
985
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
986
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
987
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
988
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
989
+	 * } $params
990
+	 *
991
+	 * @throws NoNodeAvailableException if all the hosts are offline
992
+	 * @throws ClientResponseException if the status code of response is 4xx
993
+	 * @throws ServerResponseException if the status code of response is 5xx
994
+	 *
995
+	 * @return Elasticsearch|Promise
996
+	 */
997
+	public function getDataStream(array $params = [])
998
+	{
999
+		if (isset($params['name'])) {
1000
+			$url = '/_data_stream/' . $this->encode($params['name']);
1001
+			$method = 'GET';
1002
+		} else {
1003
+			$url = '/_data_stream';
1004
+			$method = 'GET';
1005
+		}
1006
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1007
+		$headers = ['Accept' => 'application/json'];
1008
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1009
+	}
1010
+	/**
1011
+	 * Returns mapping for one or more fields.
1012
+	 *
1013
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html
1014
+	 *
1015
+	 * @param array{
1016
+	 *     fields: list, // (REQUIRED) A comma-separated list of fields
1017
+	 *     index: list, //  A comma-separated list of index names
1018
+	 *     include_defaults: boolean, // Whether the default mapping values should be returned as well
1019
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1020
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1021
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1022
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1023
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1024
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1025
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1026
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1027
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1028
+	 * } $params
1029
+	 *
1030
+	 * @throws MissingParameterException if a required parameter is missing
1031
+	 * @throws NoNodeAvailableException if all the hosts are offline
1032
+	 * @throws ClientResponseException if the status code of response is 4xx
1033
+	 * @throws ServerResponseException if the status code of response is 5xx
1034
+	 *
1035
+	 * @return Elasticsearch|Promise
1036
+	 */
1037
+	public function getFieldMapping(array $params = [])
1038
+	{
1039
+		$this->checkRequiredParameters(['fields'], $params);
1040
+		if (isset($params['index'])) {
1041
+			$url = '/' . $this->encode($params['index']) . '/_mapping/field/' . $this->encode($params['fields']);
1042
+			$method = 'GET';
1043
+		} else {
1044
+			$url = '/_mapping/field/' . $this->encode($params['fields']);
1045
+			$method = 'GET';
1046
+		}
1047
+		$url = $this->addQueryString($url, $params, ['include_defaults', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1048
+		$headers = ['Accept' => 'application/json'];
1049
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1050
+	}
1051
+	/**
1052
+	 * Returns an index template.
1053
+	 *
1054
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html
1055
+	 *
1056
+	 * @param array{
1057
+	 *     name: string, //  A pattern that returned template names must match
1058
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
1059
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
1060
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1061
+	 *     include_defaults: boolean, // Return all relevant default configurations for the index template (default: false)
1062
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1063
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1064
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1065
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1066
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1067
+	 * } $params
1068
+	 *
1069
+	 * @throws NoNodeAvailableException if all the hosts are offline
1070
+	 * @throws ClientResponseException if the status code of response is 4xx
1071
+	 * @throws ServerResponseException if the status code of response is 5xx
1072
+	 *
1073
+	 * @return Elasticsearch|Promise
1074
+	 */
1075
+	public function getIndexTemplate(array $params = [])
1076
+	{
1077
+		if (isset($params['name'])) {
1078
+			$url = '/_index_template/' . $this->encode($params['name']);
1079
+			$method = 'GET';
1080
+		} else {
1081
+			$url = '/_index_template';
1082
+			$method = 'GET';
1083
+		}
1084
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1085
+		$headers = ['Accept' => 'application/json'];
1086
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1087
+	}
1088
+	/**
1089
+	 * Returns mappings for one or more indices.
1090
+	 *
1091
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
1092
+	 *
1093
+	 * @param array{
1094
+	 *     index: list, //  A comma-separated list of index names
1095
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1096
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1097
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1098
+	 *     master_timeout: time, // Specify timeout for connection to master
1099
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1100
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1101
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1102
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1103
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1104
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1105
+	 * } $params
1106
+	 *
1107
+	 * @throws NoNodeAvailableException if all the hosts are offline
1108
+	 * @throws ClientResponseException if the status code of response is 4xx
1109
+	 * @throws ServerResponseException if the status code of response is 5xx
1110
+	 *
1111
+	 * @return Elasticsearch|Promise
1112
+	 */
1113
+	public function getMapping(array $params = [])
1114
+	{
1115
+		if (isset($params['index'])) {
1116
+			$url = '/' . $this->encode($params['index']) . '/_mapping';
1117
+			$method = 'GET';
1118
+		} else {
1119
+			$url = '/_mapping';
1120
+			$method = 'GET';
1121
+		}
1122
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1123
+		$headers = ['Accept' => 'application/json'];
1124
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1125
+	}
1126
+	/**
1127
+	 * Returns settings for one or more indices.
1128
+	 *
1129
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html
1130
+	 *
1131
+	 * @param array{
1132
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1133
+	 *     name: list, //  The name of the settings that should be included
1134
+	 *     master_timeout: time, // Specify timeout for connection to master
1135
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1136
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1137
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1138
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
1139
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1140
+	 *     include_defaults: boolean, // Whether to return all default setting for each of the indices.
1141
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1142
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1143
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1144
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1145
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1146
+	 * } $params
1147
+	 *
1148
+	 * @throws NoNodeAvailableException if all the hosts are offline
1149
+	 * @throws ClientResponseException if the status code of response is 4xx
1150
+	 * @throws ServerResponseException if the status code of response is 5xx
1151
+	 *
1152
+	 * @return Elasticsearch|Promise
1153
+	 */
1154
+	public function getSettings(array $params = [])
1155
+	{
1156
+		if (isset($params['index']) && isset($params['name'])) {
1157
+			$url = '/' . $this->encode($params['index']) . '/_settings/' . $this->encode($params['name']);
1158
+			$method = 'GET';
1159
+		} elseif (isset($params['index'])) {
1160
+			$url = '/' . $this->encode($params['index']) . '/_settings';
1161
+			$method = 'GET';
1162
+		} elseif (isset($params['name'])) {
1163
+			$url = '/_settings/' . $this->encode($params['name']);
1164
+			$method = 'GET';
1165
+		} else {
1166
+			$url = '/_settings';
1167
+			$method = 'GET';
1168
+		}
1169
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1170
+		$headers = ['Accept' => 'application/json'];
1171
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1172
+	}
1173
+	/**
1174
+	 * Returns an index template.
1175
+	 *
1176
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html
1177
+	 *
1178
+	 * @param array{
1179
+	 *     name: list, //  The comma separated names of the index templates
1180
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
1181
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
1182
+	 *     local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1183
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1184
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1185
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1186
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1187
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1188
+	 * } $params
1189
+	 *
1190
+	 * @throws NoNodeAvailableException if all the hosts are offline
1191
+	 * @throws ClientResponseException if the status code of response is 4xx
1192
+	 * @throws ServerResponseException if the status code of response is 5xx
1193
+	 *
1194
+	 * @return Elasticsearch|Promise
1195
+	 */
1196
+	public function getTemplate(array $params = [])
1197
+	{
1198
+		if (isset($params['name'])) {
1199
+			$url = '/_template/' . $this->encode($params['name']);
1200
+			$method = 'GET';
1201
+		} else {
1202
+			$url = '/_template';
1203
+			$method = 'GET';
1204
+		}
1205
+		$url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1206
+		$headers = ['Accept' => 'application/json'];
1207
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1208
+	}
1209
+	/**
1210
+	 * Migrates an alias to a data stream
1211
+	 *
1212
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
1213
+	 *
1214
+	 * @param array{
1215
+	 *     name: string, // (REQUIRED) The name of the alias to migrate
1216
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1217
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1218
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1219
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1220
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1221
+	 * } $params
1222
+	 *
1223
+	 * @throws MissingParameterException if a required parameter is missing
1224
+	 * @throws NoNodeAvailableException if all the hosts are offline
1225
+	 * @throws ClientResponseException if the status code of response is 4xx
1226
+	 * @throws ServerResponseException if the status code of response is 5xx
1227
+	 *
1228
+	 * @return Elasticsearch|Promise
1229
+	 */
1230
+	public function migrateToDataStream(array $params = [])
1231
+	{
1232
+		$this->checkRequiredParameters(['name'], $params);
1233
+		$url = '/_data_stream/_migrate/' . $this->encode($params['name']);
1234
+		$method = 'POST';
1235
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1236
+		$headers = ['Accept' => 'application/json'];
1237
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1238
+	}
1239
+	/**
1240
+	 * Modifies a data stream
1241
+	 *
1242
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
1243
+	 *
1244
+	 * @param array{
1245
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1246
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1247
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1248
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1249
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1250
+	 *     body: array, // (REQUIRED) The data stream modifications
1251
+	 * } $params
1252
+	 *
1253
+	 * @throws NoNodeAvailableException if all the hosts are offline
1254
+	 * @throws ClientResponseException if the status code of response is 4xx
1255
+	 * @throws ServerResponseException if the status code of response is 5xx
1256
+	 *
1257
+	 * @return Elasticsearch|Promise
1258
+	 */
1259
+	public function modifyDataStream(array $params = [])
1260
+	{
1261
+		$this->checkRequiredParameters(['body'], $params);
1262
+		$url = '/_data_stream/_modify';
1263
+		$method = 'POST';
1264
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1265
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1266
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1267
+	}
1268
+	/**
1269
+	 * Opens an index.
1270
+	 *
1271
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
1272
+	 *
1273
+	 * @param array{
1274
+	 *     index: list, // (REQUIRED) A comma separated list of indices to open
1275
+	 *     timeout: time, // Explicit operation timeout
1276
+	 *     master_timeout: time, // Specify timeout for connection to master
1277
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1278
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1279
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1280
+	 *     wait_for_active_shards: string, // Sets the number of active shards to wait for before the operation returns.
1281
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1282
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1283
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1284
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1285
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1286
+	 * } $params
1287
+	 *
1288
+	 * @throws MissingParameterException if a required parameter is missing
1289
+	 * @throws NoNodeAvailableException if all the hosts are offline
1290
+	 * @throws ClientResponseException if the status code of response is 4xx
1291
+	 * @throws ServerResponseException if the status code of response is 5xx
1292
+	 *
1293
+	 * @return Elasticsearch|Promise
1294
+	 */
1295
+	public function open(array $params = [])
1296
+	{
1297
+		$this->checkRequiredParameters(['index'], $params);
1298
+		$url = '/' . $this->encode($params['index']) . '/_open';
1299
+		$method = 'POST';
1300
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1301
+		$headers = ['Accept' => 'application/json'];
1302
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1303
+	}
1304
+	/**
1305
+	 * Promotes a data stream from a replicated data stream managed by CCR to a regular data stream
1306
+	 *
1307
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
1308
+	 *
1309
+	 * @param array{
1310
+	 *     name: string, // (REQUIRED) The name of the data stream
1311
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1312
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1313
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1314
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1315
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1316
+	 * } $params
1317
+	 *
1318
+	 * @throws MissingParameterException if a required parameter is missing
1319
+	 * @throws NoNodeAvailableException if all the hosts are offline
1320
+	 * @throws ClientResponseException if the status code of response is 4xx
1321
+	 * @throws ServerResponseException if the status code of response is 5xx
1322
+	 *
1323
+	 * @return Elasticsearch|Promise
1324
+	 */
1325
+	public function promoteDataStream(array $params = [])
1326
+	{
1327
+		$this->checkRequiredParameters(['name'], $params);
1328
+		$url = '/_data_stream/_promote/' . $this->encode($params['name']);
1329
+		$method = 'POST';
1330
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1331
+		$headers = ['Accept' => 'application/json'];
1332
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1333
+	}
1334
+	/**
1335
+	 * Creates or updates an alias.
1336
+	 *
1337
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
1338
+	 *
1339
+	 * @param array{
1340
+	 *     index: list, // (REQUIRED) A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
1341
+	 *     name: string, // (REQUIRED) The name of the alias to be created or updated
1342
+	 *     timeout: time, // Explicit timestamp for the document
1343
+	 *     master_timeout: time, // Specify timeout for connection to master
1344
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1345
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1346
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1347
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1348
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1349
+	 *     body: array, //  The settings for the alias, such as `routing` or `filter`
1350
+	 * } $params
1351
+	 *
1352
+	 * @throws MissingParameterException if a required parameter is missing
1353
+	 * @throws NoNodeAvailableException if all the hosts are offline
1354
+	 * @throws ClientResponseException if the status code of response is 4xx
1355
+	 * @throws ServerResponseException if the status code of response is 5xx
1356
+	 *
1357
+	 * @return Elasticsearch|Promise
1358
+	 */
1359
+	public function putAlias(array $params = [])
1360
+	{
1361
+		$this->checkRequiredParameters(['index', 'name'], $params);
1362
+		$url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
1363
+		$method = 'PUT';
1364
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1365
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1366
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1367
+	}
1368
+	/**
1369
+	 * Updates the data stream lifecycle of the selected data streams.
1370
+	 *
1371
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html
1372
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1373
+	 *
1374
+	 * @param array{
1375
+	 *     name: list, // (REQUIRED) A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams
1376
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1377
+	 *     timeout: time, // Explicit timestamp for the document
1378
+	 *     master_timeout: time, // Specify timeout for connection to master
1379
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1380
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1381
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1382
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1383
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1384
+	 *     body: array, //  The data stream lifecycle configuration that consist of the data retention
1385
+	 * } $params
1386
+	 *
1387
+	 * @throws MissingParameterException if a required parameter is missing
1388
+	 * @throws NoNodeAvailableException if all the hosts are offline
1389
+	 * @throws ClientResponseException if the status code of response is 4xx
1390
+	 * @throws ServerResponseException if the status code of response is 5xx
1391
+	 *
1392
+	 * @return Elasticsearch|Promise
1393
+	 */
1394
+	public function putDataLifecycle(array $params = [])
1395
+	{
1396
+		$this->checkRequiredParameters(['name'], $params);
1397
+		$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
1398
+		$method = 'PUT';
1399
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1400
+		$headers = ['Accept' => 'application/json'];
1401
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1402
+	}
1403
+	/**
1404
+	 * Creates or updates an index template.
1405
+	 *
1406
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html
1407
+	 *
1408
+	 * @param array{
1409
+	 *     name: string, // (REQUIRED) The name of the template
1410
+	 *     create: boolean, // Whether the index template should only be added if new or can also replace an existing one
1411
+	 *     cause: string, // User defined reason for creating/updating the index template
1412
+	 *     master_timeout: time, // Specify timeout for connection to master
1413
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1414
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1415
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1416
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1417
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1418
+	 *     body: array, // (REQUIRED) The template definition
1419
+	 * } $params
1420
+	 *
1421
+	 * @throws MissingParameterException if a required parameter is missing
1422
+	 * @throws NoNodeAvailableException if all the hosts are offline
1423
+	 * @throws ClientResponseException if the status code of response is 4xx
1424
+	 * @throws ServerResponseException if the status code of response is 5xx
1425
+	 *
1426
+	 * @return Elasticsearch|Promise
1427
+	 */
1428
+	public function putIndexTemplate(array $params = [])
1429
+	{
1430
+		$this->checkRequiredParameters(['name', 'body'], $params);
1431
+		$url = '/_index_template/' . $this->encode($params['name']);
1432
+		$method = 'PUT';
1433
+		$url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1434
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1435
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1436
+	}
1437
+	/**
1438
+	 * Updates the index mappings.
1439
+	 *
1440
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
1441
+	 *
1442
+	 * @param array{
1443
+	 *     index: list, // (REQUIRED) A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.
1444
+	 *     timeout: time, // Explicit operation timeout
1445
+	 *     master_timeout: time, // Specify timeout for connection to master
1446
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1447
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1448
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1449
+	 *     write_index_only: boolean, // When true, applies mappings only to the write index of an alias or data stream
1450
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1451
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1452
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1453
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1454
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1455
+	 *     body: array, // (REQUIRED) The mapping definition
1456
+	 * } $params
1457
+	 *
1458
+	 * @throws MissingParameterException if a required parameter is missing
1459
+	 * @throws NoNodeAvailableException if all the hosts are offline
1460
+	 * @throws ClientResponseException if the status code of response is 4xx
1461
+	 * @throws ServerResponseException if the status code of response is 5xx
1462
+	 *
1463
+	 * @return Elasticsearch|Promise
1464
+	 */
1465
+	public function putMapping(array $params = [])
1466
+	{
1467
+		$this->checkRequiredParameters(['index', 'body'], $params);
1468
+		$url = '/' . $this->encode($params['index']) . '/_mapping';
1469
+		$method = 'PUT';
1470
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'write_index_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1471
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1472
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1473
+	}
1474
+	/**
1475
+	 * Updates the index settings.
1476
+	 *
1477
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html
1478
+	 *
1479
+	 * @param array{
1480
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1481
+	 *     master_timeout: time, // Specify timeout for connection to master
1482
+	 *     timeout: time, // Explicit operation timeout
1483
+	 *     preserve_existing: boolean, // Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`
1484
+	 *     reopen: boolean, // Whether to close and reopen the index to apply non-dynamic settings. If set to `true` the indices to which the settings are being applied will be closed temporarily and then reopened in order to apply the changes. The default is `false`
1485
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1486
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1487
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1488
+	 *     flat_settings: boolean, // Return settings in flat format (default: false)
1489
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1490
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1491
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1492
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1493
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1494
+	 *     body: array, // (REQUIRED) The index settings to be updated
1495
+	 * } $params
1496
+	 *
1497
+	 * @throws NoNodeAvailableException if all the hosts are offline
1498
+	 * @throws ClientResponseException if the status code of response is 4xx
1499
+	 * @throws ServerResponseException if the status code of response is 5xx
1500
+	 *
1501
+	 * @return Elasticsearch|Promise
1502
+	 */
1503
+	public function putSettings(array $params = [])
1504
+	{
1505
+		$this->checkRequiredParameters(['body'], $params);
1506
+		if (isset($params['index'])) {
1507
+			$url = '/' . $this->encode($params['index']) . '/_settings';
1508
+			$method = 'PUT';
1509
+		} else {
1510
+			$url = '/_settings';
1511
+			$method = 'PUT';
1512
+		}
1513
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'preserve_existing', 'reopen', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1514
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1515
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1516
+	}
1517
+	/**
1518
+	 * Creates or updates an index template.
1519
+	 *
1520
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html
1521
+	 *
1522
+	 * @param array{
1523
+	 *     name: string, // (REQUIRED) The name of the template
1524
+	 *     order: number, // The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
1525
+	 *     create: boolean, // Whether the index template should only be added if new or can also replace an existing one
1526
+	 *     master_timeout: time, // Specify timeout for connection to master
1527
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1528
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1529
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1530
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1531
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1532
+	 *     body: array, // (REQUIRED) The template definition
1533
+	 * } $params
1534
+	 *
1535
+	 * @throws MissingParameterException if a required parameter is missing
1536
+	 * @throws NoNodeAvailableException if all the hosts are offline
1537
+	 * @throws ClientResponseException if the status code of response is 4xx
1538
+	 * @throws ServerResponseException if the status code of response is 5xx
1539
+	 *
1540
+	 * @return Elasticsearch|Promise
1541
+	 */
1542
+	public function putTemplate(array $params = [])
1543
+	{
1544
+		$this->checkRequiredParameters(['name', 'body'], $params);
1545
+		$url = '/_template/' . $this->encode($params['name']);
1546
+		$method = 'PUT';
1547
+		$url = $this->addQueryString($url, $params, ['order', 'create', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1548
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1549
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1550
+	}
1551
+	/**
1552
+	 * Returns information about ongoing index shard recoveries.
1553
+	 *
1554
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html
1555
+	 *
1556
+	 * @param array{
1557
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1558
+	 *     detailed: boolean, // Whether to display detailed information about shard recovery
1559
+	 *     active_only: boolean, // Display only those recoveries that are currently on-going
1560
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1561
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1562
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1563
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1564
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1565
+	 * } $params
1566
+	 *
1567
+	 * @throws NoNodeAvailableException if all the hosts are offline
1568
+	 * @throws ClientResponseException if the status code of response is 4xx
1569
+	 * @throws ServerResponseException if the status code of response is 5xx
1570
+	 *
1571
+	 * @return Elasticsearch|Promise
1572
+	 */
1573
+	public function recovery(array $params = [])
1574
+	{
1575
+		if (isset($params['index'])) {
1576
+			$url = '/' . $this->encode($params['index']) . '/_recovery';
1577
+			$method = 'GET';
1578
+		} else {
1579
+			$url = '/_recovery';
1580
+			$method = 'GET';
1581
+		}
1582
+		$url = $this->addQueryString($url, $params, ['detailed', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1583
+		$headers = ['Accept' => 'application/json'];
1584
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1585
+	}
1586
+	/**
1587
+	 * Performs the refresh operation in one or more indices.
1588
+	 *
1589
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html
1590
+	 *
1591
+	 * @param array{
1592
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1593
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1594
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1595
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1596
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1597
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1598
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1599
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1600
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1601
+	 * } $params
1602
+	 *
1603
+	 * @throws NoNodeAvailableException if all the hosts are offline
1604
+	 * @throws ClientResponseException if the status code of response is 4xx
1605
+	 * @throws ServerResponseException if the status code of response is 5xx
1606
+	 *
1607
+	 * @return Elasticsearch|Promise
1608
+	 */
1609
+	public function refresh(array $params = [])
1610
+	{
1611
+		if (isset($params['index'])) {
1612
+			$url = '/' . $this->encode($params['index']) . '/_refresh';
1613
+			$method = empty($params['body']) ? 'GET' : 'POST';
1614
+		} else {
1615
+			$url = '/_refresh';
1616
+			$method = empty($params['body']) ? 'GET' : 'POST';
1617
+		}
1618
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1619
+		$headers = ['Accept' => 'application/json'];
1620
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1621
+	}
1622
+	/**
1623
+	 * Reloads an index's search analyzers and their resources.
1624
+	 *
1625
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html
1626
+	 *
1627
+	 * @param array{
1628
+	 *     index: list, // (REQUIRED) A comma-separated list of index names to reload analyzers for
1629
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1630
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1631
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1632
+	 *     resource: string, // changed resource to reload analyzers from if applicable
1633
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1634
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1635
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1636
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1637
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1638
+	 * } $params
1639
+	 *
1640
+	 * @throws MissingParameterException if a required parameter is missing
1641
+	 * @throws NoNodeAvailableException if all the hosts are offline
1642
+	 * @throws ClientResponseException if the status code of response is 4xx
1643
+	 * @throws ServerResponseException if the status code of response is 5xx
1644
+	 *
1645
+	 * @return Elasticsearch|Promise
1646
+	 */
1647
+	public function reloadSearchAnalyzers(array $params = [])
1648
+	{
1649
+		$this->checkRequiredParameters(['index'], $params);
1650
+		$url = '/' . $this->encode($params['index']) . '/_reload_search_analyzers';
1651
+		$method = empty($params['body']) ? 'GET' : 'POST';
1652
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'resource', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1653
+		$headers = ['Accept' => 'application/json'];
1654
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1655
+	}
1656
+	/**
1657
+	 * Resolves the specified index expressions to return information about each cluster, including the local cluster, if included.
1658
+	 *
1659
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html
1660
+	 *
1661
+	 * @param array{
1662
+	 *     name: list, // (REQUIRED) A comma-separated list of cluster:index names or wildcard expressions
1663
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1664
+	 *     ignore_throttled: boolean, // Whether specified concrete, expanded or aliased indices should be ignored when throttled
1665
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1666
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1667
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1668
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1669
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1670
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1671
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1672
+	 * } $params
1673
+	 *
1674
+	 * @throws MissingParameterException if a required parameter is missing
1675
+	 * @throws NoNodeAvailableException if all the hosts are offline
1676
+	 * @throws ClientResponseException if the status code of response is 4xx
1677
+	 * @throws ServerResponseException if the status code of response is 5xx
1678
+	 *
1679
+	 * @return Elasticsearch|Promise
1680
+	 */
1681
+	public function resolveCluster(array $params = [])
1682
+	{
1683
+		$this->checkRequiredParameters(['name'], $params);
1684
+		$url = '/_resolve/cluster/' . $this->encode($params['name']);
1685
+		$method = 'GET';
1686
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1687
+		$headers = ['Accept' => 'application/json'];
1688
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1689
+	}
1690
+	/**
1691
+	 * Returns information about any matching indices, aliases, and data streams
1692
+	 *
1693
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html
1694
+	 *
1695
+	 * @param array{
1696
+	 *     name: list, // (REQUIRED) A comma-separated list of names or wildcard expressions
1697
+	 *     expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1698
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1699
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1700
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1701
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1702
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1703
+	 * } $params
1704
+	 *
1705
+	 * @throws MissingParameterException if a required parameter is missing
1706
+	 * @throws NoNodeAvailableException if all the hosts are offline
1707
+	 * @throws ClientResponseException if the status code of response is 4xx
1708
+	 * @throws ServerResponseException if the status code of response is 5xx
1709
+	 *
1710
+	 * @return Elasticsearch|Promise
1711
+	 */
1712
+	public function resolveIndex(array $params = [])
1713
+	{
1714
+		$this->checkRequiredParameters(['name'], $params);
1715
+		$url = '/_resolve/index/' . $this->encode($params['name']);
1716
+		$method = 'GET';
1717
+		$url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1718
+		$headers = ['Accept' => 'application/json'];
1719
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1720
+	}
1721
+	/**
1722
+	 * Updates an alias to point to a new index when the existing index
1723
+	 * is considered to be too large or too old.
1724
+	 *
1725
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html
1726
+	 *
1727
+	 * @param array{
1728
+	 *     alias: string, // (REQUIRED) The name of the alias to rollover
1729
+	 *     new_index: string, //  The name of the rollover index
1730
+	 *     timeout: time, // Explicit operation timeout
1731
+	 *     dry_run: boolean, // If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
1732
+	 *     master_timeout: time, // Specify timeout for connection to master
1733
+	 *     wait_for_active_shards: string, // Set the number of active shards to wait for on the newly created rollover index before the operation returns.
1734
+	 *     lazy: boolean, // If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams.
1735
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1736
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1737
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1738
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1739
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1740
+	 *     body: array, //  The conditions that needs to be met for executing rollover
1741
+	 * } $params
1742
+	 *
1743
+	 * @throws MissingParameterException if a required parameter is missing
1744
+	 * @throws NoNodeAvailableException if all the hosts are offline
1745
+	 * @throws ClientResponseException if the status code of response is 4xx
1746
+	 * @throws ServerResponseException if the status code of response is 5xx
1747
+	 *
1748
+	 * @return Elasticsearch|Promise
1749
+	 */
1750
+	public function rollover(array $params = [])
1751
+	{
1752
+		$this->checkRequiredParameters(['alias'], $params);
1753
+		if (isset($params['new_index'])) {
1754
+			$url = '/' . $this->encode($params['alias']) . '/_rollover/' . $this->encode($params['new_index']);
1755
+			$method = 'POST';
1756
+		} else {
1757
+			$url = '/' . $this->encode($params['alias']) . '/_rollover';
1758
+			$method = 'POST';
1759
+		}
1760
+		$url = $this->addQueryString($url, $params, ['timeout', 'dry_run', 'master_timeout', 'wait_for_active_shards', 'lazy', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1761
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1762
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1763
+	}
1764
+	/**
1765
+	 * Provides low-level information about segments in a Lucene index.
1766
+	 *
1767
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html
1768
+	 *
1769
+	 * @param array{
1770
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1771
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1772
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1773
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1774
+	 *     verbose: boolean, // Includes detailed memory usage by Lucene.
1775
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1776
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1777
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1778
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1779
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1780
+	 * } $params
1781
+	 *
1782
+	 * @throws NoNodeAvailableException if all the hosts are offline
1783
+	 * @throws ClientResponseException if the status code of response is 4xx
1784
+	 * @throws ServerResponseException if the status code of response is 5xx
1785
+	 *
1786
+	 * @return Elasticsearch|Promise
1787
+	 */
1788
+	public function segments(array $params = [])
1789
+	{
1790
+		if (isset($params['index'])) {
1791
+			$url = '/' . $this->encode($params['index']) . '/_segments';
1792
+			$method = 'GET';
1793
+		} else {
1794
+			$url = '/_segments';
1795
+			$method = 'GET';
1796
+		}
1797
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1798
+		$headers = ['Accept' => 'application/json'];
1799
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1800
+	}
1801
+	/**
1802
+	 * Provides store information for shard copies of indices.
1803
+	 *
1804
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html
1805
+	 *
1806
+	 * @param array{
1807
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1808
+	 *     status: list, // A comma-separated list of statuses used to filter on shards to get store information for
1809
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
1810
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1811
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1812
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1813
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1814
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1815
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1816
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1817
+	 * } $params
1818
+	 *
1819
+	 * @throws NoNodeAvailableException if all the hosts are offline
1820
+	 * @throws ClientResponseException if the status code of response is 4xx
1821
+	 * @throws ServerResponseException if the status code of response is 5xx
1822
+	 *
1823
+	 * @return Elasticsearch|Promise
1824
+	 */
1825
+	public function shardStores(array $params = [])
1826
+	{
1827
+		if (isset($params['index'])) {
1828
+			$url = '/' . $this->encode($params['index']) . '/_shard_stores';
1829
+			$method = 'GET';
1830
+		} else {
1831
+			$url = '/_shard_stores';
1832
+			$method = 'GET';
1833
+		}
1834
+		$url = $this->addQueryString($url, $params, ['status', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1835
+		$headers = ['Accept' => 'application/json'];
1836
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1837
+	}
1838
+	/**
1839
+	 * Allow to shrink an existing index into a new index with fewer primary shards.
1840
+	 *
1841
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html
1842
+	 *
1843
+	 * @param array{
1844
+	 *     index: string, // (REQUIRED) The name of the source index to shrink
1845
+	 *     target: string, // (REQUIRED) The name of the target index to shrink into
1846
+	 *     timeout: time, // Explicit operation timeout
1847
+	 *     master_timeout: time, // Specify timeout for connection to master
1848
+	 *     wait_for_active_shards: string, // Set the number of active shards to wait for on the shrunken index before the operation returns.
1849
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1850
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1851
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1852
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1853
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1854
+	 *     body: array, //  The configuration for the target index (`settings` and `aliases`)
1855
+	 * } $params
1856
+	 *
1857
+	 * @throws MissingParameterException if a required parameter is missing
1858
+	 * @throws NoNodeAvailableException if all the hosts are offline
1859
+	 * @throws ClientResponseException if the status code of response is 4xx
1860
+	 * @throws ServerResponseException if the status code of response is 5xx
1861
+	 *
1862
+	 * @return Elasticsearch|Promise
1863
+	 */
1864
+	public function shrink(array $params = [])
1865
+	{
1866
+		$this->checkRequiredParameters(['index', 'target'], $params);
1867
+		$url = '/' . $this->encode($params['index']) . '/_shrink/' . $this->encode($params['target']);
1868
+		$method = 'PUT';
1869
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1870
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1871
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1872
+	}
1873
+	/**
1874
+	 * Simulate matching the given index name against the index templates in the system
1875
+	 *
1876
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html
1877
+	 *
1878
+	 * @param array{
1879
+	 *     name: string, // (REQUIRED) The name of the index (it must be a concrete index name)
1880
+	 *     create: boolean, // 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
1881
+	 *     cause: string, // User defined reason for dry-run creating the new template for simulation purposes
1882
+	 *     master_timeout: time, // Specify timeout for connection to master
1883
+	 *     include_defaults: boolean, // Return all relevant default configurations for this index template simulation (default: false)
1884
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1885
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1886
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1887
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1888
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1889
+	 *     body: array, //  New index template definition, which will be included in the simulation, as if it already exists in the system
1890
+	 * } $params
1891
+	 *
1892
+	 * @throws MissingParameterException if a required parameter is missing
1893
+	 * @throws NoNodeAvailableException if all the hosts are offline
1894
+	 * @throws ClientResponseException if the status code of response is 4xx
1895
+	 * @throws ServerResponseException if the status code of response is 5xx
1896
+	 *
1897
+	 * @return Elasticsearch|Promise
1898
+	 */
1899
+	public function simulateIndexTemplate(array $params = [])
1900
+	{
1901
+		$this->checkRequiredParameters(['name'], $params);
1902
+		$url = '/_index_template/_simulate_index/' . $this->encode($params['name']);
1903
+		$method = 'POST';
1904
+		$url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1905
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1906
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1907
+	}
1908
+	/**
1909
+	 * Simulate resolving the given template name or body
1910
+	 *
1911
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html
1912
+	 *
1913
+	 * @param array{
1914
+	 *     name: string, //  The name of the index template
1915
+	 *     create: boolean, // 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
1916
+	 *     cause: string, // User defined reason for dry-run creating the new template for simulation purposes
1917
+	 *     master_timeout: time, // Specify timeout for connection to master
1918
+	 *     include_defaults: boolean, // Return all relevant default configurations for this template simulation (default: false)
1919
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1920
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1921
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1922
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1923
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1924
+	 *     body: array, //  New index template definition to be simulated, if no index template name is specified
1925
+	 * } $params
1926
+	 *
1927
+	 * @throws NoNodeAvailableException if all the hosts are offline
1928
+	 * @throws ClientResponseException if the status code of response is 4xx
1929
+	 * @throws ServerResponseException if the status code of response is 5xx
1930
+	 *
1931
+	 * @return Elasticsearch|Promise
1932
+	 */
1933
+	public function simulateTemplate(array $params = [])
1934
+	{
1935
+		if (isset($params['name'])) {
1936
+			$url = '/_index_template/_simulate/' . $this->encode($params['name']);
1937
+			$method = 'POST';
1938
+		} else {
1939
+			$url = '/_index_template/_simulate';
1940
+			$method = 'POST';
1941
+		}
1942
+		$url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1943
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1944
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1945
+	}
1946
+	/**
1947
+	 * Allows you to split an existing index into a new index with more primary shards.
1948
+	 *
1949
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html
1950
+	 *
1951
+	 * @param array{
1952
+	 *     index: string, // (REQUIRED) The name of the source index to split
1953
+	 *     target: string, // (REQUIRED) The name of the target index to split into
1954
+	 *     timeout: time, // Explicit operation timeout
1955
+	 *     master_timeout: time, // Specify timeout for connection to master
1956
+	 *     wait_for_active_shards: string, // Set the number of active shards to wait for on the shrunken index before the operation returns.
1957
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1958
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1959
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1960
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1961
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1962
+	 *     body: array, //  The configuration for the target index (`settings` and `aliases`)
1963
+	 * } $params
1964
+	 *
1965
+	 * @throws MissingParameterException if a required parameter is missing
1966
+	 * @throws NoNodeAvailableException if all the hosts are offline
1967
+	 * @throws ClientResponseException if the status code of response is 4xx
1968
+	 * @throws ServerResponseException if the status code of response is 5xx
1969
+	 *
1970
+	 * @return Elasticsearch|Promise
1971
+	 */
1972
+	public function split(array $params = [])
1973
+	{
1974
+		$this->checkRequiredParameters(['index', 'target'], $params);
1975
+		$url = '/' . $this->encode($params['index']) . '/_split/' . $this->encode($params['target']);
1976
+		$method = 'PUT';
1977
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1978
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1979
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1980
+	}
1981
+	/**
1982
+	 * Provides statistics on operations happening in an index.
1983
+	 *
1984
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html
1985
+	 *
1986
+	 * @param array{
1987
+	 *     metric: list, //  Limit the information returned the specific metrics.
1988
+	 *     index: list, //  A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1989
+	 *     completion_fields: list, // A comma-separated list of fields for the `completion` index metric (supports wildcards)
1990
+	 *     fielddata_fields: list, // A comma-separated list of fields for the `fielddata` index metric (supports wildcards)
1991
+	 *     fields: list, // A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
1992
+	 *     groups: list, // A comma-separated list of search groups for `search` index metric
1993
+	 *     level: enum, // Return stats aggregated at cluster, index or shard level
1994
+	 *     include_segment_file_sizes: boolean, // Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
1995
+	 *     include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory
1996
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
1997
+	 *     forbid_closed_indices: boolean, // If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
1998
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1999
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2000
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2001
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2002
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2003
+	 * } $params
2004
+	 *
2005
+	 * @throws NoNodeAvailableException if all the hosts are offline
2006
+	 * @throws ClientResponseException if the status code of response is 4xx
2007
+	 * @throws ServerResponseException if the status code of response is 5xx
2008
+	 *
2009
+	 * @return Elasticsearch|Promise
2010
+	 */
2011
+	public function stats(array $params = [])
2012
+	{
2013
+		if (isset($params['index']) && isset($params['metric'])) {
2014
+			$url = '/' . $this->encode($params['index']) . '/_stats/' . $this->encode($params['metric']);
2015
+			$method = 'GET';
2016
+		} elseif (isset($params['metric'])) {
2017
+			$url = '/_stats/' . $this->encode($params['metric']);
2018
+			$method = 'GET';
2019
+		} elseif (isset($params['index'])) {
2020
+			$url = '/' . $this->encode($params['index']) . '/_stats';
2021
+			$method = 'GET';
2022
+		} else {
2023
+			$url = '/_stats';
2024
+			$method = 'GET';
2025
+		}
2026
+		$url = $this->addQueryString($url, $params, ['completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'include_segment_file_sizes', 'include_unloaded_segments', 'expand_wildcards', 'forbid_closed_indices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2027
+		$headers = ['Accept' => 'application/json'];
2028
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2029
+	}
2030
+	/**
2031
+	 * Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.
2032
+	 *
2033
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html
2034
+	 *
2035
+	 * @param array{
2036
+	 *     index: string, // (REQUIRED) The name of the index to unfreeze
2037
+	 *     timeout: time, // Explicit operation timeout
2038
+	 *     master_timeout: time, // Specify timeout for connection to master
2039
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
2040
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2041
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
2042
+	 *     wait_for_active_shards: string, // Sets the number of active shards to wait for before the operation returns.
2043
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2044
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2045
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2046
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2047
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2048
+	 * } $params
2049
+	 *
2050
+	 * @throws MissingParameterException if a required parameter is missing
2051
+	 * @throws NoNodeAvailableException if all the hosts are offline
2052
+	 * @throws ClientResponseException if the status code of response is 4xx
2053
+	 * @throws ServerResponseException if the status code of response is 5xx
2054
+	 *
2055
+	 * @return Elasticsearch|Promise
2056
+	 */
2057
+	public function unfreeze(array $params = [])
2058
+	{
2059
+		$this->checkRequiredParameters(['index'], $params);
2060
+		$url = '/' . $this->encode($params['index']) . '/_unfreeze';
2061
+		$method = 'POST';
2062
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2063
+		$headers = ['Accept' => 'application/json'];
2064
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2065
+	}
2066
+	/**
2067
+	 * Updates index aliases.
2068
+	 *
2069
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
2070
+	 *
2071
+	 * @param array{
2072
+	 *     timeout: time, // Request timeout
2073
+	 *     master_timeout: time, // Specify timeout for connection to master
2074
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2075
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2076
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2077
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2078
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2079
+	 *     body: array, // (REQUIRED) The definition of `actions` to perform
2080
+	 * } $params
2081
+	 *
2082
+	 * @throws NoNodeAvailableException if all the hosts are offline
2083
+	 * @throws ClientResponseException if the status code of response is 4xx
2084
+	 * @throws ServerResponseException if the status code of response is 5xx
2085
+	 *
2086
+	 * @return Elasticsearch|Promise
2087
+	 */
2088
+	public function updateAliases(array $params = [])
2089
+	{
2090
+		$this->checkRequiredParameters(['body'], $params);
2091
+		$url = '/_aliases';
2092
+		$method = 'POST';
2093
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2094
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2095
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2096
+	}
2097
+	/**
2098
+	 * Allows a user to validate a potentially expensive query without executing it.
2099
+	 *
2100
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html
2101
+	 *
2102
+	 * @param array{
2103
+	 *     index: list, //  A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
2104
+	 *     explain: boolean, // Return detailed information about the error
2105
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
2106
+	 *     allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2107
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
2108
+	 *     q: string, // Query in the Lucene query string syntax
2109
+	 *     analyzer: string, // The analyzer to use for the query string
2110
+	 *     analyze_wildcard: boolean, // Specify whether wildcard and prefix queries should be analyzed (default: false)
2111
+	 *     default_operator: enum, // The default operator for query string query (AND or OR)
2112
+	 *     df: string, // The field to use as default where no field prefix is given in the query string
2113
+	 *     lenient: boolean, // Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
2114
+	 *     rewrite: boolean, // Provide a more detailed explanation showing the actual Lucene query that will be executed.
2115
+	 *     all_shards: boolean, // Execute validation on all shards instead of one random shard per index
2116
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2117
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2118
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2119
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2120
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2121
+	 *     body: array, //  The query definition specified with the Query DSL
2122
+	 * } $params
2123
+	 *
2124
+	 * @throws NoNodeAvailableException if all the hosts are offline
2125
+	 * @throws ClientResponseException if the status code of response is 4xx
2126
+	 * @throws ServerResponseException if the status code of response is 5xx
2127
+	 *
2128
+	 * @return Elasticsearch|Promise
2129
+	 */
2130
+	public function validateQuery(array $params = [])
2131
+	{
2132
+		if (isset($params['index'])) {
2133
+			$url = '/' . $this->encode($params['index']) . '/_validate/query';
2134
+			$method = empty($params['body']) ? 'GET' : 'POST';
2135
+		} else {
2136
+			$url = '/_validate/query';
2137
+			$method = empty($params['body']) ? 'GET' : 'POST';
2138
+		}
2139
+		$url = $this->addQueryString($url, $params, ['explain', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2140
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2141
+		return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2142
+	}
2143 2143
 }
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public function addBlock(array $params = [])
56 56
     {
57 57
         $this->checkRequiredParameters(['index', 'block'], $params);
58
-        $url = '/' . $this->encode($params['index']) . '/_block/' . $this->encode($params['block']);
58
+        $url = '/'.$this->encode($params['index']).'/_block/'.$this->encode($params['block']);
59 59
         $method = 'PUT';
60 60
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
61 61
         $headers = ['Accept' => 'application/json'];
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function analyze(array $params = [])
86 86
     {
87 87
         if (isset($params['index'])) {
88
-            $url = '/' . $this->encode($params['index']) . '/_analyze';
88
+            $url = '/'.$this->encode($params['index']).'/_analyze';
89 89
             $method = empty($params['body']) ? 'GET' : 'POST';
90 90
         } else {
91 91
             $url = '/_analyze';
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     public function clearCache(array $params = [])
126 126
     {
127 127
         if (isset($params['index'])) {
128
-            $url = '/' . $this->encode($params['index']) . '/_cache/clear';
128
+            $url = '/'.$this->encode($params['index']).'/_cache/clear';
129 129
             $method = 'POST';
130 130
         } else {
131 131
             $url = '/_cache/clear';
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     public function clone(array $params = [])
165 165
     {
166 166
         $this->checkRequiredParameters(['index', 'target'], $params);
167
-        $url = '/' . $this->encode($params['index']) . '/_clone/' . $this->encode($params['target']);
167
+        $url = '/'.$this->encode($params['index']).'/_clone/'.$this->encode($params['target']);
168 168
         $method = 'PUT';
169 169
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
170 170
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     public function close(array $params = [])
201 201
     {
202 202
         $this->checkRequiredParameters(['index'], $params);
203
-        $url = '/' . $this->encode($params['index']) . '/_close';
203
+        $url = '/'.$this->encode($params['index']).'/_close';
204 204
         $method = 'POST';
205 205
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
206 206
         $headers = ['Accept' => 'application/json'];
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     public function create(array $params = [])
235 235
     {
236 236
         $this->checkRequiredParameters(['index'], $params);
237
-        $url = '/' . $this->encode($params['index']);
237
+        $url = '/'.$this->encode($params['index']);
238 238
         $method = 'PUT';
239 239
         $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
240 240
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     public function createDataStream(array $params = [])
265 265
     {
266 266
         $this->checkRequiredParameters(['name'], $params);
267
-        $url = '/_data_stream/' . $this->encode($params['name']);
267
+        $url = '/_data_stream/'.$this->encode($params['name']);
268 268
         $method = 'PUT';
269 269
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
270 270
         $headers = ['Accept' => 'application/json'];
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     public function dataStreamsStats(array $params = [])
294 294
     {
295 295
         if (isset($params['name'])) {
296
-            $url = '/_data_stream/' . $this->encode($params['name']) . '/_stats';
296
+            $url = '/_data_stream/'.$this->encode($params['name']).'/_stats';
297 297
             $method = 'GET';
298 298
         } else {
299 299
             $url = '/_data_stream/_stats';
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     public function delete(array $params = [])
333 333
     {
334 334
         $this->checkRequiredParameters(['index'], $params);
335
-        $url = '/' . $this->encode($params['index']);
335
+        $url = '/'.$this->encode($params['index']);
336 336
         $method = 'DELETE';
337 337
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
338 338
         $headers = ['Accept' => 'application/json'];
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     public function deleteAlias(array $params = [])
366 366
     {
367 367
         $this->checkRequiredParameters(['index', 'name'], $params);
368
-        $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
368
+        $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']);
369 369
         $method = 'DELETE';
370 370
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
371 371
         $headers = ['Accept' => 'application/json'];
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
     public function deleteDataLifecycle(array $params = [])
400 400
     {
401 401
         $this->checkRequiredParameters(['name'], $params);
402
-        $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
402
+        $url = '/_data_stream/'.$this->encode($params['name']).'/_lifecycle';
403 403
         $method = 'DELETE';
404 404
         $url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
405 405
         $headers = ['Accept' => 'application/json'];
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     public function deleteDataStream(array $params = [])
431 431
     {
432 432
         $this->checkRequiredParameters(['name'], $params);
433
-        $url = '/_data_stream/' . $this->encode($params['name']);
433
+        $url = '/_data_stream/'.$this->encode($params['name']);
434 434
         $method = 'DELETE';
435 435
         $url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
436 436
         $headers = ['Accept' => 'application/json'];
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
     public function deleteIndexTemplate(array $params = [])
463 463
     {
464 464
         $this->checkRequiredParameters(['name'], $params);
465
-        $url = '/_index_template/' . $this->encode($params['name']);
465
+        $url = '/_index_template/'.$this->encode($params['name']);
466 466
         $method = 'DELETE';
467 467
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
468 468
         $headers = ['Accept' => 'application/json'];
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
     public function deleteTemplate(array $params = [])
495 495
     {
496 496
         $this->checkRequiredParameters(['name'], $params);
497
-        $url = '/_template/' . $this->encode($params['name']);
497
+        $url = '/_template/'.$this->encode($params['name']);
498 498
         $method = 'DELETE';
499 499
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
500 500
         $headers = ['Accept' => 'application/json'];
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
     public function diskUsage(array $params = [])
531 531
     {
532 532
         $this->checkRequiredParameters(['index'], $params);
533
-        $url = '/' . $this->encode($params['index']) . '/_disk_usage';
533
+        $url = '/'.$this->encode($params['index']).'/_disk_usage';
534 534
         $method = 'POST';
535 535
         $url = $this->addQueryString($url, $params, ['run_expensive_tasks', 'flush', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
536 536
         $headers = ['Accept' => 'application/json'];
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
     public function downsample(array $params = [])
564 564
     {
565 565
         $this->checkRequiredParameters(['index', 'target_index', 'body'], $params);
566
-        $url = '/' . $this->encode($params['index']) . '/_downsample/' . $this->encode($params['target_index']);
566
+        $url = '/'.$this->encode($params['index']).'/_downsample/'.$this->encode($params['target_index']);
567 567
         $method = 'POST';
568 568
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
569 569
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
     public function exists(array $params = [])
600 600
     {
601 601
         $this->checkRequiredParameters(['index'], $params);
602
-        $url = '/' . $this->encode($params['index']);
602
+        $url = '/'.$this->encode($params['index']);
603 603
         $method = 'HEAD';
604 604
         $url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
605 605
         $headers = ['Accept' => 'application/json'];
@@ -635,10 +635,10 @@  discard block
 block discarded – undo
635 635
     {
636 636
         $this->checkRequiredParameters(['name'], $params);
637 637
         if (isset($params['index'])) {
638
-            $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
638
+            $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']);
639 639
             $method = 'HEAD';
640 640
         } else {
641
-            $url = '/_alias/' . $this->encode($params['name']);
641
+            $url = '/_alias/'.$this->encode($params['name']);
642 642
             $method = 'HEAD';
643 643
         }
644 644
         $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
     public function existsIndexTemplate(array $params = [])
673 673
     {
674 674
         $this->checkRequiredParameters(['name'], $params);
675
-        $url = '/_index_template/' . $this->encode($params['name']);
675
+        $url = '/_index_template/'.$this->encode($params['name']);
676 676
         $method = 'HEAD';
677 677
         $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
678 678
         $headers = ['Accept' => 'application/json'];
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
     public function existsTemplate(array $params = [])
706 706
     {
707 707
         $this->checkRequiredParameters(['name'], $params);
708
-        $url = '/_template/' . $this->encode($params['name']);
708
+        $url = '/_template/'.$this->encode($params['name']);
709 709
         $method = 'HEAD';
710 710
         $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
711 711
         $headers = ['Accept' => 'application/json'];
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
     public function explainDataLifecycle(array $params = [])
739 739
     {
740 740
         $this->checkRequiredParameters(['index'], $params);
741
-        $url = '/' . $this->encode($params['index']) . '/_lifecycle/explain';
741
+        $url = '/'.$this->encode($params['index']).'/_lifecycle/explain';
742 742
         $method = 'GET';
743 743
         $url = $this->addQueryString($url, $params, ['include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
744 744
         $headers = ['Accept' => 'application/json'];
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     public function fieldUsageStats(array $params = [])
774 774
     {
775 775
         $this->checkRequiredParameters(['index'], $params);
776
-        $url = '/' . $this->encode($params['index']) . '/_field_usage_stats';
776
+        $url = '/'.$this->encode($params['index']).'/_field_usage_stats';
777 777
         $method = 'GET';
778 778
         $url = $this->addQueryString($url, $params, ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
779 779
         $headers = ['Accept' => 'application/json'];
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
     public function flush(array $params = [])
808 808
     {
809 809
         if (isset($params['index'])) {
810
-            $url = '/' . $this->encode($params['index']) . '/_flush';
810
+            $url = '/'.$this->encode($params['index']).'/_flush';
811 811
             $method = empty($params['body']) ? 'GET' : 'POST';
812 812
         } else {
813 813
             $url = '/_flush';
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
     public function forcemerge(array $params = [])
848 848
     {
849 849
         if (isset($params['index'])) {
850
-            $url = '/' . $this->encode($params['index']) . '/_forcemerge';
850
+            $url = '/'.$this->encode($params['index']).'/_forcemerge';
851 851
             $method = 'POST';
852 852
         } else {
853 853
             $url = '/_forcemerge';
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
     public function get(array $params = [])
890 890
     {
891 891
         $this->checkRequiredParameters(['index'], $params);
892
-        $url = '/' . $this->encode($params['index']);
892
+        $url = '/'.$this->encode($params['index']);
893 893
         $method = 'GET';
894 894
         $url = $this->addQueryString($url, $params, ['local', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'features', 'flat_settings', 'include_defaults', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
895 895
         $headers = ['Accept' => 'application/json'];
@@ -923,13 +923,13 @@  discard block
 block discarded – undo
923 923
     public function getAlias(array $params = [])
924 924
     {
925 925
         if (isset($params['index']) && isset($params['name'])) {
926
-            $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
926
+            $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']);
927 927
             $method = 'GET';
928 928
         } elseif (isset($params['name'])) {
929
-            $url = '/_alias/' . $this->encode($params['name']);
929
+            $url = '/_alias/'.$this->encode($params['name']);
930 930
             $method = 'GET';
931 931
         } elseif (isset($params['index'])) {
932
-            $url = '/' . $this->encode($params['index']) . '/_alias';
932
+            $url = '/'.$this->encode($params['index']).'/_alias';
933 933
             $method = 'GET';
934 934
         } else {
935 935
             $url = '/_alias';
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
     public function getDataLifecycle(array $params = [])
967 967
     {
968 968
         $this->checkRequiredParameters(['name'], $params);
969
-        $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
969
+        $url = '/_data_stream/'.$this->encode($params['name']).'/_lifecycle';
970 970
         $method = 'GET';
971 971
         $url = $this->addQueryString($url, $params, ['expand_wildcards', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
972 972
         $headers = ['Accept' => 'application/json'];
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
     public function getDataStream(array $params = [])
998 998
     {
999 999
         if (isset($params['name'])) {
1000
-            $url = '/_data_stream/' . $this->encode($params['name']);
1000
+            $url = '/_data_stream/'.$this->encode($params['name']);
1001 1001
             $method = 'GET';
1002 1002
         } else {
1003 1003
             $url = '/_data_stream';
@@ -1038,10 +1038,10 @@  discard block
 block discarded – undo
1038 1038
     {
1039 1039
         $this->checkRequiredParameters(['fields'], $params);
1040 1040
         if (isset($params['index'])) {
1041
-            $url = '/' . $this->encode($params['index']) . '/_mapping/field/' . $this->encode($params['fields']);
1041
+            $url = '/'.$this->encode($params['index']).'/_mapping/field/'.$this->encode($params['fields']);
1042 1042
             $method = 'GET';
1043 1043
         } else {
1044
-            $url = '/_mapping/field/' . $this->encode($params['fields']);
1044
+            $url = '/_mapping/field/'.$this->encode($params['fields']);
1045 1045
             $method = 'GET';
1046 1046
         }
1047 1047
         $url = $this->addQueryString($url, $params, ['include_defaults', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
     public function getIndexTemplate(array $params = [])
1076 1076
     {
1077 1077
         if (isset($params['name'])) {
1078
-            $url = '/_index_template/' . $this->encode($params['name']);
1078
+            $url = '/_index_template/'.$this->encode($params['name']);
1079 1079
             $method = 'GET';
1080 1080
         } else {
1081 1081
             $url = '/_index_template';
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
     public function getMapping(array $params = [])
1114 1114
     {
1115 1115
         if (isset($params['index'])) {
1116
-            $url = '/' . $this->encode($params['index']) . '/_mapping';
1116
+            $url = '/'.$this->encode($params['index']).'/_mapping';
1117 1117
             $method = 'GET';
1118 1118
         } else {
1119 1119
             $url = '/_mapping';
@@ -1154,13 +1154,13 @@  discard block
 block discarded – undo
1154 1154
     public function getSettings(array $params = [])
1155 1155
     {
1156 1156
         if (isset($params['index']) && isset($params['name'])) {
1157
-            $url = '/' . $this->encode($params['index']) . '/_settings/' . $this->encode($params['name']);
1157
+            $url = '/'.$this->encode($params['index']).'/_settings/'.$this->encode($params['name']);
1158 1158
             $method = 'GET';
1159 1159
         } elseif (isset($params['index'])) {
1160
-            $url = '/' . $this->encode($params['index']) . '/_settings';
1160
+            $url = '/'.$this->encode($params['index']).'/_settings';
1161 1161
             $method = 'GET';
1162 1162
         } elseif (isset($params['name'])) {
1163
-            $url = '/_settings/' . $this->encode($params['name']);
1163
+            $url = '/_settings/'.$this->encode($params['name']);
1164 1164
             $method = 'GET';
1165 1165
         } else {
1166 1166
             $url = '/_settings';
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
     public function getTemplate(array $params = [])
1197 1197
     {
1198 1198
         if (isset($params['name'])) {
1199
-            $url = '/_template/' . $this->encode($params['name']);
1199
+            $url = '/_template/'.$this->encode($params['name']);
1200 1200
             $method = 'GET';
1201 1201
         } else {
1202 1202
             $url = '/_template';
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
     public function migrateToDataStream(array $params = [])
1231 1231
     {
1232 1232
         $this->checkRequiredParameters(['name'], $params);
1233
-        $url = '/_data_stream/_migrate/' . $this->encode($params['name']);
1233
+        $url = '/_data_stream/_migrate/'.$this->encode($params['name']);
1234 1234
         $method = 'POST';
1235 1235
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1236 1236
         $headers = ['Accept' => 'application/json'];
@@ -1295,7 +1295,7 @@  discard block
 block discarded – undo
1295 1295
     public function open(array $params = [])
1296 1296
     {
1297 1297
         $this->checkRequiredParameters(['index'], $params);
1298
-        $url = '/' . $this->encode($params['index']) . '/_open';
1298
+        $url = '/'.$this->encode($params['index']).'/_open';
1299 1299
         $method = 'POST';
1300 1300
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1301 1301
         $headers = ['Accept' => 'application/json'];
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
     public function promoteDataStream(array $params = [])
1326 1326
     {
1327 1327
         $this->checkRequiredParameters(['name'], $params);
1328
-        $url = '/_data_stream/_promote/' . $this->encode($params['name']);
1328
+        $url = '/_data_stream/_promote/'.$this->encode($params['name']);
1329 1329
         $method = 'POST';
1330 1330
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1331 1331
         $headers = ['Accept' => 'application/json'];
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
     public function putAlias(array $params = [])
1360 1360
     {
1361 1361
         $this->checkRequiredParameters(['index', 'name'], $params);
1362
-        $url = '/' . $this->encode($params['index']) . '/_alias/' . $this->encode($params['name']);
1362
+        $url = '/'.$this->encode($params['index']).'/_alias/'.$this->encode($params['name']);
1363 1363
         $method = 'PUT';
1364 1364
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1365 1365
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
     public function putDataLifecycle(array $params = [])
1395 1395
     {
1396 1396
         $this->checkRequiredParameters(['name'], $params);
1397
-        $url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
1397
+        $url = '/_data_stream/'.$this->encode($params['name']).'/_lifecycle';
1398 1398
         $method = 'PUT';
1399 1399
         $url = $this->addQueryString($url, $params, ['expand_wildcards', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1400 1400
         $headers = ['Accept' => 'application/json'];
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
     public function putIndexTemplate(array $params = [])
1429 1429
     {
1430 1430
         $this->checkRequiredParameters(['name', 'body'], $params);
1431
-        $url = '/_index_template/' . $this->encode($params['name']);
1431
+        $url = '/_index_template/'.$this->encode($params['name']);
1432 1432
         $method = 'PUT';
1433 1433
         $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1434 1434
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1465,7 +1465,7 @@  discard block
 block discarded – undo
1465 1465
     public function putMapping(array $params = [])
1466 1466
     {
1467 1467
         $this->checkRequiredParameters(['index', 'body'], $params);
1468
-        $url = '/' . $this->encode($params['index']) . '/_mapping';
1468
+        $url = '/'.$this->encode($params['index']).'/_mapping';
1469 1469
         $method = 'PUT';
1470 1470
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'write_index_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1471 1471
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1504,7 +1504,7 @@  discard block
 block discarded – undo
1504 1504
     {
1505 1505
         $this->checkRequiredParameters(['body'], $params);
1506 1506
         if (isset($params['index'])) {
1507
-            $url = '/' . $this->encode($params['index']) . '/_settings';
1507
+            $url = '/'.$this->encode($params['index']).'/_settings';
1508 1508
             $method = 'PUT';
1509 1509
         } else {
1510 1510
             $url = '/_settings';
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
     public function putTemplate(array $params = [])
1543 1543
     {
1544 1544
         $this->checkRequiredParameters(['name', 'body'], $params);
1545
-        $url = '/_template/' . $this->encode($params['name']);
1545
+        $url = '/_template/'.$this->encode($params['name']);
1546 1546
         $method = 'PUT';
1547 1547
         $url = $this->addQueryString($url, $params, ['order', 'create', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1548 1548
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
     public function recovery(array $params = [])
1574 1574
     {
1575 1575
         if (isset($params['index'])) {
1576
-            $url = '/' . $this->encode($params['index']) . '/_recovery';
1576
+            $url = '/'.$this->encode($params['index']).'/_recovery';
1577 1577
             $method = 'GET';
1578 1578
         } else {
1579 1579
             $url = '/_recovery';
@@ -1609,7 +1609,7 @@  discard block
 block discarded – undo
1609 1609
     public function refresh(array $params = [])
1610 1610
     {
1611 1611
         if (isset($params['index'])) {
1612
-            $url = '/' . $this->encode($params['index']) . '/_refresh';
1612
+            $url = '/'.$this->encode($params['index']).'/_refresh';
1613 1613
             $method = empty($params['body']) ? 'GET' : 'POST';
1614 1614
         } else {
1615 1615
             $url = '/_refresh';
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
     public function reloadSearchAnalyzers(array $params = [])
1648 1648
     {
1649 1649
         $this->checkRequiredParameters(['index'], $params);
1650
-        $url = '/' . $this->encode($params['index']) . '/_reload_search_analyzers';
1650
+        $url = '/'.$this->encode($params['index']).'/_reload_search_analyzers';
1651 1651
         $method = empty($params['body']) ? 'GET' : 'POST';
1652 1652
         $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'resource', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1653 1653
         $headers = ['Accept' => 'application/json'];
@@ -1681,7 +1681,7 @@  discard block
 block discarded – undo
1681 1681
     public function resolveCluster(array $params = [])
1682 1682
     {
1683 1683
         $this->checkRequiredParameters(['name'], $params);
1684
-        $url = '/_resolve/cluster/' . $this->encode($params['name']);
1684
+        $url = '/_resolve/cluster/'.$this->encode($params['name']);
1685 1685
         $method = 'GET';
1686 1686
         $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1687 1687
         $headers = ['Accept' => 'application/json'];
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
     public function resolveIndex(array $params = [])
1713 1713
     {
1714 1714
         $this->checkRequiredParameters(['name'], $params);
1715
-        $url = '/_resolve/index/' . $this->encode($params['name']);
1715
+        $url = '/_resolve/index/'.$this->encode($params['name']);
1716 1716
         $method = 'GET';
1717 1717
         $url = $this->addQueryString($url, $params, ['expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1718 1718
         $headers = ['Accept' => 'application/json'];
@@ -1751,10 +1751,10 @@  discard block
 block discarded – undo
1751 1751
     {
1752 1752
         $this->checkRequiredParameters(['alias'], $params);
1753 1753
         if (isset($params['new_index'])) {
1754
-            $url = '/' . $this->encode($params['alias']) . '/_rollover/' . $this->encode($params['new_index']);
1754
+            $url = '/'.$this->encode($params['alias']).'/_rollover/'.$this->encode($params['new_index']);
1755 1755
             $method = 'POST';
1756 1756
         } else {
1757
-            $url = '/' . $this->encode($params['alias']) . '/_rollover';
1757
+            $url = '/'.$this->encode($params['alias']).'/_rollover';
1758 1758
             $method = 'POST';
1759 1759
         }
1760 1760
         $url = $this->addQueryString($url, $params, ['timeout', 'dry_run', 'master_timeout', 'wait_for_active_shards', 'lazy', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
@@ -1788,7 +1788,7 @@  discard block
 block discarded – undo
1788 1788
     public function segments(array $params = [])
1789 1789
     {
1790 1790
         if (isset($params['index'])) {
1791
-            $url = '/' . $this->encode($params['index']) . '/_segments';
1791
+            $url = '/'.$this->encode($params['index']).'/_segments';
1792 1792
             $method = 'GET';
1793 1793
         } else {
1794 1794
             $url = '/_segments';
@@ -1825,7 +1825,7 @@  discard block
 block discarded – undo
1825 1825
     public function shardStores(array $params = [])
1826 1826
     {
1827 1827
         if (isset($params['index'])) {
1828
-            $url = '/' . $this->encode($params['index']) . '/_shard_stores';
1828
+            $url = '/'.$this->encode($params['index']).'/_shard_stores';
1829 1829
             $method = 'GET';
1830 1830
         } else {
1831 1831
             $url = '/_shard_stores';
@@ -1864,7 +1864,7 @@  discard block
 block discarded – undo
1864 1864
     public function shrink(array $params = [])
1865 1865
     {
1866 1866
         $this->checkRequiredParameters(['index', 'target'], $params);
1867
-        $url = '/' . $this->encode($params['index']) . '/_shrink/' . $this->encode($params['target']);
1867
+        $url = '/'.$this->encode($params['index']).'/_shrink/'.$this->encode($params['target']);
1868 1868
         $method = 'PUT';
1869 1869
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1870 1870
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
     public function simulateIndexTemplate(array $params = [])
1900 1900
     {
1901 1901
         $this->checkRequiredParameters(['name'], $params);
1902
-        $url = '/_index_template/_simulate_index/' . $this->encode($params['name']);
1902
+        $url = '/_index_template/_simulate_index/'.$this->encode($params['name']);
1903 1903
         $method = 'POST';
1904 1904
         $url = $this->addQueryString($url, $params, ['create', 'cause', 'master_timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1905 1905
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
     public function simulateTemplate(array $params = [])
1934 1934
     {
1935 1935
         if (isset($params['name'])) {
1936
-            $url = '/_index_template/_simulate/' . $this->encode($params['name']);
1936
+            $url = '/_index_template/_simulate/'.$this->encode($params['name']);
1937 1937
             $method = 'POST';
1938 1938
         } else {
1939 1939
             $url = '/_index_template/_simulate';
@@ -1972,7 +1972,7 @@  discard block
 block discarded – undo
1972 1972
     public function split(array $params = [])
1973 1973
     {
1974 1974
         $this->checkRequiredParameters(['index', 'target'], $params);
1975
-        $url = '/' . $this->encode($params['index']) . '/_split/' . $this->encode($params['target']);
1975
+        $url = '/'.$this->encode($params['index']).'/_split/'.$this->encode($params['target']);
1976 1976
         $method = 'PUT';
1977 1977
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1978 1978
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -2011,13 +2011,13 @@  discard block
 block discarded – undo
2011 2011
     public function stats(array $params = [])
2012 2012
     {
2013 2013
         if (isset($params['index']) && isset($params['metric'])) {
2014
-            $url = '/' . $this->encode($params['index']) . '/_stats/' . $this->encode($params['metric']);
2014
+            $url = '/'.$this->encode($params['index']).'/_stats/'.$this->encode($params['metric']);
2015 2015
             $method = 'GET';
2016 2016
         } elseif (isset($params['metric'])) {
2017
-            $url = '/_stats/' . $this->encode($params['metric']);
2017
+            $url = '/_stats/'.$this->encode($params['metric']);
2018 2018
             $method = 'GET';
2019 2019
         } elseif (isset($params['index'])) {
2020
-            $url = '/' . $this->encode($params['index']) . '/_stats';
2020
+            $url = '/'.$this->encode($params['index']).'/_stats';
2021 2021
             $method = 'GET';
2022 2022
         } else {
2023 2023
             $url = '/_stats';
@@ -2057,7 +2057,7 @@  discard block
 block discarded – undo
2057 2057
     public function unfreeze(array $params = [])
2058 2058
     {
2059 2059
         $this->checkRequiredParameters(['index'], $params);
2060
-        $url = '/' . $this->encode($params['index']) . '/_unfreeze';
2060
+        $url = '/'.$this->encode($params['index']).'/_unfreeze';
2061 2061
         $method = 'POST';
2062 2062
         $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2063 2063
         $headers = ['Accept' => 'application/json'];
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
     public function validateQuery(array $params = [])
2131 2131
     {
2132 2132
         if (isset($params['index'])) {
2133
-            $url = '/' . $this->encode($params['index']) . '/_validate/query';
2133
+            $url = '/'.$this->encode($params['index']).'/_validate/query';
2134 2134
             $method = empty($params['body']) ? 'GET' : 'POST';
2135 2135
         } else {
2136 2136
             $url = '/_validate/query';
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 /**
24 24
  * @generated This file is generated, please do not edit
25 25
  */
26
-class Indices extends AbstractEndpoint
27
-{
26
+class Indices extends AbstractEndpoint {
28 27
     /**
29 28
      * Adds a block to an index.
30 29
      *
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/ClientBuilder.php 3 patches
Indentation   +375 added lines, -375 removed lines patch added patch discarded remove patch
@@ -32,379 +32,379 @@
 block discarded – undo
32 32
 use ReflectionClass;
33 33
 class ClientBuilder
34 34
 {
35
-    const DEFAULT_HOST = 'localhost:9200';
36
-    /**
37
-     * PSR-18 client
38
-     */
39
-    private ClientInterface $httpClient;
40
-    /**
41
-     * The HTTP async client
42
-     */
43
-    private HttpAsyncClient $asyncHttpClient;
44
-    /**
45
-     * PSR-3 Logger
46
-     */
47
-    private LoggerInterface $logger;
48
-    /**
49
-     * The NodelPool
50
-     */
51
-    private NodePoolInterface $nodePool;
52
-    /**
53
-     * Hosts (elasticsearch nodes)
54
-     */
55
-    private array $hosts;
56
-    /**
57
-     * Elasticsearch API key
58
-     */
59
-    private string $apiKey;
60
-    /**
61
-     * Basic authentication username
62
-     */
63
-    private string $username;
64
-    /**
65
-     * Basic authentication password
66
-     */
67
-    private string $password;
68
-    /**
69
-     * Elastic cloud Id
70
-     */
71
-    private string $cloudId;
72
-    /**
73
-     * Retries
74
-     * 
75
-     * The default value is calculated during the client build
76
-     * and it is equal to the number of hosts
77
-     */
78
-    private int $retries;
79
-    /**
80
-     * SSL certificate 
81
-     * @var array [$cert, $password] $cert is the name of a file containing a PEM formatted certificate,
82
-     *              $password if the certificate requires a password 
83
-     */
84
-    private array $sslCert;
85
-    /**
86
-     * SSL key
87
-     * @var array [$key, $password] $key is the name of a file containing a private SSL key,
88
-     *              $password if the private key requires a password
89
-     */
90
-    private array $sslKey;
91
-    /**
92
-     * SSL verification
93
-     * 
94
-     * Enable or disable the SSL verfiication (default is true)
95
-     */
96
-    private bool $sslVerification = \true;
97
-    /**
98
-     * SSL CA bundle
99
-     */
100
-    private string $sslCA;
101
-    /**
102
-     * Elastic meta header
103
-     * 
104
-     * Enable or disable the x-elastic-client-meta header (default is true)
105
-     */
106
-    private bool $elasticMetaHeader = \true;
107
-    /**
108
-     * HTTP client options
109
-     */
110
-    private array $httpClientOptions = [];
111
-    /**
112
-     * Make the constructor final so cannot be overwritten
113
-     */
114
-    public final function __construct()
115
-    {
116
-    }
117
-    /**
118
-     * Create an instance of ClientBuilder
119
-     */
120
-    public static function create() : ClientBuilder
121
-    {
122
-        return new static();
123
-    }
124
-    /**
125
-     * Build a new client from the provided config.  Hash keys
126
-     * should correspond to the method name e.g. ['nodePool']
127
-     * corresponds to setNodePool().
128
-     *
129
-     * Missing keys will use the default for that setting if applicable
130
-     *
131
-     * Unknown keys will throw an exception by default, but this can be silenced
132
-     * by setting `quiet` to true
133
-     *
134
-     * @param  array $config
135
-     * @param  bool $quiet False if unknown settings throw exception, true to silently
136
-     *                     ignore unknown settings
137
-     * @throws ConfigException
138
-     */
139
-    public static function fromConfig(array $config, bool $quiet = \false) : Client
140
-    {
141
-        $builder = new static();
142
-        foreach ($config as $key => $value) {
143
-            $method = "set{$key}";
144
-            $reflection = new ReflectionClass($builder);
145
-            if ($reflection->hasMethod($method)) {
146
-                $func = $reflection->getMethod($method);
147
-                if ($func->getNumberOfParameters() > 1) {
148
-                    $builder->{$method}(...$value);
149
-                } else {
150
-                    $builder->{$method}($value);
151
-                }
152
-                unset($config[$key]);
153
-            }
154
-        }
155
-        if ($quiet === \false && \count($config) > 0) {
156
-            $unknown = \implode(\array_keys($config));
157
-            throw new ConfigException("Unknown parameters provided: {$unknown}");
158
-        }
159
-        return $builder->build();
160
-    }
161
-    public function setHttpClient(ClientInterface $httpClient) : ClientBuilder
162
-    {
163
-        $this->httpClient = $httpClient;
164
-        return $this;
165
-    }
166
-    public function setAsyncHttpClient(HttpAsyncClient $asyncHttpClient) : ClientBuilder
167
-    {
168
-        $this->asyncHttpClient = $asyncHttpClient;
169
-        return $this;
170
-    }
171
-    /**
172
-     * Set the PSR-3 Logger
173
-     */
174
-    public function setLogger(LoggerInterface $logger) : ClientBuilder
175
-    {
176
-        $this->logger = $logger;
177
-        return $this;
178
-    }
179
-    /**
180
-     * Set the NodePool
181
-     */
182
-    public function setNodePool(NodePoolInterface $nodePool) : ClientBuilder
183
-    {
184
-        $this->nodePool = $nodePool;
185
-        return $this;
186
-    }
187
-    /**
188
-     * Set the hosts (nodes)
189
-     */
190
-    public function setHosts(array $hosts) : ClientBuilder
191
-    {
192
-        $this->hosts = $hosts;
193
-        return $this;
194
-    }
195
-    /**
196
-     * Set the ApiKey
197
-     * If the id is not specified we store the ApiKey otherwise
198
-     * we store as Base64(id:ApiKey)
199
-     *
200
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
201
-     */
202
-    public function setApiKey(string $apiKey, string $id = null) : ClientBuilder
203
-    {
204
-        if (empty($id)) {
205
-            $this->apiKey = $apiKey;
206
-        } else {
207
-            $this->apiKey = \base64_encode($id . ':' . $apiKey);
208
-        }
209
-        return $this;
210
-    }
211
-    /**
212
-     * Set the Basic Authentication
213
-     */
214
-    public function setBasicAuthentication(string $username, string $password) : ClientBuilder
215
-    {
216
-        $this->username = $username;
217
-        $this->password = $password;
218
-        return $this;
219
-    }
220
-    public function setElasticCloudId(string $cloudId)
221
-    {
222
-        $this->cloudId = $cloudId;
223
-        return $this;
224
-    }
225
-    /**
226
-     * Set number or retries
227
-     * 
228
-     * @param int $retries
229
-     */
230
-    public function setRetries(int $retries) : ClientBuilder
231
-    {
232
-        if ($retries < 0) {
233
-            throw new InvalidArgumentException('The retries number must be >= 0');
234
-        }
235
-        $this->retries = $retries;
236
-        return $this;
237
-    }
238
-    /**
239
-     * Set SSL certificate
240
-     * 
241
-     * @param string $cert The name of a file containing a PEM formatted certificate
242
-     * @param string $password if the certificate requires a password
243
-     */
244
-    public function setSSLCert(string $cert, string $password = null) : ClientBuilder
245
-    {
246
-        $this->sslCert = [$cert, $password];
247
-        return $this;
248
-    }
249
-    /**
250
-     * Set the Certificate Authority (CA) bundle 
251
-     * 
252
-     * @param string $cert The name of a file containing a PEM formatted certificate
253
-     */
254
-    public function setCABundle(string $cert) : ClientBuilder
255
-    {
256
-        $this->sslCA = $cert;
257
-        return $this;
258
-    }
259
-    /**
260
-     * Set SSL key
261
-     * 
262
-     * @param string $key The name of a file containing a private SSL key
263
-     * @param string $password if the private key requires a password
264
-     */
265
-    public function setSSLKey(string $key, string $password = null) : ClientBuilder
266
-    {
267
-        $this->sslKey = [$key, $password];
268
-        return $this;
269
-    }
270
-    /**
271
-     * Enable or disable the SSL verification 
272
-     */
273
-    public function setSSLVerification(bool $value = \true) : ClientBuilder
274
-    {
275
-        $this->sslVerification = $value;
276
-        return $this;
277
-    }
278
-    /**
279
-     * Enable or disable the x-elastic-client-meta header
280
-     */
281
-    public function setElasticMetaHeader(bool $value = \true) : ClientBuilder
282
-    {
283
-        $this->elasticMetaHeader = $value;
284
-        return $this;
285
-    }
286
-    public function setHttpClientOptions(array $options) : ClientBuilder
287
-    {
288
-        $this->httpClientOptions = $options;
289
-        return $this;
290
-    }
291
-    /**
292
-     * Build and returns the Client object
293
-     */
294
-    public function build() : Client
295
-    {
296
-        // Transport builder
297
-        $builder = TransportBuilder::create();
298
-        // Set the default hosts if empty
299
-        if (empty($this->hosts)) {
300
-            $this->hosts = [self::DEFAULT_HOST];
301
-        }
302
-        $builder->setHosts($this->hosts);
303
-        // Logger
304
-        if (!empty($this->logger)) {
305
-            $builder->setLogger($this->logger);
306
-        }
307
-        // Http client
308
-        if (!empty($this->httpClient)) {
309
-            $builder->setClient($this->httpClient);
310
-        }
311
-        // Set HTTP client options
312
-        $builder->setClient($this->setOptions($builder->getClient(), $this->getConfig(), $this->httpClientOptions));
313
-        // Cloud id
314
-        if (!empty($this->cloudId)) {
315
-            $builder->setCloudId($this->cloudId);
316
-        }
317
-        // Node Pool
318
-        if (!empty($this->nodePool)) {
319
-            $builder->setNodePool($this->nodePool);
320
-        }
321
-        $transport = $builder->build();
322
-        // The default retries is equal to the number of hosts
323
-        if (empty($this->retries)) {
324
-            $this->retries = \count($this->hosts);
325
-        }
326
-        $transport->setRetries($this->retries);
327
-        // Async client
328
-        if (!empty($this->asyncHttpClient)) {
329
-            $transport->setAsyncClient($this->asyncHttpClient);
330
-        }
331
-        // Basic authentication
332
-        if (!empty($this->username) && !empty($this->password)) {
333
-            $transport->setUserInfo($this->username, $this->password);
334
-        }
335
-        // API key
336
-        if (!empty($this->apiKey)) {
337
-            if (!empty($this->username)) {
338
-                throw new AuthenticationException('You cannot use APIKey and Basic Authenication together');
339
-            }
340
-            $transport->setHeader('Authorization', \sprintf("ApiKey %s", $this->apiKey));
341
-        }
342
-        /**
343
-         * Elastic cloud optimized with gzip
344
-         * @see https://github.com/elastic/elasticsearch-php/issues/1241 omit for Symfony HTTP Client    
345
-         */
346
-        if (!empty($this->cloudId) && !$this->isSymfonyHttpClient($transport)) {
347
-            $transport->setHeader('Accept-Encoding', 'gzip');
348
-        }
349
-        $client = new Client($transport, $transport->getLogger());
350
-        // Enable or disable the x-elastic-client-meta header
351
-        $client->setElasticMetaHeader($this->elasticMetaHeader);
352
-        return $client;
353
-    }
354
-    /**
355
-     * Returns true if the transport HTTP client is Symfony
356
-     */
357
-    protected function isSymfonyHttpClient(Transport $transport) : bool
358
-    {
359
-        if (\false !== \strpos(\get_class($transport->getClient()), 'OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient')) {
360
-            return \true;
361
-        }
362
-        try {
363
-            if (\false !== \strpos(\get_class($transport->getAsyncClient()), 'OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient')) {
364
-                return \true;
365
-            }
366
-        } catch (NoAsyncClientException $e) {
367
-            return \false;
368
-        }
369
-        return \false;
370
-    }
371
-    /**
372
-     * Returns the configuration to be used in the HTTP client
373
-     */
374
-    protected function getConfig() : array
375
-    {
376
-        $config = [];
377
-        if (!empty($this->sslCert)) {
378
-            $config[RequestOptions::SSL_CERT] = $this->sslCert;
379
-        }
380
-        if (!empty($this->sslKey)) {
381
-            $config[RequestOptions::SSL_KEY] = $this->sslKey;
382
-        }
383
-        if (!$this->sslVerification) {
384
-            $config[RequestOptions::SSL_VERIFY] = \false;
385
-        }
386
-        if (!empty($this->sslCA)) {
387
-            $config[RequestOptions::SSL_CA] = $this->sslCA;
388
-        }
389
-        return $config;
390
-    }
391
-    /**
392
-     * Set the configuration for the specific HTTP client using an adapter
393
-     */
394
-    protected function setOptions(ClientInterface $client, array $config, array $clientOptions = []) : ClientInterface
395
-    {
396
-        if (empty($config) && empty($clientOptions)) {
397
-            return $client;
398
-        }
399
-        $class = \get_class($client);
400
-        if (!isset(AdapterOptions::HTTP_ADAPTERS[$class])) {
401
-            throw new HttpClientException(\sprintf("The HTTP client %s is not supported for custom options", $class));
402
-        }
403
-        $adapterClass = AdapterOptions::HTTP_ADAPTERS[$class];
404
-        if (!\class_exists($adapterClass) || !\in_array(AdapterInterface::class, \class_implements($adapterClass))) {
405
-            throw new HttpClientException(\sprintf("The class %s does not exists or does not implement %s", $adapterClass, AdapterInterface::class));
406
-        }
407
-        $adapter = new $adapterClass();
408
-        return $adapter->setConfig($client, $config, $clientOptions);
409
-    }
35
+	const DEFAULT_HOST = 'localhost:9200';
36
+	/**
37
+	 * PSR-18 client
38
+	 */
39
+	private ClientInterface $httpClient;
40
+	/**
41
+	 * The HTTP async client
42
+	 */
43
+	private HttpAsyncClient $asyncHttpClient;
44
+	/**
45
+	 * PSR-3 Logger
46
+	 */
47
+	private LoggerInterface $logger;
48
+	/**
49
+	 * The NodelPool
50
+	 */
51
+	private NodePoolInterface $nodePool;
52
+	/**
53
+	 * Hosts (elasticsearch nodes)
54
+	 */
55
+	private array $hosts;
56
+	/**
57
+	 * Elasticsearch API key
58
+	 */
59
+	private string $apiKey;
60
+	/**
61
+	 * Basic authentication username
62
+	 */
63
+	private string $username;
64
+	/**
65
+	 * Basic authentication password
66
+	 */
67
+	private string $password;
68
+	/**
69
+	 * Elastic cloud Id
70
+	 */
71
+	private string $cloudId;
72
+	/**
73
+	 * Retries
74
+	 * 
75
+	 * The default value is calculated during the client build
76
+	 * and it is equal to the number of hosts
77
+	 */
78
+	private int $retries;
79
+	/**
80
+	 * SSL certificate 
81
+	 * @var array [$cert, $password] $cert is the name of a file containing a PEM formatted certificate,
82
+	 *              $password if the certificate requires a password 
83
+	 */
84
+	private array $sslCert;
85
+	/**
86
+	 * SSL key
87
+	 * @var array [$key, $password] $key is the name of a file containing a private SSL key,
88
+	 *              $password if the private key requires a password
89
+	 */
90
+	private array $sslKey;
91
+	/**
92
+	 * SSL verification
93
+	 * 
94
+	 * Enable or disable the SSL verfiication (default is true)
95
+	 */
96
+	private bool $sslVerification = \true;
97
+	/**
98
+	 * SSL CA bundle
99
+	 */
100
+	private string $sslCA;
101
+	/**
102
+	 * Elastic meta header
103
+	 * 
104
+	 * Enable or disable the x-elastic-client-meta header (default is true)
105
+	 */
106
+	private bool $elasticMetaHeader = \true;
107
+	/**
108
+	 * HTTP client options
109
+	 */
110
+	private array $httpClientOptions = [];
111
+	/**
112
+	 * Make the constructor final so cannot be overwritten
113
+	 */
114
+	public final function __construct()
115
+	{
116
+	}
117
+	/**
118
+	 * Create an instance of ClientBuilder
119
+	 */
120
+	public static function create() : ClientBuilder
121
+	{
122
+		return new static();
123
+	}
124
+	/**
125
+	 * Build a new client from the provided config.  Hash keys
126
+	 * should correspond to the method name e.g. ['nodePool']
127
+	 * corresponds to setNodePool().
128
+	 *
129
+	 * Missing keys will use the default for that setting if applicable
130
+	 *
131
+	 * Unknown keys will throw an exception by default, but this can be silenced
132
+	 * by setting `quiet` to true
133
+	 *
134
+	 * @param  array $config
135
+	 * @param  bool $quiet False if unknown settings throw exception, true to silently
136
+	 *                     ignore unknown settings
137
+	 * @throws ConfigException
138
+	 */
139
+	public static function fromConfig(array $config, bool $quiet = \false) : Client
140
+	{
141
+		$builder = new static();
142
+		foreach ($config as $key => $value) {
143
+			$method = "set{$key}";
144
+			$reflection = new ReflectionClass($builder);
145
+			if ($reflection->hasMethod($method)) {
146
+				$func = $reflection->getMethod($method);
147
+				if ($func->getNumberOfParameters() > 1) {
148
+					$builder->{$method}(...$value);
149
+				} else {
150
+					$builder->{$method}($value);
151
+				}
152
+				unset($config[$key]);
153
+			}
154
+		}
155
+		if ($quiet === \false && \count($config) > 0) {
156
+			$unknown = \implode(\array_keys($config));
157
+			throw new ConfigException("Unknown parameters provided: {$unknown}");
158
+		}
159
+		return $builder->build();
160
+	}
161
+	public function setHttpClient(ClientInterface $httpClient) : ClientBuilder
162
+	{
163
+		$this->httpClient = $httpClient;
164
+		return $this;
165
+	}
166
+	public function setAsyncHttpClient(HttpAsyncClient $asyncHttpClient) : ClientBuilder
167
+	{
168
+		$this->asyncHttpClient = $asyncHttpClient;
169
+		return $this;
170
+	}
171
+	/**
172
+	 * Set the PSR-3 Logger
173
+	 */
174
+	public function setLogger(LoggerInterface $logger) : ClientBuilder
175
+	{
176
+		$this->logger = $logger;
177
+		return $this;
178
+	}
179
+	/**
180
+	 * Set the NodePool
181
+	 */
182
+	public function setNodePool(NodePoolInterface $nodePool) : ClientBuilder
183
+	{
184
+		$this->nodePool = $nodePool;
185
+		return $this;
186
+	}
187
+	/**
188
+	 * Set the hosts (nodes)
189
+	 */
190
+	public function setHosts(array $hosts) : ClientBuilder
191
+	{
192
+		$this->hosts = $hosts;
193
+		return $this;
194
+	}
195
+	/**
196
+	 * Set the ApiKey
197
+	 * If the id is not specified we store the ApiKey otherwise
198
+	 * we store as Base64(id:ApiKey)
199
+	 *
200
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
201
+	 */
202
+	public function setApiKey(string $apiKey, string $id = null) : ClientBuilder
203
+	{
204
+		if (empty($id)) {
205
+			$this->apiKey = $apiKey;
206
+		} else {
207
+			$this->apiKey = \base64_encode($id . ':' . $apiKey);
208
+		}
209
+		return $this;
210
+	}
211
+	/**
212
+	 * Set the Basic Authentication
213
+	 */
214
+	public function setBasicAuthentication(string $username, string $password) : ClientBuilder
215
+	{
216
+		$this->username = $username;
217
+		$this->password = $password;
218
+		return $this;
219
+	}
220
+	public function setElasticCloudId(string $cloudId)
221
+	{
222
+		$this->cloudId = $cloudId;
223
+		return $this;
224
+	}
225
+	/**
226
+	 * Set number or retries
227
+	 * 
228
+	 * @param int $retries
229
+	 */
230
+	public function setRetries(int $retries) : ClientBuilder
231
+	{
232
+		if ($retries < 0) {
233
+			throw new InvalidArgumentException('The retries number must be >= 0');
234
+		}
235
+		$this->retries = $retries;
236
+		return $this;
237
+	}
238
+	/**
239
+	 * Set SSL certificate
240
+	 * 
241
+	 * @param string $cert The name of a file containing a PEM formatted certificate
242
+	 * @param string $password if the certificate requires a password
243
+	 */
244
+	public function setSSLCert(string $cert, string $password = null) : ClientBuilder
245
+	{
246
+		$this->sslCert = [$cert, $password];
247
+		return $this;
248
+	}
249
+	/**
250
+	 * Set the Certificate Authority (CA) bundle 
251
+	 * 
252
+	 * @param string $cert The name of a file containing a PEM formatted certificate
253
+	 */
254
+	public function setCABundle(string $cert) : ClientBuilder
255
+	{
256
+		$this->sslCA = $cert;
257
+		return $this;
258
+	}
259
+	/**
260
+	 * Set SSL key
261
+	 * 
262
+	 * @param string $key The name of a file containing a private SSL key
263
+	 * @param string $password if the private key requires a password
264
+	 */
265
+	public function setSSLKey(string $key, string $password = null) : ClientBuilder
266
+	{
267
+		$this->sslKey = [$key, $password];
268
+		return $this;
269
+	}
270
+	/**
271
+	 * Enable or disable the SSL verification 
272
+	 */
273
+	public function setSSLVerification(bool $value = \true) : ClientBuilder
274
+	{
275
+		$this->sslVerification = $value;
276
+		return $this;
277
+	}
278
+	/**
279
+	 * Enable or disable the x-elastic-client-meta header
280
+	 */
281
+	public function setElasticMetaHeader(bool $value = \true) : ClientBuilder
282
+	{
283
+		$this->elasticMetaHeader = $value;
284
+		return $this;
285
+	}
286
+	public function setHttpClientOptions(array $options) : ClientBuilder
287
+	{
288
+		$this->httpClientOptions = $options;
289
+		return $this;
290
+	}
291
+	/**
292
+	 * Build and returns the Client object
293
+	 */
294
+	public function build() : Client
295
+	{
296
+		// Transport builder
297
+		$builder = TransportBuilder::create();
298
+		// Set the default hosts if empty
299
+		if (empty($this->hosts)) {
300
+			$this->hosts = [self::DEFAULT_HOST];
301
+		}
302
+		$builder->setHosts($this->hosts);
303
+		// Logger
304
+		if (!empty($this->logger)) {
305
+			$builder->setLogger($this->logger);
306
+		}
307
+		// Http client
308
+		if (!empty($this->httpClient)) {
309
+			$builder->setClient($this->httpClient);
310
+		}
311
+		// Set HTTP client options
312
+		$builder->setClient($this->setOptions($builder->getClient(), $this->getConfig(), $this->httpClientOptions));
313
+		// Cloud id
314
+		if (!empty($this->cloudId)) {
315
+			$builder->setCloudId($this->cloudId);
316
+		}
317
+		// Node Pool
318
+		if (!empty($this->nodePool)) {
319
+			$builder->setNodePool($this->nodePool);
320
+		}
321
+		$transport = $builder->build();
322
+		// The default retries is equal to the number of hosts
323
+		if (empty($this->retries)) {
324
+			$this->retries = \count($this->hosts);
325
+		}
326
+		$transport->setRetries($this->retries);
327
+		// Async client
328
+		if (!empty($this->asyncHttpClient)) {
329
+			$transport->setAsyncClient($this->asyncHttpClient);
330
+		}
331
+		// Basic authentication
332
+		if (!empty($this->username) && !empty($this->password)) {
333
+			$transport->setUserInfo($this->username, $this->password);
334
+		}
335
+		// API key
336
+		if (!empty($this->apiKey)) {
337
+			if (!empty($this->username)) {
338
+				throw new AuthenticationException('You cannot use APIKey and Basic Authenication together');
339
+			}
340
+			$transport->setHeader('Authorization', \sprintf("ApiKey %s", $this->apiKey));
341
+		}
342
+		/**
343
+		 * Elastic cloud optimized with gzip
344
+		 * @see https://github.com/elastic/elasticsearch-php/issues/1241 omit for Symfony HTTP Client    
345
+		 */
346
+		if (!empty($this->cloudId) && !$this->isSymfonyHttpClient($transport)) {
347
+			$transport->setHeader('Accept-Encoding', 'gzip');
348
+		}
349
+		$client = new Client($transport, $transport->getLogger());
350
+		// Enable or disable the x-elastic-client-meta header
351
+		$client->setElasticMetaHeader($this->elasticMetaHeader);
352
+		return $client;
353
+	}
354
+	/**
355
+	 * Returns true if the transport HTTP client is Symfony
356
+	 */
357
+	protected function isSymfonyHttpClient(Transport $transport) : bool
358
+	{
359
+		if (\false !== \strpos(\get_class($transport->getClient()), 'OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient')) {
360
+			return \true;
361
+		}
362
+		try {
363
+			if (\false !== \strpos(\get_class($transport->getAsyncClient()), 'OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient')) {
364
+				return \true;
365
+			}
366
+		} catch (NoAsyncClientException $e) {
367
+			return \false;
368
+		}
369
+		return \false;
370
+	}
371
+	/**
372
+	 * Returns the configuration to be used in the HTTP client
373
+	 */
374
+	protected function getConfig() : array
375
+	{
376
+		$config = [];
377
+		if (!empty($this->sslCert)) {
378
+			$config[RequestOptions::SSL_CERT] = $this->sslCert;
379
+		}
380
+		if (!empty($this->sslKey)) {
381
+			$config[RequestOptions::SSL_KEY] = $this->sslKey;
382
+		}
383
+		if (!$this->sslVerification) {
384
+			$config[RequestOptions::SSL_VERIFY] = \false;
385
+		}
386
+		if (!empty($this->sslCA)) {
387
+			$config[RequestOptions::SSL_CA] = $this->sslCA;
388
+		}
389
+		return $config;
390
+	}
391
+	/**
392
+	 * Set the configuration for the specific HTTP client using an adapter
393
+	 */
394
+	protected function setOptions(ClientInterface $client, array $config, array $clientOptions = []) : ClientInterface
395
+	{
396
+		if (empty($config) && empty($clientOptions)) {
397
+			return $client;
398
+		}
399
+		$class = \get_class($client);
400
+		if (!isset(AdapterOptions::HTTP_ADAPTERS[$class])) {
401
+			throw new HttpClientException(\sprintf("The HTTP client %s is not supported for custom options", $class));
402
+		}
403
+		$adapterClass = AdapterOptions::HTTP_ADAPTERS[$class];
404
+		if (!\class_exists($adapterClass) || !\in_array(AdapterInterface::class, \class_implements($adapterClass))) {
405
+			throw new HttpClientException(\sprintf("The class %s does not exists or does not implement %s", $adapterClass, AdapterInterface::class));
406
+		}
407
+		$adapter = new $adapterClass();
408
+		return $adapter->setConfig($client, $config, $clientOptions);
409
+	}
410 410
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\AuthenticationException;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         if (empty($id)) {
205 205
             $this->apiKey = $apiKey;
206 206
         } else {
207
-            $this->apiKey = \base64_encode($id . ':' . $apiKey);
207
+            $this->apiKey = \base64_encode($id.':'.$apiKey);
208 208
         }
209 209
         return $this;
210 210
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@
 block discarded – undo
30 30
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Client\ClientInterface;
31 31
 use Psr\Log\LoggerInterface;
32 32
 use ReflectionClass;
33
-class ClientBuilder
34
-{
33
+class ClientBuilder {
35 34
     const DEFAULT_HOST = 'localhost:9200';
36 35
     /**
37 36
      * PSR-18 client
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Transport/Adapter/AdapterOptions.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,5 +19,5 @@
 block discarded – undo
19 19
  */
20 20
 final class AdapterOptions
21 21
 {
22
-    const HTTP_ADAPTERS = ["OCA\\FullTextSearch_Elasticsearch\\Vendor\\GuzzleHttp\\Client" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Guzzle", "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient\\HttplugClient" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Symfony", "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient\\Psr18Client" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Symfony"];
22
+	const HTTP_ADAPTERS = ["OCA\\FullTextSearch_Elasticsearch\\Vendor\\GuzzleHttp\\Client" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Guzzle", "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient\\HttplugClient" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Symfony", "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient\\Psr18Client" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Symfony"];
23 23
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Transport\Adapter;
16 16
 
17 17
 /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 /**
18 18
  * The HTTP client adapters supported
19 19
  */
20
-final class AdapterOptions
21
-{
20
+final class AdapterOptions {
22 21
     const HTTP_ADAPTERS = ["OCA\\FullTextSearch_Elasticsearch\\Vendor\\GuzzleHttp\\Client" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Guzzle", "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient\\HttplugClient" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Symfony", "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Symfony\\Component\\HttpClient\\Psr18Client" => "OCA\\FullTextSearch_Elasticsearch\\Vendor\\Elastic\\Elasticsearch\\Transport\\Adapter\\Symfony"];
23 22
 }
Please login to merge, or discard this patch.