Completed
Push — master ( 0675a5...c513b3 )
by Maxence
03:29 queued 14s
created
lib/Vendor/Elastic/Elasticsearch/Endpoints/AbstractEndpoint.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Traits\EndpointTrait;
19 19
 abstract class AbstractEndpoint
20 20
 {
21
-    use EndpointTrait;
22
-    protected ClientInterface $client;
23
-    public function __construct(ClientInterface $client)
24
-    {
25
-        $this->client = $client;
26
-    }
21
+	use EndpointTrait;
22
+	protected ClientInterface $client;
23
+	public function __construct(ClientInterface $client)
24
+	{
25
+		$this->client = $client;
26
+	}
27 27
 }
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\Endpoints;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\ClientInterface;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\ClientInterface;
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Traits\EndpointTrait;
19
-abstract class AbstractEndpoint
20
-{
19
+abstract class AbstractEndpoint {
21 20
     use EndpointTrait;
22 21
     protected ClientInterface $client;
23 22
     public function __construct(ClientInterface $client)
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Slm.php 3 patches
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;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function deleteLifecycle(array $params = [])
50 50
     {
51 51
         $this->checkRequiredParameters(['policy_id'], $params);
52
-        $url = '/_slm/policy/' . $this->encode($params['policy_id']);
52
+        $url = '/_slm/policy/'.$this->encode($params['policy_id']);
53 53
         $method = 'DELETE';
54 54
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55 55
         $headers = ['Accept' => 'application/json'];
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function executeLifecycle(array $params = [])
80 80
     {
81 81
         $this->checkRequiredParameters(['policy_id'], $params);
82
-        $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute';
82
+        $url = '/_slm/policy/'.$this->encode($params['policy_id']).'/_execute';
83 83
         $method = 'PUT';
84 84
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
85 85
         $headers = ['Accept' => 'application/json'];
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     public function getLifecycle(array $params = [])
136 136
     {
137 137
         if (isset($params['policy_id'])) {
138
-            $url = '/_slm/policy/' . $this->encode($params['policy_id']);
138
+            $url = '/_slm/policy/'.$this->encode($params['policy_id']);
139 139
             $method = 'GET';
140 140
         } else {
141 141
             $url = '/_slm/policy';
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     public function putLifecycle(array $params = [])
225 225
     {
226 226
         $this->checkRequiredParameters(['policy_id'], $params);
227
-        $url = '/_slm/policy/' . $this->encode($params['policy_id']);
227
+        $url = '/_slm/policy/'.$this->encode($params['policy_id']);
228 228
         $method = 'PUT';
229 229
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
230 230
         $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 Slm extends AbstractEndpoint
27
-{
26
+class Slm extends AbstractEndpoint {
28 27
     /**
29 28
      * Deletes an existing snapshot lifecycle policy.
30 29
      *
Please login to merge, or discard this patch.
Indentation   +281 added lines, -281 removed lines patch added patch discarded remove patch
@@ -25,285 +25,285 @@
 block discarded – undo
25 25
  */
26 26
 class Slm extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Deletes an existing snapshot lifecycle policy.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html
32
-     *
33
-     * @param array{
34
-     *     policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove
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_id'], $params);
52
-        $url = '/_slm/policy/' . $this->encode($params['policy_id']);
53
-        $method = 'DELETE';
54
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
-        $headers = ['Accept' => 'application/json'];
56
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
57
-        $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.delete_lifecycle');
58
-        return $this->client->sendRequest($request);
59
-    }
60
-    /**
61
-     * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
62
-     *
63
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html
64
-     *
65
-     * @param array{
66
-     *     policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed
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 executeLifecycle(array $params = [])
82
-    {
83
-        $this->checkRequiredParameters(['policy_id'], $params);
84
-        $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute';
85
-        $method = 'PUT';
86
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
-        $headers = ['Accept' => 'application/json'];
88
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
89
-        $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.execute_lifecycle');
90
-        return $this->client->sendRequest($request);
91
-    }
92
-    /**
93
-     * Deletes any snapshots that are expired according to the policy's retention rules.
94
-     *
95
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html
96
-     *
97
-     * @param array{
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 executeRetention(array $params = [])
112
-    {
113
-        $url = '/_slm/_execute_retention';
114
-        $method = 'POST';
115
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
116
-        $headers = ['Accept' => 'application/json'];
117
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
118
-        $request = $this->addOtelAttributes($params, [], $request, 'slm.execute_retention');
119
-        return $this->client->sendRequest($request);
120
-    }
121
-    /**
122
-     * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
123
-     *
124
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html
125
-     *
126
-     * @param array{
127
-     *     policy_id: list, //  Comma-separated list of snapshot lifecycle policies to retrieve
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 getLifecycle(array $params = [])
142
-    {
143
-        if (isset($params['policy_id'])) {
144
-            $url = '/_slm/policy/' . $this->encode($params['policy_id']);
145
-            $method = 'GET';
146
-        } else {
147
-            $url = '/_slm/policy';
148
-            $method = 'GET';
149
-        }
150
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
151
-        $headers = ['Accept' => 'application/json'];
152
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
153
-        $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.get_lifecycle');
154
-        return $this->client->sendRequest($request);
155
-    }
156
-    /**
157
-     * Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
158
-     *
159
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html
160
-     *
161
-     * @param array{
162
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
163
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
164
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
165
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
166
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
167
-     * } $params
168
-     *
169
-     * @throws NoNodeAvailableException if all the hosts are offline
170
-     * @throws ClientResponseException if the status code of response is 4xx
171
-     * @throws ServerResponseException if the status code of response is 5xx
172
-     *
173
-     * @return Elasticsearch|Promise
174
-     */
175
-    public function getStats(array $params = [])
176
-    {
177
-        $url = '/_slm/stats';
178
-        $method = 'GET';
179
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
180
-        $headers = ['Accept' => 'application/json'];
181
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
182
-        $request = $this->addOtelAttributes($params, [], $request, 'slm.get_stats');
183
-        return $this->client->sendRequest($request);
184
-    }
185
-    /**
186
-     * Retrieves the status of snapshot lifecycle management (SLM).
187
-     *
188
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html
189
-     *
190
-     * @param array{
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
-     * } $params
197
-     *
198
-     * @throws NoNodeAvailableException if all the hosts are offline
199
-     * @throws ClientResponseException if the status code of response is 4xx
200
-     * @throws ServerResponseException if the status code of response is 5xx
201
-     *
202
-     * @return Elasticsearch|Promise
203
-     */
204
-    public function getStatus(array $params = [])
205
-    {
206
-        $url = '/_slm/status';
207
-        $method = 'GET';
208
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
209
-        $headers = ['Accept' => 'application/json'];
210
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
211
-        $request = $this->addOtelAttributes($params, [], $request, 'slm.get_status');
212
-        return $this->client->sendRequest($request);
213
-    }
214
-    /**
215
-     * Creates or updates a snapshot lifecycle policy.
216
-     *
217
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html
218
-     *
219
-     * @param array{
220
-     *     policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy
221
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
222
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
223
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
224
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
225
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
226
-     *     body: array, //  The snapshot lifecycle policy definition to register
227
-     * } $params
228
-     *
229
-     * @throws MissingParameterException if a required parameter is missing
230
-     * @throws NoNodeAvailableException if all the hosts are offline
231
-     * @throws ClientResponseException if the status code of response is 4xx
232
-     * @throws ServerResponseException if the status code of response is 5xx
233
-     *
234
-     * @return Elasticsearch|Promise
235
-     */
236
-    public function putLifecycle(array $params = [])
237
-    {
238
-        $this->checkRequiredParameters(['policy_id'], $params);
239
-        $url = '/_slm/policy/' . $this->encode($params['policy_id']);
240
-        $method = 'PUT';
241
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
242
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
243
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
244
-        $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.put_lifecycle');
245
-        return $this->client->sendRequest($request);
246
-    }
247
-    /**
248
-     * Turns on snapshot lifecycle management (SLM).
249
-     *
250
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html
251
-     *
252
-     * @param array{
253
-     *     master_timeout: time, // Timeout for processing on master node
254
-     *     timeout: time, // Timeout for acknowledgement of update from all nodes in cluster
255
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
256
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
257
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
258
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
259
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
260
-     * } $params
261
-     *
262
-     * @throws NoNodeAvailableException if all the hosts are offline
263
-     * @throws ClientResponseException if the status code of response is 4xx
264
-     * @throws ServerResponseException if the status code of response is 5xx
265
-     *
266
-     * @return Elasticsearch|Promise
267
-     */
268
-    public function start(array $params = [])
269
-    {
270
-        $url = '/_slm/start';
271
-        $method = 'POST';
272
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
273
-        $headers = ['Accept' => 'application/json'];
274
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
275
-        $request = $this->addOtelAttributes($params, [], $request, 'slm.start');
276
-        return $this->client->sendRequest($request);
277
-    }
278
-    /**
279
-     * Turns off snapshot lifecycle management (SLM).
280
-     *
281
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html
282
-     *
283
-     * @param array{
284
-     *     master_timeout: time, // Timeout for processing on master node
285
-     *     timeout: time, // Timeout for acknowledgement of update from all nodes in cluster
286
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
287
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
288
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
289
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
290
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
291
-     * } $params
292
-     *
293
-     * @throws NoNodeAvailableException if all the hosts are offline
294
-     * @throws ClientResponseException if the status code of response is 4xx
295
-     * @throws ServerResponseException if the status code of response is 5xx
296
-     *
297
-     * @return Elasticsearch|Promise
298
-     */
299
-    public function stop(array $params = [])
300
-    {
301
-        $url = '/_slm/stop';
302
-        $method = 'POST';
303
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
304
-        $headers = ['Accept' => 'application/json'];
305
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
306
-        $request = $this->addOtelAttributes($params, [], $request, 'slm.stop');
307
-        return $this->client->sendRequest($request);
308
-    }
28
+	/**
29
+	 * Deletes an existing snapshot lifecycle policy.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html
32
+	 *
33
+	 * @param array{
34
+	 *     policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove
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_id'], $params);
52
+		$url = '/_slm/policy/' . $this->encode($params['policy_id']);
53
+		$method = 'DELETE';
54
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
55
+		$headers = ['Accept' => 'application/json'];
56
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
57
+		$request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.delete_lifecycle');
58
+		return $this->client->sendRequest($request);
59
+	}
60
+	/**
61
+	 * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
62
+	 *
63
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html
64
+	 *
65
+	 * @param array{
66
+	 *     policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed
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 executeLifecycle(array $params = [])
82
+	{
83
+		$this->checkRequiredParameters(['policy_id'], $params);
84
+		$url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute';
85
+		$method = 'PUT';
86
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
+		$headers = ['Accept' => 'application/json'];
88
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
89
+		$request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.execute_lifecycle');
90
+		return $this->client->sendRequest($request);
91
+	}
92
+	/**
93
+	 * Deletes any snapshots that are expired according to the policy's retention rules.
94
+	 *
95
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html
96
+	 *
97
+	 * @param array{
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 executeRetention(array $params = [])
112
+	{
113
+		$url = '/_slm/_execute_retention';
114
+		$method = 'POST';
115
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
116
+		$headers = ['Accept' => 'application/json'];
117
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
118
+		$request = $this->addOtelAttributes($params, [], $request, 'slm.execute_retention');
119
+		return $this->client->sendRequest($request);
120
+	}
121
+	/**
122
+	 * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
123
+	 *
124
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html
125
+	 *
126
+	 * @param array{
127
+	 *     policy_id: list, //  Comma-separated list of snapshot lifecycle policies to retrieve
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 getLifecycle(array $params = [])
142
+	{
143
+		if (isset($params['policy_id'])) {
144
+			$url = '/_slm/policy/' . $this->encode($params['policy_id']);
145
+			$method = 'GET';
146
+		} else {
147
+			$url = '/_slm/policy';
148
+			$method = 'GET';
149
+		}
150
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
151
+		$headers = ['Accept' => 'application/json'];
152
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
153
+		$request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.get_lifecycle');
154
+		return $this->client->sendRequest($request);
155
+	}
156
+	/**
157
+	 * Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
158
+	 *
159
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html
160
+	 *
161
+	 * @param array{
162
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
163
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
164
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
165
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
166
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
167
+	 * } $params
168
+	 *
169
+	 * @throws NoNodeAvailableException if all the hosts are offline
170
+	 * @throws ClientResponseException if the status code of response is 4xx
171
+	 * @throws ServerResponseException if the status code of response is 5xx
172
+	 *
173
+	 * @return Elasticsearch|Promise
174
+	 */
175
+	public function getStats(array $params = [])
176
+	{
177
+		$url = '/_slm/stats';
178
+		$method = 'GET';
179
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
180
+		$headers = ['Accept' => 'application/json'];
181
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
182
+		$request = $this->addOtelAttributes($params, [], $request, 'slm.get_stats');
183
+		return $this->client->sendRequest($request);
184
+	}
185
+	/**
186
+	 * Retrieves the status of snapshot lifecycle management (SLM).
187
+	 *
188
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html
189
+	 *
190
+	 * @param array{
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
+	 * } $params
197
+	 *
198
+	 * @throws NoNodeAvailableException if all the hosts are offline
199
+	 * @throws ClientResponseException if the status code of response is 4xx
200
+	 * @throws ServerResponseException if the status code of response is 5xx
201
+	 *
202
+	 * @return Elasticsearch|Promise
203
+	 */
204
+	public function getStatus(array $params = [])
205
+	{
206
+		$url = '/_slm/status';
207
+		$method = 'GET';
208
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
209
+		$headers = ['Accept' => 'application/json'];
210
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
211
+		$request = $this->addOtelAttributes($params, [], $request, 'slm.get_status');
212
+		return $this->client->sendRequest($request);
213
+	}
214
+	/**
215
+	 * Creates or updates a snapshot lifecycle policy.
216
+	 *
217
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html
218
+	 *
219
+	 * @param array{
220
+	 *     policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy
221
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
222
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
223
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
224
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
225
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
226
+	 *     body: array, //  The snapshot lifecycle policy definition to register
227
+	 * } $params
228
+	 *
229
+	 * @throws MissingParameterException if a required parameter is missing
230
+	 * @throws NoNodeAvailableException if all the hosts are offline
231
+	 * @throws ClientResponseException if the status code of response is 4xx
232
+	 * @throws ServerResponseException if the status code of response is 5xx
233
+	 *
234
+	 * @return Elasticsearch|Promise
235
+	 */
236
+	public function putLifecycle(array $params = [])
237
+	{
238
+		$this->checkRequiredParameters(['policy_id'], $params);
239
+		$url = '/_slm/policy/' . $this->encode($params['policy_id']);
240
+		$method = 'PUT';
241
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
242
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
243
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
244
+		$request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.put_lifecycle');
245
+		return $this->client->sendRequest($request);
246
+	}
247
+	/**
248
+	 * Turns on snapshot lifecycle management (SLM).
249
+	 *
250
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html
251
+	 *
252
+	 * @param array{
253
+	 *     master_timeout: time, // Timeout for processing on master node
254
+	 *     timeout: time, // Timeout for acknowledgement of update from all nodes in cluster
255
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
256
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
257
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
258
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
259
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
260
+	 * } $params
261
+	 *
262
+	 * @throws NoNodeAvailableException if all the hosts are offline
263
+	 * @throws ClientResponseException if the status code of response is 4xx
264
+	 * @throws ServerResponseException if the status code of response is 5xx
265
+	 *
266
+	 * @return Elasticsearch|Promise
267
+	 */
268
+	public function start(array $params = [])
269
+	{
270
+		$url = '/_slm/start';
271
+		$method = 'POST';
272
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
273
+		$headers = ['Accept' => 'application/json'];
274
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
275
+		$request = $this->addOtelAttributes($params, [], $request, 'slm.start');
276
+		return $this->client->sendRequest($request);
277
+	}
278
+	/**
279
+	 * Turns off snapshot lifecycle management (SLM).
280
+	 *
281
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html
282
+	 *
283
+	 * @param array{
284
+	 *     master_timeout: time, // Timeout for processing on master node
285
+	 *     timeout: time, // Timeout for acknowledgement of update from all nodes in cluster
286
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
287
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
288
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
289
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
290
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
291
+	 * } $params
292
+	 *
293
+	 * @throws NoNodeAvailableException if all the hosts are offline
294
+	 * @throws ClientResponseException if the status code of response is 4xx
295
+	 * @throws ServerResponseException if the status code of response is 5xx
296
+	 *
297
+	 * @return Elasticsearch|Promise
298
+	 */
299
+	public function stop(array $params = [])
300
+	{
301
+		$url = '/_slm/stop';
302
+		$method = 'POST';
303
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
304
+		$headers = ['Accept' => 'application/json'];
305
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
306
+		$request = $this->addOtelAttributes($params, [], $request, 'slm.stop');
307
+		return $this->client->sendRequest($request);
308
+	}
309 309
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/SearchableSnapshots.php 3 patches
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;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function cacheStats(array $params = [])
50 50
     {
51 51
         if (isset($params['node_id'])) {
52
-            $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats';
52
+            $url = '/_searchable_snapshots/'.$this->encode($params['node_id']).'/cache/stats';
53 53
             $method = 'GET';
54 54
         } else {
55 55
             $url = '/_searchable_snapshots/cache/stats';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     public function clearCache(array $params = [])
87 87
     {
88 88
         if (isset($params['index'])) {
89
-            $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear';
89
+            $url = '/'.$this->encode($params['index']).'/_searchable_snapshots/cache/clear';
90 90
             $method = 'POST';
91 91
         } else {
92 92
             $url = '/_searchable_snapshots/cache/clear';
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     public function mount(array $params = [])
126 126
     {
127 127
         $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params);
128
-        $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount';
128
+        $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']).'/_mount';
129 129
         $method = 'POST';
130 130
         $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
131 131
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     public function stats(array $params = [])
156 156
     {
157 157
         if (isset($params['index'])) {
158
-            $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats';
158
+            $url = '/'.$this->encode($params['index']).'/_searchable_snapshots/stats';
159 159
             $method = 'GET';
160 160
         } else {
161 161
             $url = '/_searchable_snapshots/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 SearchableSnapshots extends AbstractEndpoint
27
-{
26
+class SearchableSnapshots extends AbstractEndpoint {
28 27
     /**
29 28
      * Retrieve node-level cache statistics about searchable snapshots.
30 29
      *
Please login to merge, or discard this patch.
Indentation   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -25,152 +25,152 @@
 block discarded – undo
25 25
  */
26 26
 class SearchableSnapshots extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Retrieve node-level cache statistics about searchable snapshots.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html
32
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
33
-     *
34
-     * @param array{
35
-     *     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
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 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 cacheStats(array $params = [])
50
-    {
51
-        if (isset($params['node_id'])) {
52
-            $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats';
53
-            $method = 'GET';
54
-        } else {
55
-            $url = '/_searchable_snapshots/cache/stats';
56
-            $method = 'GET';
57
-        }
58
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
59
-        $headers = ['Accept' => 'application/json'];
60
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
61
-        $request = $this->addOtelAttributes($params, ['node_id'], $request, 'searchable_snapshots.cache_stats');
62
-        return $this->client->sendRequest($request);
63
-    }
64
-    /**
65
-     * Clear the cache of searchable snapshots.
66
-     *
67
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html
68
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
69
-     *
70
-     * @param array{
71
-     *     index: list, //  A comma-separated list of index names
72
-     *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
73
-     *     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)
74
-     *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
75
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
76
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
77
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
78
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
79
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
80
-     * } $params
81
-     *
82
-     * @throws NoNodeAvailableException if all the hosts are offline
83
-     * @throws ClientResponseException if the status code of response is 4xx
84
-     * @throws ServerResponseException if the status code of response is 5xx
85
-     *
86
-     * @return Elasticsearch|Promise
87
-     */
88
-    public function clearCache(array $params = [])
89
-    {
90
-        if (isset($params['index'])) {
91
-            $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear';
92
-            $method = 'POST';
93
-        } else {
94
-            $url = '/_searchable_snapshots/cache/clear';
95
-            $method = 'POST';
96
-        }
97
-        $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
98
-        $headers = ['Accept' => 'application/json'];
99
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
100
-        $request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.clear_cache');
101
-        return $this->client->sendRequest($request);
102
-    }
103
-    /**
104
-     * Mount a snapshot as a searchable index.
105
-     *
106
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html
107
-     *
108
-     * @param array{
109
-     *     repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount
110
-     *     snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount
111
-     *     master_timeout: time, // Explicit operation timeout for connection to master node
112
-     *     wait_for_completion: boolean, // Should this request wait until the operation has completed before returning
113
-     *     storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy`
114
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
115
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
116
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
117
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
118
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
119
-     *     body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable
120
-     * } $params
121
-     *
122
-     * @throws MissingParameterException if a required parameter is missing
123
-     * @throws NoNodeAvailableException if all the hosts are offline
124
-     * @throws ClientResponseException if the status code of response is 4xx
125
-     * @throws ServerResponseException if the status code of response is 5xx
126
-     *
127
-     * @return Elasticsearch|Promise
128
-     */
129
-    public function mount(array $params = [])
130
-    {
131
-        $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params);
132
-        $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount';
133
-        $method = 'POST';
134
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
135
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
136
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
137
-        $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'searchable_snapshots.mount');
138
-        return $this->client->sendRequest($request);
139
-    }
140
-    /**
141
-     * Retrieve shard-level statistics about searchable snapshots.
142
-     *
143
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html
144
-     *
145
-     * @param array{
146
-     *     index: list, //  A comma-separated list of index names
147
-     *     level: enum, // Return stats aggregated at cluster, index or shard level
148
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
149
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
150
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
151
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
152
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
153
-     * } $params
154
-     *
155
-     * @throws NoNodeAvailableException if all the hosts are offline
156
-     * @throws ClientResponseException if the status code of response is 4xx
157
-     * @throws ServerResponseException if the status code of response is 5xx
158
-     *
159
-     * @return Elasticsearch|Promise
160
-     */
161
-    public function stats(array $params = [])
162
-    {
163
-        if (isset($params['index'])) {
164
-            $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats';
165
-            $method = 'GET';
166
-        } else {
167
-            $url = '/_searchable_snapshots/stats';
168
-            $method = 'GET';
169
-        }
170
-        $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
171
-        $headers = ['Accept' => 'application/json'];
172
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
173
-        $request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.stats');
174
-        return $this->client->sendRequest($request);
175
-    }
28
+	/**
29
+	 * Retrieve node-level cache statistics about searchable snapshots.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html
32
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
33
+	 *
34
+	 * @param array{
35
+	 *     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
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 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 cacheStats(array $params = [])
50
+	{
51
+		if (isset($params['node_id'])) {
52
+			$url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats';
53
+			$method = 'GET';
54
+		} else {
55
+			$url = '/_searchable_snapshots/cache/stats';
56
+			$method = 'GET';
57
+		}
58
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
59
+		$headers = ['Accept' => 'application/json'];
60
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
61
+		$request = $this->addOtelAttributes($params, ['node_id'], $request, 'searchable_snapshots.cache_stats');
62
+		return $this->client->sendRequest($request);
63
+	}
64
+	/**
65
+	 * Clear the cache of searchable snapshots.
66
+	 *
67
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html
68
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
69
+	 *
70
+	 * @param array{
71
+	 *     index: list, //  A comma-separated list of index names
72
+	 *     ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
73
+	 *     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)
74
+	 *     expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
75
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
76
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
77
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
78
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
79
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
80
+	 * } $params
81
+	 *
82
+	 * @throws NoNodeAvailableException if all the hosts are offline
83
+	 * @throws ClientResponseException if the status code of response is 4xx
84
+	 * @throws ServerResponseException if the status code of response is 5xx
85
+	 *
86
+	 * @return Elasticsearch|Promise
87
+	 */
88
+	public function clearCache(array $params = [])
89
+	{
90
+		if (isset($params['index'])) {
91
+			$url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear';
92
+			$method = 'POST';
93
+		} else {
94
+			$url = '/_searchable_snapshots/cache/clear';
95
+			$method = 'POST';
96
+		}
97
+		$url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
98
+		$headers = ['Accept' => 'application/json'];
99
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
100
+		$request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.clear_cache');
101
+		return $this->client->sendRequest($request);
102
+	}
103
+	/**
104
+	 * Mount a snapshot as a searchable index.
105
+	 *
106
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html
107
+	 *
108
+	 * @param array{
109
+	 *     repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount
110
+	 *     snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount
111
+	 *     master_timeout: time, // Explicit operation timeout for connection to master node
112
+	 *     wait_for_completion: boolean, // Should this request wait until the operation has completed before returning
113
+	 *     storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy`
114
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
115
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
116
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
117
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
118
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
119
+	 *     body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable
120
+	 * } $params
121
+	 *
122
+	 * @throws MissingParameterException if a required parameter is missing
123
+	 * @throws NoNodeAvailableException if all the hosts are offline
124
+	 * @throws ClientResponseException if the status code of response is 4xx
125
+	 * @throws ServerResponseException if the status code of response is 5xx
126
+	 *
127
+	 * @return Elasticsearch|Promise
128
+	 */
129
+	public function mount(array $params = [])
130
+	{
131
+		$this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params);
132
+		$url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount';
133
+		$method = 'POST';
134
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
135
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
136
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
137
+		$request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'searchable_snapshots.mount');
138
+		return $this->client->sendRequest($request);
139
+	}
140
+	/**
141
+	 * Retrieve shard-level statistics about searchable snapshots.
142
+	 *
143
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html
144
+	 *
145
+	 * @param array{
146
+	 *     index: list, //  A comma-separated list of index names
147
+	 *     level: enum, // Return stats aggregated at cluster, index or shard level
148
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
149
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
150
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
151
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
152
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
153
+	 * } $params
154
+	 *
155
+	 * @throws NoNodeAvailableException if all the hosts are offline
156
+	 * @throws ClientResponseException if the status code of response is 4xx
157
+	 * @throws ServerResponseException if the status code of response is 5xx
158
+	 *
159
+	 * @return Elasticsearch|Promise
160
+	 */
161
+	public function stats(array $params = [])
162
+	{
163
+		if (isset($params['index'])) {
164
+			$url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats';
165
+			$method = 'GET';
166
+		} else {
167
+			$url = '/_searchable_snapshots/stats';
168
+			$method = 'GET';
169
+		}
170
+		$url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
171
+		$headers = ['Accept' => 'application/json'];
172
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
173
+		$request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.stats');
174
+		return $this->client->sendRequest($request);
175
+	}
176 176
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Transform.php 3 patches
Spacing   +11 added lines, -11 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;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     public function deleteTransform(array $params = [])
53 53
     {
54 54
         $this->checkRequiredParameters(['transform_id'], $params);
55
-        $url = '/_transform/' . $this->encode($params['transform_id']);
55
+        $url = '/_transform/'.$this->encode($params['transform_id']);
56 56
         $method = 'DELETE';
57 57
         $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
58 58
         $headers = ['Accept' => 'application/json'];
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function getTransform(array $params = [])
86 86
     {
87 87
         if (isset($params['transform_id'])) {
88
-            $url = '/_transform/' . $this->encode($params['transform_id']);
88
+            $url = '/_transform/'.$this->encode($params['transform_id']);
89 89
             $method = 'GET';
90 90
         } else {
91 91
             $url = '/_transform';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function getTransformStats(array $params = [])
124 124
     {
125 125
         $this->checkRequiredParameters(['transform_id'], $params);
126
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats';
126
+        $url = '/_transform/'.$this->encode($params['transform_id']).'/_stats';
127 127
         $method = 'GET';
128 128
         $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
129 129
         $headers = ['Accept' => 'application/json'];
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     public function previewTransform(array $params = [])
155 155
     {
156 156
         if (isset($params['transform_id'])) {
157
-            $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview';
157
+            $url = '/_transform/'.$this->encode($params['transform_id']).'/_preview';
158 158
             $method = empty($params['body']) ? 'GET' : 'POST';
159 159
         } else {
160 160
             $url = '/_transform/_preview';
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     public function putTransform(array $params = [])
192 192
     {
193 193
         $this->checkRequiredParameters(['transform_id', 'body'], $params);
194
-        $url = '/_transform/' . $this->encode($params['transform_id']);
194
+        $url = '/_transform/'.$this->encode($params['transform_id']);
195 195
         $method = 'PUT';
196 196
         $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
197 197
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     public function resetTransform(array $params = [])
224 224
     {
225 225
         $this->checkRequiredParameters(['transform_id'], $params);
226
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset';
226
+        $url = '/_transform/'.$this->encode($params['transform_id']).'/_reset';
227 227
         $method = 'POST';
228 228
         $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
229 229
         $headers = ['Accept' => 'application/json'];
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     public function scheduleNowTransform(array $params = [])
255 255
     {
256 256
         $this->checkRequiredParameters(['transform_id'], $params);
257
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now';
257
+        $url = '/_transform/'.$this->encode($params['transform_id']).'/_schedule_now';
258 258
         $method = 'POST';
259 259
         $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
260 260
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     public function startTransform(array $params = [])
287 287
     {
288 288
         $this->checkRequiredParameters(['transform_id'], $params);
289
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start';
289
+        $url = '/_transform/'.$this->encode($params['transform_id']).'/_start';
290 290
         $method = 'POST';
291 291
         $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
292 292
         $headers = ['Accept' => 'application/json'];
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     public function stopTransform(array $params = [])
322 322
     {
323 323
         $this->checkRequiredParameters(['transform_id'], $params);
324
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop';
324
+        $url = '/_transform/'.$this->encode($params['transform_id']).'/_stop';
325 325
         $method = 'POST';
326 326
         $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
327 327
         $headers = ['Accept' => 'application/json'];
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     public function updateTransform(array $params = [])
355 355
     {
356 356
         $this->checkRequiredParameters(['transform_id', 'body'], $params);
357
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update';
357
+        $url = '/_transform/'.$this->encode($params['transform_id']).'/_update';
358 358
         $method = 'POST';
359 359
         $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
360 360
         $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 Transform extends AbstractEndpoint
27
-{
26
+class Transform extends AbstractEndpoint {
28 27
     /**
29 28
      * Deletes an existing transform.
30 29
      *
Please login to merge, or discard this patch.
Indentation   +415 added lines, -415 removed lines patch added patch discarded remove patch
@@ -25,419 +25,419 @@
 block discarded – undo
25 25
  */
26 26
 class Transform extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Deletes an existing transform.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html
32
-     *
33
-     * @param array{
34
-     *     transform_id: string, // (REQUIRED) The id of the transform to delete
35
-     *     force: boolean, // When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
36
-     *     delete_dest_index: boolean, // When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted.
37
-     *     timeout: time, // Controls the time to wait for the transform deletion
38
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
39
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
40
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
41
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
42
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
43
-     * } $params
44
-     *
45
-     * @throws MissingParameterException if a required parameter is missing
46
-     * @throws NoNodeAvailableException if all the hosts are offline
47
-     * @throws ClientResponseException if the status code of response is 4xx
48
-     * @throws ServerResponseException if the status code of response is 5xx
49
-     *
50
-     * @return Elasticsearch|Promise
51
-     */
52
-    public function deleteTransform(array $params = [])
53
-    {
54
-        $this->checkRequiredParameters(['transform_id'], $params);
55
-        $url = '/_transform/' . $this->encode($params['transform_id']);
56
-        $method = 'DELETE';
57
-        $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
58
-        $headers = ['Accept' => 'application/json'];
59
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
60
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.delete_transform');
61
-        return $this->client->sendRequest($request);
62
-    }
63
-    /**
64
-     * Retrieves transform usage information for transform nodes.
65
-     *
66
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-node-stats.html
67
-     *
68
-     * @param array{
69
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
70
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
71
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
72
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
73
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
74
-     * } $params
75
-     *
76
-     * @throws NoNodeAvailableException if all the hosts are offline
77
-     * @throws ClientResponseException if the status code of response is 4xx
78
-     * @throws ServerResponseException if the status code of response is 5xx
79
-     *
80
-     * @return Elasticsearch|Promise
81
-     */
82
-    public function getNodeStats(array $params = [])
83
-    {
84
-        $url = '/_transform/_node_stats';
85
-        $method = 'GET';
86
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
-        $headers = ['Accept' => 'application/json'];
88
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
89
-        $request = $this->addOtelAttributes($params, [], $request, 'transform.get_node_stats');
90
-        return $this->client->sendRequest($request);
91
-    }
92
-    /**
93
-     * Retrieves configuration information for transforms.
94
-     *
95
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html
96
-     *
97
-     * @param array{
98
-     *     transform_id: string, //  The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
99
-     *     from: int, // skips a number of transform configs, defaults to 0
100
-     *     size: int, // specifies a max number of transforms to get, defaults to 100
101
-     *     allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
102
-     *     exclude_generated: boolean, // Omits fields that are illegal to set on transform PUT
103
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
104
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
105
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
106
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
107
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
108
-     * } $params
109
-     *
110
-     * @throws NoNodeAvailableException if all the hosts are offline
111
-     * @throws ClientResponseException if the status code of response is 4xx
112
-     * @throws ServerResponseException if the status code of response is 5xx
113
-     *
114
-     * @return Elasticsearch|Promise
115
-     */
116
-    public function getTransform(array $params = [])
117
-    {
118
-        if (isset($params['transform_id'])) {
119
-            $url = '/_transform/' . $this->encode($params['transform_id']);
120
-            $method = 'GET';
121
-        } else {
122
-            $url = '/_transform';
123
-            $method = 'GET';
124
-        }
125
-        $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
126
-        $headers = ['Accept' => 'application/json'];
127
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
128
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.get_transform');
129
-        return $this->client->sendRequest($request);
130
-    }
131
-    /**
132
-     * Retrieves usage information for transforms.
133
-     *
134
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html
135
-     *
136
-     * @param array{
137
-     *     transform_id: string, // (REQUIRED) The id of the transform for which to get stats. '_all' or '*' implies all transforms
138
-     *     from: number, // skips a number of transform stats, defaults to 0
139
-     *     size: number, // specifies a max number of transform stats to get, defaults to 100
140
-     *     timeout: time, // Controls the time to wait for the stats
141
-     *     allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
142
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
143
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
144
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
145
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
146
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
147
-     * } $params
148
-     *
149
-     * @throws MissingParameterException if a required parameter is missing
150
-     * @throws NoNodeAvailableException if all the hosts are offline
151
-     * @throws ClientResponseException if the status code of response is 4xx
152
-     * @throws ServerResponseException if the status code of response is 5xx
153
-     *
154
-     * @return Elasticsearch|Promise
155
-     */
156
-    public function getTransformStats(array $params = [])
157
-    {
158
-        $this->checkRequiredParameters(['transform_id'], $params);
159
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats';
160
-        $method = 'GET';
161
-        $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
162
-        $headers = ['Accept' => 'application/json'];
163
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
164
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.get_transform_stats');
165
-        return $this->client->sendRequest($request);
166
-    }
167
-    /**
168
-     * Previews a transform.
169
-     *
170
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html
171
-     *
172
-     * @param array{
173
-     *     transform_id: string, //  The id of the transform to preview.
174
-     *     timeout: time, // Controls the time to wait for the preview
175
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
176
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
177
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
178
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
179
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
180
-     *     body: array, //  The definition for the transform to preview
181
-     * } $params
182
-     *
183
-     * @throws NoNodeAvailableException if all the hosts are offline
184
-     * @throws ClientResponseException if the status code of response is 4xx
185
-     * @throws ServerResponseException if the status code of response is 5xx
186
-     *
187
-     * @return Elasticsearch|Promise
188
-     */
189
-    public function previewTransform(array $params = [])
190
-    {
191
-        if (isset($params['transform_id'])) {
192
-            $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview';
193
-            $method = empty($params['body']) ? 'GET' : 'POST';
194
-        } else {
195
-            $url = '/_transform/_preview';
196
-            $method = empty($params['body']) ? 'GET' : 'POST';
197
-        }
198
-        $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
199
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
200
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
201
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.preview_transform');
202
-        return $this->client->sendRequest($request);
203
-    }
204
-    /**
205
-     * Instantiates a transform.
206
-     *
207
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
208
-     *
209
-     * @param array{
210
-     *     transform_id: string, // (REQUIRED) The id of the new transform.
211
-     *     defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false.
212
-     *     timeout: time, // Controls the time to wait for the transform to start
213
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
214
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
215
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
216
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
217
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
218
-     *     body: array, // (REQUIRED) The transform definition
219
-     * } $params
220
-     *
221
-     * @throws MissingParameterException if a required parameter is missing
222
-     * @throws NoNodeAvailableException if all the hosts are offline
223
-     * @throws ClientResponseException if the status code of response is 4xx
224
-     * @throws ServerResponseException if the status code of response is 5xx
225
-     *
226
-     * @return Elasticsearch|Promise
227
-     */
228
-    public function putTransform(array $params = [])
229
-    {
230
-        $this->checkRequiredParameters(['transform_id', 'body'], $params);
231
-        $url = '/_transform/' . $this->encode($params['transform_id']);
232
-        $method = 'PUT';
233
-        $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
234
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
235
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
236
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.put_transform');
237
-        return $this->client->sendRequest($request);
238
-    }
239
-    /**
240
-     * Resets an existing transform.
241
-     *
242
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html
243
-     *
244
-     * @param array{
245
-     *     transform_id: string, // (REQUIRED) The id of the transform to reset
246
-     *     force: boolean, // When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset.
247
-     *     timeout: time, // Controls the time to wait for the transform to reset
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 resetTransform(array $params = [])
263
-    {
264
-        $this->checkRequiredParameters(['transform_id'], $params);
265
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset';
266
-        $method = 'POST';
267
-        $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
268
-        $headers = ['Accept' => 'application/json'];
269
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
270
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.reset_transform');
271
-        return $this->client->sendRequest($request);
272
-    }
273
-    /**
274
-     * Schedules now a transform.
275
-     *
276
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html
277
-     *
278
-     * @param array{
279
-     *     transform_id: string, // (REQUIRED) The id of the transform.
280
-     *     timeout: time, // Controls the time to wait for the scheduling to take place
281
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
282
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
283
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
284
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
285
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
286
-     * } $params
287
-     *
288
-     * @throws MissingParameterException if a required parameter is missing
289
-     * @throws NoNodeAvailableException if all the hosts are offline
290
-     * @throws ClientResponseException if the status code of response is 4xx
291
-     * @throws ServerResponseException if the status code of response is 5xx
292
-     *
293
-     * @return Elasticsearch|Promise
294
-     */
295
-    public function scheduleNowTransform(array $params = [])
296
-    {
297
-        $this->checkRequiredParameters(['transform_id'], $params);
298
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now';
299
-        $method = 'POST';
300
-        $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
301
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
302
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
303
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.schedule_now_transform');
304
-        return $this->client->sendRequest($request);
305
-    }
306
-    /**
307
-     * Starts one or more transforms.
308
-     *
309
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
310
-     *
311
-     * @param array{
312
-     *     transform_id: string, // (REQUIRED) The id of the transform to start
313
-     *     from: string, // Restricts the set of transformed entities to those changed after this time
314
-     *     timeout: time, // Controls the time to wait for the transform to start
315
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
316
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
317
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
318
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
319
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
320
-     * } $params
321
-     *
322
-     * @throws MissingParameterException if a required parameter is missing
323
-     * @throws NoNodeAvailableException if all the hosts are offline
324
-     * @throws ClientResponseException if the status code of response is 4xx
325
-     * @throws ServerResponseException if the status code of response is 5xx
326
-     *
327
-     * @return Elasticsearch|Promise
328
-     */
329
-    public function startTransform(array $params = [])
330
-    {
331
-        $this->checkRequiredParameters(['transform_id'], $params);
332
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start';
333
-        $method = 'POST';
334
-        $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
335
-        $headers = ['Accept' => 'application/json'];
336
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
337
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.start_transform');
338
-        return $this->client->sendRequest($request);
339
-    }
340
-    /**
341
-     * Stops one or more transforms.
342
-     *
343
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
344
-     *
345
-     * @param array{
346
-     *     transform_id: string, // (REQUIRED) The id of the transform to stop
347
-     *     force: boolean, // Whether to force stop a failed transform or not. Default to false
348
-     *     wait_for_completion: boolean, // Whether to wait for the transform to fully stop before returning or not. Default to false
349
-     *     timeout: time, // Controls the time to wait until the transform has stopped. Default to 30 seconds
350
-     *     allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
351
-     *     wait_for_checkpoint: boolean, // Whether to wait for the transform to reach a checkpoint before stopping. Default to false
352
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
353
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
354
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
355
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
356
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
357
-     * } $params
358
-     *
359
-     * @throws MissingParameterException if a required parameter is missing
360
-     * @throws NoNodeAvailableException if all the hosts are offline
361
-     * @throws ClientResponseException if the status code of response is 4xx
362
-     * @throws ServerResponseException if the status code of response is 5xx
363
-     *
364
-     * @return Elasticsearch|Promise
365
-     */
366
-    public function stopTransform(array $params = [])
367
-    {
368
-        $this->checkRequiredParameters(['transform_id'], $params);
369
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop';
370
-        $method = 'POST';
371
-        $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
372
-        $headers = ['Accept' => 'application/json'];
373
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
374
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.stop_transform');
375
-        return $this->client->sendRequest($request);
376
-    }
377
-    /**
378
-     * Updates certain properties of a transform.
379
-     *
380
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
381
-     *
382
-     * @param array{
383
-     *     transform_id: string, // (REQUIRED) The id of the transform.
384
-     *     defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false.
385
-     *     timeout: time, // Controls the time to wait for the update
386
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
387
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
388
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
389
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
390
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
391
-     *     body: array, // (REQUIRED) The update transform definition
392
-     * } $params
393
-     *
394
-     * @throws MissingParameterException if a required parameter is missing
395
-     * @throws NoNodeAvailableException if all the hosts are offline
396
-     * @throws ClientResponseException if the status code of response is 4xx
397
-     * @throws ServerResponseException if the status code of response is 5xx
398
-     *
399
-     * @return Elasticsearch|Promise
400
-     */
401
-    public function updateTransform(array $params = [])
402
-    {
403
-        $this->checkRequiredParameters(['transform_id', 'body'], $params);
404
-        $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update';
405
-        $method = 'POST';
406
-        $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
407
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
408
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
409
-        $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.update_transform');
410
-        return $this->client->sendRequest($request);
411
-    }
412
-    /**
413
-     * Upgrades all transforms.
414
-     *
415
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html
416
-     *
417
-     * @param array{
418
-     *     dry_run: boolean, // Whether to only check for updates but don't execute
419
-     *     timeout: time, // Controls the time to wait for the upgrade
420
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
421
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
422
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
423
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
424
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
425
-     * } $params
426
-     *
427
-     * @throws NoNodeAvailableException if all the hosts are offline
428
-     * @throws ClientResponseException if the status code of response is 4xx
429
-     * @throws ServerResponseException if the status code of response is 5xx
430
-     *
431
-     * @return Elasticsearch|Promise
432
-     */
433
-    public function upgradeTransforms(array $params = [])
434
-    {
435
-        $url = '/_transform/_upgrade';
436
-        $method = 'POST';
437
-        $url = $this->addQueryString($url, $params, ['dry_run', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
438
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
439
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
440
-        $request = $this->addOtelAttributes($params, [], $request, 'transform.upgrade_transforms');
441
-        return $this->client->sendRequest($request);
442
-    }
28
+	/**
29
+	 * Deletes an existing transform.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html
32
+	 *
33
+	 * @param array{
34
+	 *     transform_id: string, // (REQUIRED) The id of the transform to delete
35
+	 *     force: boolean, // When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
36
+	 *     delete_dest_index: boolean, // When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted.
37
+	 *     timeout: time, // Controls the time to wait for the transform deletion
38
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
39
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
40
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
41
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
42
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
43
+	 * } $params
44
+	 *
45
+	 * @throws MissingParameterException if a required parameter is missing
46
+	 * @throws NoNodeAvailableException if all the hosts are offline
47
+	 * @throws ClientResponseException if the status code of response is 4xx
48
+	 * @throws ServerResponseException if the status code of response is 5xx
49
+	 *
50
+	 * @return Elasticsearch|Promise
51
+	 */
52
+	public function deleteTransform(array $params = [])
53
+	{
54
+		$this->checkRequiredParameters(['transform_id'], $params);
55
+		$url = '/_transform/' . $this->encode($params['transform_id']);
56
+		$method = 'DELETE';
57
+		$url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
58
+		$headers = ['Accept' => 'application/json'];
59
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
60
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.delete_transform');
61
+		return $this->client->sendRequest($request);
62
+	}
63
+	/**
64
+	 * Retrieves transform usage information for transform nodes.
65
+	 *
66
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-node-stats.html
67
+	 *
68
+	 * @param array{
69
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
70
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
71
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
72
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
73
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
74
+	 * } $params
75
+	 *
76
+	 * @throws NoNodeAvailableException if all the hosts are offline
77
+	 * @throws ClientResponseException if the status code of response is 4xx
78
+	 * @throws ServerResponseException if the status code of response is 5xx
79
+	 *
80
+	 * @return Elasticsearch|Promise
81
+	 */
82
+	public function getNodeStats(array $params = [])
83
+	{
84
+		$url = '/_transform/_node_stats';
85
+		$method = 'GET';
86
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
87
+		$headers = ['Accept' => 'application/json'];
88
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
89
+		$request = $this->addOtelAttributes($params, [], $request, 'transform.get_node_stats');
90
+		return $this->client->sendRequest($request);
91
+	}
92
+	/**
93
+	 * Retrieves configuration information for transforms.
94
+	 *
95
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html
96
+	 *
97
+	 * @param array{
98
+	 *     transform_id: string, //  The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
99
+	 *     from: int, // skips a number of transform configs, defaults to 0
100
+	 *     size: int, // specifies a max number of transforms to get, defaults to 100
101
+	 *     allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
102
+	 *     exclude_generated: boolean, // Omits fields that are illegal to set on transform PUT
103
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
104
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
105
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
106
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
107
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
108
+	 * } $params
109
+	 *
110
+	 * @throws NoNodeAvailableException if all the hosts are offline
111
+	 * @throws ClientResponseException if the status code of response is 4xx
112
+	 * @throws ServerResponseException if the status code of response is 5xx
113
+	 *
114
+	 * @return Elasticsearch|Promise
115
+	 */
116
+	public function getTransform(array $params = [])
117
+	{
118
+		if (isset($params['transform_id'])) {
119
+			$url = '/_transform/' . $this->encode($params['transform_id']);
120
+			$method = 'GET';
121
+		} else {
122
+			$url = '/_transform';
123
+			$method = 'GET';
124
+		}
125
+		$url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
126
+		$headers = ['Accept' => 'application/json'];
127
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
128
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.get_transform');
129
+		return $this->client->sendRequest($request);
130
+	}
131
+	/**
132
+	 * Retrieves usage information for transforms.
133
+	 *
134
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html
135
+	 *
136
+	 * @param array{
137
+	 *     transform_id: string, // (REQUIRED) The id of the transform for which to get stats. '_all' or '*' implies all transforms
138
+	 *     from: number, // skips a number of transform stats, defaults to 0
139
+	 *     size: number, // specifies a max number of transform stats to get, defaults to 100
140
+	 *     timeout: time, // Controls the time to wait for the stats
141
+	 *     allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
142
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
143
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
144
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
145
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
146
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
147
+	 * } $params
148
+	 *
149
+	 * @throws MissingParameterException if a required parameter is missing
150
+	 * @throws NoNodeAvailableException if all the hosts are offline
151
+	 * @throws ClientResponseException if the status code of response is 4xx
152
+	 * @throws ServerResponseException if the status code of response is 5xx
153
+	 *
154
+	 * @return Elasticsearch|Promise
155
+	 */
156
+	public function getTransformStats(array $params = [])
157
+	{
158
+		$this->checkRequiredParameters(['transform_id'], $params);
159
+		$url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats';
160
+		$method = 'GET';
161
+		$url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
162
+		$headers = ['Accept' => 'application/json'];
163
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
164
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.get_transform_stats');
165
+		return $this->client->sendRequest($request);
166
+	}
167
+	/**
168
+	 * Previews a transform.
169
+	 *
170
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html
171
+	 *
172
+	 * @param array{
173
+	 *     transform_id: string, //  The id of the transform to preview.
174
+	 *     timeout: time, // Controls the time to wait for the preview
175
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
176
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
177
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
178
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
179
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
180
+	 *     body: array, //  The definition for the transform to preview
181
+	 * } $params
182
+	 *
183
+	 * @throws NoNodeAvailableException if all the hosts are offline
184
+	 * @throws ClientResponseException if the status code of response is 4xx
185
+	 * @throws ServerResponseException if the status code of response is 5xx
186
+	 *
187
+	 * @return Elasticsearch|Promise
188
+	 */
189
+	public function previewTransform(array $params = [])
190
+	{
191
+		if (isset($params['transform_id'])) {
192
+			$url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview';
193
+			$method = empty($params['body']) ? 'GET' : 'POST';
194
+		} else {
195
+			$url = '/_transform/_preview';
196
+			$method = empty($params['body']) ? 'GET' : 'POST';
197
+		}
198
+		$url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
199
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
200
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
201
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.preview_transform');
202
+		return $this->client->sendRequest($request);
203
+	}
204
+	/**
205
+	 * Instantiates a transform.
206
+	 *
207
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
208
+	 *
209
+	 * @param array{
210
+	 *     transform_id: string, // (REQUIRED) The id of the new transform.
211
+	 *     defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false.
212
+	 *     timeout: time, // Controls the time to wait for the transform to start
213
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
214
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
215
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
216
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
217
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
218
+	 *     body: array, // (REQUIRED) The transform definition
219
+	 * } $params
220
+	 *
221
+	 * @throws MissingParameterException if a required parameter is missing
222
+	 * @throws NoNodeAvailableException if all the hosts are offline
223
+	 * @throws ClientResponseException if the status code of response is 4xx
224
+	 * @throws ServerResponseException if the status code of response is 5xx
225
+	 *
226
+	 * @return Elasticsearch|Promise
227
+	 */
228
+	public function putTransform(array $params = [])
229
+	{
230
+		$this->checkRequiredParameters(['transform_id', 'body'], $params);
231
+		$url = '/_transform/' . $this->encode($params['transform_id']);
232
+		$method = 'PUT';
233
+		$url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
234
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
235
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
236
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.put_transform');
237
+		return $this->client->sendRequest($request);
238
+	}
239
+	/**
240
+	 * Resets an existing transform.
241
+	 *
242
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html
243
+	 *
244
+	 * @param array{
245
+	 *     transform_id: string, // (REQUIRED) The id of the transform to reset
246
+	 *     force: boolean, // When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset.
247
+	 *     timeout: time, // Controls the time to wait for the transform to reset
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 resetTransform(array $params = [])
263
+	{
264
+		$this->checkRequiredParameters(['transform_id'], $params);
265
+		$url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset';
266
+		$method = 'POST';
267
+		$url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
268
+		$headers = ['Accept' => 'application/json'];
269
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
270
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.reset_transform');
271
+		return $this->client->sendRequest($request);
272
+	}
273
+	/**
274
+	 * Schedules now a transform.
275
+	 *
276
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html
277
+	 *
278
+	 * @param array{
279
+	 *     transform_id: string, // (REQUIRED) The id of the transform.
280
+	 *     timeout: time, // Controls the time to wait for the scheduling to take place
281
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
282
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
283
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
284
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
285
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
286
+	 * } $params
287
+	 *
288
+	 * @throws MissingParameterException if a required parameter is missing
289
+	 * @throws NoNodeAvailableException if all the hosts are offline
290
+	 * @throws ClientResponseException if the status code of response is 4xx
291
+	 * @throws ServerResponseException if the status code of response is 5xx
292
+	 *
293
+	 * @return Elasticsearch|Promise
294
+	 */
295
+	public function scheduleNowTransform(array $params = [])
296
+	{
297
+		$this->checkRequiredParameters(['transform_id'], $params);
298
+		$url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now';
299
+		$method = 'POST';
300
+		$url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
301
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
302
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
303
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.schedule_now_transform');
304
+		return $this->client->sendRequest($request);
305
+	}
306
+	/**
307
+	 * Starts one or more transforms.
308
+	 *
309
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
310
+	 *
311
+	 * @param array{
312
+	 *     transform_id: string, // (REQUIRED) The id of the transform to start
313
+	 *     from: string, // Restricts the set of transformed entities to those changed after this time
314
+	 *     timeout: time, // Controls the time to wait for the transform to start
315
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
316
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
317
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
318
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
319
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
320
+	 * } $params
321
+	 *
322
+	 * @throws MissingParameterException if a required parameter is missing
323
+	 * @throws NoNodeAvailableException if all the hosts are offline
324
+	 * @throws ClientResponseException if the status code of response is 4xx
325
+	 * @throws ServerResponseException if the status code of response is 5xx
326
+	 *
327
+	 * @return Elasticsearch|Promise
328
+	 */
329
+	public function startTransform(array $params = [])
330
+	{
331
+		$this->checkRequiredParameters(['transform_id'], $params);
332
+		$url = '/_transform/' . $this->encode($params['transform_id']) . '/_start';
333
+		$method = 'POST';
334
+		$url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
335
+		$headers = ['Accept' => 'application/json'];
336
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
337
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.start_transform');
338
+		return $this->client->sendRequest($request);
339
+	}
340
+	/**
341
+	 * Stops one or more transforms.
342
+	 *
343
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
344
+	 *
345
+	 * @param array{
346
+	 *     transform_id: string, // (REQUIRED) The id of the transform to stop
347
+	 *     force: boolean, // Whether to force stop a failed transform or not. Default to false
348
+	 *     wait_for_completion: boolean, // Whether to wait for the transform to fully stop before returning or not. Default to false
349
+	 *     timeout: time, // Controls the time to wait until the transform has stopped. Default to 30 seconds
350
+	 *     allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
351
+	 *     wait_for_checkpoint: boolean, // Whether to wait for the transform to reach a checkpoint before stopping. Default to false
352
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
353
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
354
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
355
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
356
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
357
+	 * } $params
358
+	 *
359
+	 * @throws MissingParameterException if a required parameter is missing
360
+	 * @throws NoNodeAvailableException if all the hosts are offline
361
+	 * @throws ClientResponseException if the status code of response is 4xx
362
+	 * @throws ServerResponseException if the status code of response is 5xx
363
+	 *
364
+	 * @return Elasticsearch|Promise
365
+	 */
366
+	public function stopTransform(array $params = [])
367
+	{
368
+		$this->checkRequiredParameters(['transform_id'], $params);
369
+		$url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop';
370
+		$method = 'POST';
371
+		$url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
372
+		$headers = ['Accept' => 'application/json'];
373
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
374
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.stop_transform');
375
+		return $this->client->sendRequest($request);
376
+	}
377
+	/**
378
+	 * Updates certain properties of a transform.
379
+	 *
380
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
381
+	 *
382
+	 * @param array{
383
+	 *     transform_id: string, // (REQUIRED) The id of the transform.
384
+	 *     defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false.
385
+	 *     timeout: time, // Controls the time to wait for the update
386
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
387
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
388
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
389
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
390
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
391
+	 *     body: array, // (REQUIRED) The update transform definition
392
+	 * } $params
393
+	 *
394
+	 * @throws MissingParameterException if a required parameter is missing
395
+	 * @throws NoNodeAvailableException if all the hosts are offline
396
+	 * @throws ClientResponseException if the status code of response is 4xx
397
+	 * @throws ServerResponseException if the status code of response is 5xx
398
+	 *
399
+	 * @return Elasticsearch|Promise
400
+	 */
401
+	public function updateTransform(array $params = [])
402
+	{
403
+		$this->checkRequiredParameters(['transform_id', 'body'], $params);
404
+		$url = '/_transform/' . $this->encode($params['transform_id']) . '/_update';
405
+		$method = 'POST';
406
+		$url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
407
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
408
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
409
+		$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.update_transform');
410
+		return $this->client->sendRequest($request);
411
+	}
412
+	/**
413
+	 * Upgrades all transforms.
414
+	 *
415
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html
416
+	 *
417
+	 * @param array{
418
+	 *     dry_run: boolean, // Whether to only check for updates but don't execute
419
+	 *     timeout: time, // Controls the time to wait for the upgrade
420
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
421
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
422
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
423
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
424
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
425
+	 * } $params
426
+	 *
427
+	 * @throws NoNodeAvailableException if all the hosts are offline
428
+	 * @throws ClientResponseException if the status code of response is 4xx
429
+	 * @throws ServerResponseException if the status code of response is 5xx
430
+	 *
431
+	 * @return Elasticsearch|Promise
432
+	 */
433
+	public function upgradeTransforms(array $params = [])
434
+	{
435
+		$url = '/_transform/_upgrade';
436
+		$method = 'POST';
437
+		$url = $this->addQueryString($url, $params, ['dry_run', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
438
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
439
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
440
+		$request = $this->addOtelAttributes($params, [], $request, 'transform.upgrade_transforms');
441
+		return $this->client->sendRequest($request);
442
+	}
443 443
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Watcher.php 3 patches
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;
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $this->checkRequiredParameters(['watch_id'], $params);
53 53
         if (isset($params['action_id'])) {
54
-            $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']);
54
+            $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_ack/'.$this->encode($params['action_id']);
55 55
             $method = 'PUT';
56 56
         } else {
57
-            $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack';
57
+            $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_ack';
58 58
             $method = 'PUT';
59 59
         }
60 60
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function activateWatch(array $params = [])
86 86
     {
87 87
         $this->checkRequiredParameters(['watch_id'], $params);
88
-        $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate';
88
+        $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_activate';
89 89
         $method = 'PUT';
90 90
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
91 91
         $headers = ['Accept' => 'application/json'];
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     public function deactivateWatch(array $params = [])
116 116
     {
117 117
         $this->checkRequiredParameters(['watch_id'], $params);
118
-        $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate';
118
+        $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_deactivate';
119 119
         $method = 'PUT';
120 120
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
121 121
         $headers = ['Accept' => 'application/json'];
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     public function deleteWatch(array $params = [])
146 146
     {
147 147
         $this->checkRequiredParameters(['id'], $params);
148
-        $url = '/_watcher/watch/' . $this->encode($params['id']);
148
+        $url = '/_watcher/watch/'.$this->encode($params['id']);
149 149
         $method = 'DELETE';
150 150
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
151 151
         $headers = ['Accept' => 'application/json'];
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     public function executeWatch(array $params = [])
177 177
     {
178 178
         if (isset($params['id'])) {
179
-            $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute';
179
+            $url = '/_watcher/watch/'.$this->encode($params['id']).'/_execute';
180 180
             $method = 'PUT';
181 181
         } else {
182 182
             $url = '/_watcher/watch/_execute';
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     public function getWatch(array $params = [])
238 238
     {
239 239
         $this->checkRequiredParameters(['id'], $params);
240
-        $url = '/_watcher/watch/' . $this->encode($params['id']);
240
+        $url = '/_watcher/watch/'.$this->encode($params['id']);
241 241
         $method = 'GET';
242 242
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
243 243
         $headers = ['Accept' => 'application/json'];
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     public function putWatch(array $params = [])
273 273
     {
274 274
         $this->checkRequiredParameters(['id'], $params);
275
-        $url = '/_watcher/watch/' . $this->encode($params['id']);
275
+        $url = '/_watcher/watch/'.$this->encode($params['id']);
276 276
         $method = 'PUT';
277 277
         $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
278 278
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
     public function stats(array $params = [])
358 358
     {
359 359
         if (isset($params['metric'])) {
360
-            $url = '/_watcher/stats/' . $this->encode($params['metric']);
360
+            $url = '/_watcher/stats/'.$this->encode($params['metric']);
361 361
             $method = 'GET';
362 362
         } else {
363 363
             $url = '/_watcher/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 Watcher extends AbstractEndpoint
27
-{
26
+class Watcher extends AbstractEndpoint {
28 27
     /**
29 28
      * Acknowledges a watch, manually throttling the execution of the watch's actions.
30 29
      *
Please login to merge, or discard this patch.
Indentation   +429 added lines, -429 removed lines patch added patch discarded remove patch
@@ -25,433 +25,433 @@
 block discarded – undo
25 25
  */
26 26
 class Watcher extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Acknowledges a watch, manually throttling the execution of the watch's actions.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
32
-     *
33
-     * @param array{
34
-     *     watch_id: string, // (REQUIRED) Watch ID
35
-     *     action_id: list, //  A comma-separated list of the action ids to be acked
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 ackWatch(array $params = [])
51
-    {
52
-        $this->checkRequiredParameters(['watch_id'], $params);
53
-        if (isset($params['action_id'])) {
54
-            $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']);
55
-            $method = 'PUT';
56
-        } else {
57
-            $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack';
58
-            $method = 'PUT';
59
-        }
60
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
61
-        $headers = ['Accept' => 'application/json'];
62
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
63
-        $request = $this->addOtelAttributes($params, ['watch_id', 'action_id'], $request, 'watcher.ack_watch');
64
-        return $this->client->sendRequest($request);
65
-    }
66
-    /**
67
-     * Activates a currently inactive watch.
68
-     *
69
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html
70
-     *
71
-     * @param array{
72
-     *     watch_id: string, // (REQUIRED) Watch ID
73
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
74
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
75
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
76
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
77
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
78
-     * } $params
79
-     *
80
-     * @throws MissingParameterException if a required parameter is missing
81
-     * @throws NoNodeAvailableException if all the hosts are offline
82
-     * @throws ClientResponseException if the status code of response is 4xx
83
-     * @throws ServerResponseException if the status code of response is 5xx
84
-     *
85
-     * @return Elasticsearch|Promise
86
-     */
87
-    public function activateWatch(array $params = [])
88
-    {
89
-        $this->checkRequiredParameters(['watch_id'], $params);
90
-        $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate';
91
-        $method = 'PUT';
92
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
93
-        $headers = ['Accept' => 'application/json'];
94
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
95
-        $request = $this->addOtelAttributes($params, ['watch_id'], $request, 'watcher.activate_watch');
96
-        return $this->client->sendRequest($request);
97
-    }
98
-    /**
99
-     * Deactivates a currently active watch.
100
-     *
101
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html
102
-     *
103
-     * @param array{
104
-     *     watch_id: string, // (REQUIRED) Watch ID
105
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
106
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
107
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
108
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
109
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
110
-     * } $params
111
-     *
112
-     * @throws MissingParameterException if a required parameter is missing
113
-     * @throws NoNodeAvailableException if all the hosts are offline
114
-     * @throws ClientResponseException if the status code of response is 4xx
115
-     * @throws ServerResponseException if the status code of response is 5xx
116
-     *
117
-     * @return Elasticsearch|Promise
118
-     */
119
-    public function deactivateWatch(array $params = [])
120
-    {
121
-        $this->checkRequiredParameters(['watch_id'], $params);
122
-        $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate';
123
-        $method = 'PUT';
124
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
125
-        $headers = ['Accept' => 'application/json'];
126
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
127
-        $request = $this->addOtelAttributes($params, ['watch_id'], $request, 'watcher.deactivate_watch');
128
-        return $this->client->sendRequest($request);
129
-    }
130
-    /**
131
-     * Removes a watch from Watcher.
132
-     *
133
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
134
-     *
135
-     * @param array{
136
-     *     id: string, // (REQUIRED) Watch ID
137
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
138
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
139
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
140
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
141
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
142
-     * } $params
143
-     *
144
-     * @throws MissingParameterException if a required parameter is missing
145
-     * @throws NoNodeAvailableException if all the hosts are offline
146
-     * @throws ClientResponseException if the status code of response is 4xx
147
-     * @throws ServerResponseException if the status code of response is 5xx
148
-     *
149
-     * @return Elasticsearch|Promise
150
-     */
151
-    public function deleteWatch(array $params = [])
152
-    {
153
-        $this->checkRequiredParameters(['id'], $params);
154
-        $url = '/_watcher/watch/' . $this->encode($params['id']);
155
-        $method = 'DELETE';
156
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
157
-        $headers = ['Accept' => 'application/json'];
158
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
159
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.delete_watch');
160
-        return $this->client->sendRequest($request);
161
-    }
162
-    /**
163
-     * Forces the execution of a stored watch.
164
-     *
165
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
166
-     *
167
-     * @param array{
168
-     *     id: string, //  Watch ID
169
-     *     debug: boolean, // indicates whether the watch should execute in debug mode
170
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
171
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
172
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
173
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
174
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
175
-     *     body: array, //  Execution control
176
-     * } $params
177
-     *
178
-     * @throws NoNodeAvailableException if all the hosts are offline
179
-     * @throws ClientResponseException if the status code of response is 4xx
180
-     * @throws ServerResponseException if the status code of response is 5xx
181
-     *
182
-     * @return Elasticsearch|Promise
183
-     */
184
-    public function executeWatch(array $params = [])
185
-    {
186
-        if (isset($params['id'])) {
187
-            $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute';
188
-            $method = 'PUT';
189
-        } else {
190
-            $url = '/_watcher/watch/_execute';
191
-            $method = 'PUT';
192
-        }
193
-        $url = $this->addQueryString($url, $params, ['debug', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
194
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
195
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
196
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.execute_watch');
197
-        return $this->client->sendRequest($request);
198
-    }
199
-    /**
200
-     * Retrieve settings for the watcher system index
201
-     *
202
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html
203
-     *
204
-     * @param array{
205
-     *     master_timeout: time, // Specify timeout for connection to master
206
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
207
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
208
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
209
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
210
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
211
-     * } $params
212
-     *
213
-     * @throws NoNodeAvailableException if all the hosts are offline
214
-     * @throws ClientResponseException if the status code of response is 4xx
215
-     * @throws ServerResponseException if the status code of response is 5xx
216
-     *
217
-     * @return Elasticsearch|Promise
218
-     */
219
-    public function getSettings(array $params = [])
220
-    {
221
-        $url = '/_watcher/settings';
222
-        $method = 'GET';
223
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
224
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
225
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
226
-        $request = $this->addOtelAttributes($params, [], $request, 'watcher.get_settings');
227
-        return $this->client->sendRequest($request);
228
-    }
229
-    /**
230
-     * Retrieves a watch by its ID.
231
-     *
232
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html
233
-     *
234
-     * @param array{
235
-     *     id: string, // (REQUIRED) Watch ID
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 MissingParameterException if a required parameter is missing
244
-     * @throws NoNodeAvailableException if all the hosts are offline
245
-     * @throws ClientResponseException if the status code of response is 4xx
246
-     * @throws ServerResponseException if the status code of response is 5xx
247
-     *
248
-     * @return Elasticsearch|Promise
249
-     */
250
-    public function getWatch(array $params = [])
251
-    {
252
-        $this->checkRequiredParameters(['id'], $params);
253
-        $url = '/_watcher/watch/' . $this->encode($params['id']);
254
-        $method = 'GET';
255
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
256
-        $headers = ['Accept' => 'application/json'];
257
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
258
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.get_watch');
259
-        return $this->client->sendRequest($request);
260
-    }
261
-    /**
262
-     * Creates a new watch, or updates an existing one.
263
-     *
264
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
265
-     *
266
-     * @param array{
267
-     *     id: string, // (REQUIRED) Watch ID
268
-     *     active: boolean, // Specify whether the watch is in/active by default
269
-     *     version: number, // Explicit version number for concurrency control
270
-     *     if_seq_no: number, // only update the watch if the last operation that has changed the watch has the specified sequence number
271
-     *     if_primary_term: number, // only update the watch if the last operation that has changed the watch has the specified primary term
272
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
273
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
274
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
275
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
276
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
277
-     *     body: array, //  The watch
278
-     * } $params
279
-     *
280
-     * @throws MissingParameterException if a required parameter is missing
281
-     * @throws NoNodeAvailableException if all the hosts are offline
282
-     * @throws ClientResponseException if the status code of response is 4xx
283
-     * @throws ServerResponseException if the status code of response is 5xx
284
-     *
285
-     * @return Elasticsearch|Promise
286
-     */
287
-    public function putWatch(array $params = [])
288
-    {
289
-        $this->checkRequiredParameters(['id'], $params);
290
-        $url = '/_watcher/watch/' . $this->encode($params['id']);
291
-        $method = 'PUT';
292
-        $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
293
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
294
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
295
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.put_watch');
296
-        return $this->client->sendRequest($request);
297
-    }
298
-    /**
299
-     * Retrieves stored watches.
300
-     *
301
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html
302
-     *
303
-     * @param array{
304
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
305
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
306
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
307
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
308
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
309
-     *     body: array, //  From, size, query, sort and search_after
310
-     * } $params
311
-     *
312
-     * @throws NoNodeAvailableException if all the hosts are offline
313
-     * @throws ClientResponseException if the status code of response is 4xx
314
-     * @throws ServerResponseException if the status code of response is 5xx
315
-     *
316
-     * @return Elasticsearch|Promise
317
-     */
318
-    public function queryWatches(array $params = [])
319
-    {
320
-        $url = '/_watcher/_query/watches';
321
-        $method = empty($params['body']) ? 'GET' : 'POST';
322
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
323
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
324
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
325
-        $request = $this->addOtelAttributes($params, [], $request, 'watcher.query_watches');
326
-        return $this->client->sendRequest($request);
327
-    }
328
-    /**
329
-     * Starts Watcher if it is not already running.
330
-     *
331
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html
332
-     *
333
-     * @param array{
334
-     *     master_timeout: time, // Specify timeout for connection to master
335
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
336
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
337
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
338
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
339
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
340
-     * } $params
341
-     *
342
-     * @throws NoNodeAvailableException if all the hosts are offline
343
-     * @throws ClientResponseException if the status code of response is 4xx
344
-     * @throws ServerResponseException if the status code of response is 5xx
345
-     *
346
-     * @return Elasticsearch|Promise
347
-     */
348
-    public function start(array $params = [])
349
-    {
350
-        $url = '/_watcher/_start';
351
-        $method = 'POST';
352
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
353
-        $headers = ['Accept' => 'application/json'];
354
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
355
-        $request = $this->addOtelAttributes($params, [], $request, 'watcher.start');
356
-        return $this->client->sendRequest($request);
357
-    }
358
-    /**
359
-     * Retrieves the current Watcher metrics.
360
-     *
361
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html
362
-     *
363
-     * @param array{
364
-     *     metric: list, //  Controls what additional stat metrics should be include in the response
365
-     *     emit_stacktraces: boolean, // Emits stack traces of currently running watches
366
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
367
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
368
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
369
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
370
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
371
-     * } $params
372
-     *
373
-     * @throws NoNodeAvailableException if all the hosts are offline
374
-     * @throws ClientResponseException if the status code of response is 4xx
375
-     * @throws ServerResponseException if the status code of response is 5xx
376
-     *
377
-     * @return Elasticsearch|Promise
378
-     */
379
-    public function stats(array $params = [])
380
-    {
381
-        if (isset($params['metric'])) {
382
-            $url = '/_watcher/stats/' . $this->encode($params['metric']);
383
-            $method = 'GET';
384
-        } else {
385
-            $url = '/_watcher/stats';
386
-            $method = 'GET';
387
-        }
388
-        $url = $this->addQueryString($url, $params, ['emit_stacktraces', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
389
-        $headers = ['Accept' => 'application/json'];
390
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
391
-        $request = $this->addOtelAttributes($params, ['metric'], $request, 'watcher.stats');
392
-        return $this->client->sendRequest($request);
393
-    }
394
-    /**
395
-     * Stops Watcher if it is running.
396
-     *
397
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html
398
-     *
399
-     * @param array{
400
-     *     master_timeout: time, // Specify timeout for connection to master
401
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
402
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
403
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
404
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
405
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
406
-     * } $params
407
-     *
408
-     * @throws NoNodeAvailableException if all the hosts are offline
409
-     * @throws ClientResponseException if the status code of response is 4xx
410
-     * @throws ServerResponseException if the status code of response is 5xx
411
-     *
412
-     * @return Elasticsearch|Promise
413
-     */
414
-    public function stop(array $params = [])
415
-    {
416
-        $url = '/_watcher/_stop';
417
-        $method = 'POST';
418
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
419
-        $headers = ['Accept' => 'application/json'];
420
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
421
-        $request = $this->addOtelAttributes($params, [], $request, 'watcher.stop');
422
-        return $this->client->sendRequest($request);
423
-    }
424
-    /**
425
-     * Update settings for the watcher system index
426
-     *
427
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html
428
-     *
429
-     * @param array{
430
-     *     timeout: time, // Specify timeout for waiting for acknowledgement from all nodes
431
-     *     master_timeout: time, // Specify timeout for connection to master
432
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
433
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
434
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
435
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
436
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
437
-     *     body: array, // (REQUIRED) An object with the new index settings
438
-     * } $params
439
-     *
440
-     * @throws NoNodeAvailableException if all the hosts are offline
441
-     * @throws ClientResponseException if the status code of response is 4xx
442
-     * @throws ServerResponseException if the status code of response is 5xx
443
-     *
444
-     * @return Elasticsearch|Promise
445
-     */
446
-    public function updateSettings(array $params = [])
447
-    {
448
-        $this->checkRequiredParameters(['body'], $params);
449
-        $url = '/_watcher/settings';
450
-        $method = 'PUT';
451
-        $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
452
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
453
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
454
-        $request = $this->addOtelAttributes($params, [], $request, 'watcher.update_settings');
455
-        return $this->client->sendRequest($request);
456
-    }
28
+	/**
29
+	 * Acknowledges a watch, manually throttling the execution of the watch's actions.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
32
+	 *
33
+	 * @param array{
34
+	 *     watch_id: string, // (REQUIRED) Watch ID
35
+	 *     action_id: list, //  A comma-separated list of the action ids to be acked
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 ackWatch(array $params = [])
51
+	{
52
+		$this->checkRequiredParameters(['watch_id'], $params);
53
+		if (isset($params['action_id'])) {
54
+			$url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']);
55
+			$method = 'PUT';
56
+		} else {
57
+			$url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack';
58
+			$method = 'PUT';
59
+		}
60
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
61
+		$headers = ['Accept' => 'application/json'];
62
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
63
+		$request = $this->addOtelAttributes($params, ['watch_id', 'action_id'], $request, 'watcher.ack_watch');
64
+		return $this->client->sendRequest($request);
65
+	}
66
+	/**
67
+	 * Activates a currently inactive watch.
68
+	 *
69
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html
70
+	 *
71
+	 * @param array{
72
+	 *     watch_id: string, // (REQUIRED) Watch ID
73
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
74
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
75
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
76
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
77
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
78
+	 * } $params
79
+	 *
80
+	 * @throws MissingParameterException if a required parameter is missing
81
+	 * @throws NoNodeAvailableException if all the hosts are offline
82
+	 * @throws ClientResponseException if the status code of response is 4xx
83
+	 * @throws ServerResponseException if the status code of response is 5xx
84
+	 *
85
+	 * @return Elasticsearch|Promise
86
+	 */
87
+	public function activateWatch(array $params = [])
88
+	{
89
+		$this->checkRequiredParameters(['watch_id'], $params);
90
+		$url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate';
91
+		$method = 'PUT';
92
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
93
+		$headers = ['Accept' => 'application/json'];
94
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
95
+		$request = $this->addOtelAttributes($params, ['watch_id'], $request, 'watcher.activate_watch');
96
+		return $this->client->sendRequest($request);
97
+	}
98
+	/**
99
+	 * Deactivates a currently active watch.
100
+	 *
101
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html
102
+	 *
103
+	 * @param array{
104
+	 *     watch_id: string, // (REQUIRED) Watch ID
105
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
106
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
107
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
108
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
109
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
110
+	 * } $params
111
+	 *
112
+	 * @throws MissingParameterException if a required parameter is missing
113
+	 * @throws NoNodeAvailableException if all the hosts are offline
114
+	 * @throws ClientResponseException if the status code of response is 4xx
115
+	 * @throws ServerResponseException if the status code of response is 5xx
116
+	 *
117
+	 * @return Elasticsearch|Promise
118
+	 */
119
+	public function deactivateWatch(array $params = [])
120
+	{
121
+		$this->checkRequiredParameters(['watch_id'], $params);
122
+		$url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate';
123
+		$method = 'PUT';
124
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
125
+		$headers = ['Accept' => 'application/json'];
126
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
127
+		$request = $this->addOtelAttributes($params, ['watch_id'], $request, 'watcher.deactivate_watch');
128
+		return $this->client->sendRequest($request);
129
+	}
130
+	/**
131
+	 * Removes a watch from Watcher.
132
+	 *
133
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
134
+	 *
135
+	 * @param array{
136
+	 *     id: string, // (REQUIRED) Watch ID
137
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
138
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
139
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
140
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
141
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
142
+	 * } $params
143
+	 *
144
+	 * @throws MissingParameterException if a required parameter is missing
145
+	 * @throws NoNodeAvailableException if all the hosts are offline
146
+	 * @throws ClientResponseException if the status code of response is 4xx
147
+	 * @throws ServerResponseException if the status code of response is 5xx
148
+	 *
149
+	 * @return Elasticsearch|Promise
150
+	 */
151
+	public function deleteWatch(array $params = [])
152
+	{
153
+		$this->checkRequiredParameters(['id'], $params);
154
+		$url = '/_watcher/watch/' . $this->encode($params['id']);
155
+		$method = 'DELETE';
156
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
157
+		$headers = ['Accept' => 'application/json'];
158
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
159
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.delete_watch');
160
+		return $this->client->sendRequest($request);
161
+	}
162
+	/**
163
+	 * Forces the execution of a stored watch.
164
+	 *
165
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
166
+	 *
167
+	 * @param array{
168
+	 *     id: string, //  Watch ID
169
+	 *     debug: boolean, // indicates whether the watch should execute in debug mode
170
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
171
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
172
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
173
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
174
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
175
+	 *     body: array, //  Execution control
176
+	 * } $params
177
+	 *
178
+	 * @throws NoNodeAvailableException if all the hosts are offline
179
+	 * @throws ClientResponseException if the status code of response is 4xx
180
+	 * @throws ServerResponseException if the status code of response is 5xx
181
+	 *
182
+	 * @return Elasticsearch|Promise
183
+	 */
184
+	public function executeWatch(array $params = [])
185
+	{
186
+		if (isset($params['id'])) {
187
+			$url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute';
188
+			$method = 'PUT';
189
+		} else {
190
+			$url = '/_watcher/watch/_execute';
191
+			$method = 'PUT';
192
+		}
193
+		$url = $this->addQueryString($url, $params, ['debug', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
194
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
195
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
196
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.execute_watch');
197
+		return $this->client->sendRequest($request);
198
+	}
199
+	/**
200
+	 * Retrieve settings for the watcher system index
201
+	 *
202
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html
203
+	 *
204
+	 * @param array{
205
+	 *     master_timeout: time, // Specify timeout for connection to master
206
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
207
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
208
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
209
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
210
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
211
+	 * } $params
212
+	 *
213
+	 * @throws NoNodeAvailableException if all the hosts are offline
214
+	 * @throws ClientResponseException if the status code of response is 4xx
215
+	 * @throws ServerResponseException if the status code of response is 5xx
216
+	 *
217
+	 * @return Elasticsearch|Promise
218
+	 */
219
+	public function getSettings(array $params = [])
220
+	{
221
+		$url = '/_watcher/settings';
222
+		$method = 'GET';
223
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
224
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
225
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
226
+		$request = $this->addOtelAttributes($params, [], $request, 'watcher.get_settings');
227
+		return $this->client->sendRequest($request);
228
+	}
229
+	/**
230
+	 * Retrieves a watch by its ID.
231
+	 *
232
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html
233
+	 *
234
+	 * @param array{
235
+	 *     id: string, // (REQUIRED) Watch ID
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 MissingParameterException if a required parameter is missing
244
+	 * @throws NoNodeAvailableException if all the hosts are offline
245
+	 * @throws ClientResponseException if the status code of response is 4xx
246
+	 * @throws ServerResponseException if the status code of response is 5xx
247
+	 *
248
+	 * @return Elasticsearch|Promise
249
+	 */
250
+	public function getWatch(array $params = [])
251
+	{
252
+		$this->checkRequiredParameters(['id'], $params);
253
+		$url = '/_watcher/watch/' . $this->encode($params['id']);
254
+		$method = 'GET';
255
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
256
+		$headers = ['Accept' => 'application/json'];
257
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
258
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.get_watch');
259
+		return $this->client->sendRequest($request);
260
+	}
261
+	/**
262
+	 * Creates a new watch, or updates an existing one.
263
+	 *
264
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
265
+	 *
266
+	 * @param array{
267
+	 *     id: string, // (REQUIRED) Watch ID
268
+	 *     active: boolean, // Specify whether the watch is in/active by default
269
+	 *     version: number, // Explicit version number for concurrency control
270
+	 *     if_seq_no: number, // only update the watch if the last operation that has changed the watch has the specified sequence number
271
+	 *     if_primary_term: number, // only update the watch if the last operation that has changed the watch has the specified primary term
272
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
273
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
274
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
275
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
276
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
277
+	 *     body: array, //  The watch
278
+	 * } $params
279
+	 *
280
+	 * @throws MissingParameterException if a required parameter is missing
281
+	 * @throws NoNodeAvailableException if all the hosts are offline
282
+	 * @throws ClientResponseException if the status code of response is 4xx
283
+	 * @throws ServerResponseException if the status code of response is 5xx
284
+	 *
285
+	 * @return Elasticsearch|Promise
286
+	 */
287
+	public function putWatch(array $params = [])
288
+	{
289
+		$this->checkRequiredParameters(['id'], $params);
290
+		$url = '/_watcher/watch/' . $this->encode($params['id']);
291
+		$method = 'PUT';
292
+		$url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
293
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
294
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
295
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'watcher.put_watch');
296
+		return $this->client->sendRequest($request);
297
+	}
298
+	/**
299
+	 * Retrieves stored watches.
300
+	 *
301
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html
302
+	 *
303
+	 * @param array{
304
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
305
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
306
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
307
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
308
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
309
+	 *     body: array, //  From, size, query, sort and search_after
310
+	 * } $params
311
+	 *
312
+	 * @throws NoNodeAvailableException if all the hosts are offline
313
+	 * @throws ClientResponseException if the status code of response is 4xx
314
+	 * @throws ServerResponseException if the status code of response is 5xx
315
+	 *
316
+	 * @return Elasticsearch|Promise
317
+	 */
318
+	public function queryWatches(array $params = [])
319
+	{
320
+		$url = '/_watcher/_query/watches';
321
+		$method = empty($params['body']) ? 'GET' : 'POST';
322
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
323
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
324
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
325
+		$request = $this->addOtelAttributes($params, [], $request, 'watcher.query_watches');
326
+		return $this->client->sendRequest($request);
327
+	}
328
+	/**
329
+	 * Starts Watcher if it is not already running.
330
+	 *
331
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html
332
+	 *
333
+	 * @param array{
334
+	 *     master_timeout: time, // Specify timeout for connection to master
335
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
336
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
337
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
338
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
339
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
340
+	 * } $params
341
+	 *
342
+	 * @throws NoNodeAvailableException if all the hosts are offline
343
+	 * @throws ClientResponseException if the status code of response is 4xx
344
+	 * @throws ServerResponseException if the status code of response is 5xx
345
+	 *
346
+	 * @return Elasticsearch|Promise
347
+	 */
348
+	public function start(array $params = [])
349
+	{
350
+		$url = '/_watcher/_start';
351
+		$method = 'POST';
352
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
353
+		$headers = ['Accept' => 'application/json'];
354
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
355
+		$request = $this->addOtelAttributes($params, [], $request, 'watcher.start');
356
+		return $this->client->sendRequest($request);
357
+	}
358
+	/**
359
+	 * Retrieves the current Watcher metrics.
360
+	 *
361
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html
362
+	 *
363
+	 * @param array{
364
+	 *     metric: list, //  Controls what additional stat metrics should be include in the response
365
+	 *     emit_stacktraces: boolean, // Emits stack traces of currently running watches
366
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
367
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
368
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
369
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
370
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
371
+	 * } $params
372
+	 *
373
+	 * @throws NoNodeAvailableException if all the hosts are offline
374
+	 * @throws ClientResponseException if the status code of response is 4xx
375
+	 * @throws ServerResponseException if the status code of response is 5xx
376
+	 *
377
+	 * @return Elasticsearch|Promise
378
+	 */
379
+	public function stats(array $params = [])
380
+	{
381
+		if (isset($params['metric'])) {
382
+			$url = '/_watcher/stats/' . $this->encode($params['metric']);
383
+			$method = 'GET';
384
+		} else {
385
+			$url = '/_watcher/stats';
386
+			$method = 'GET';
387
+		}
388
+		$url = $this->addQueryString($url, $params, ['emit_stacktraces', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
389
+		$headers = ['Accept' => 'application/json'];
390
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
391
+		$request = $this->addOtelAttributes($params, ['metric'], $request, 'watcher.stats');
392
+		return $this->client->sendRequest($request);
393
+	}
394
+	/**
395
+	 * Stops Watcher if it is running.
396
+	 *
397
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html
398
+	 *
399
+	 * @param array{
400
+	 *     master_timeout: time, // Specify timeout for connection to master
401
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
402
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
403
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
404
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
405
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
406
+	 * } $params
407
+	 *
408
+	 * @throws NoNodeAvailableException if all the hosts are offline
409
+	 * @throws ClientResponseException if the status code of response is 4xx
410
+	 * @throws ServerResponseException if the status code of response is 5xx
411
+	 *
412
+	 * @return Elasticsearch|Promise
413
+	 */
414
+	public function stop(array $params = [])
415
+	{
416
+		$url = '/_watcher/_stop';
417
+		$method = 'POST';
418
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
419
+		$headers = ['Accept' => 'application/json'];
420
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
421
+		$request = $this->addOtelAttributes($params, [], $request, 'watcher.stop');
422
+		return $this->client->sendRequest($request);
423
+	}
424
+	/**
425
+	 * Update settings for the watcher system index
426
+	 *
427
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html
428
+	 *
429
+	 * @param array{
430
+	 *     timeout: time, // Specify timeout for waiting for acknowledgement from all nodes
431
+	 *     master_timeout: time, // Specify timeout for connection to master
432
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
433
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
434
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
435
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
436
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
437
+	 *     body: array, // (REQUIRED) An object with the new index settings
438
+	 * } $params
439
+	 *
440
+	 * @throws NoNodeAvailableException if all the hosts are offline
441
+	 * @throws ClientResponseException if the status code of response is 4xx
442
+	 * @throws ServerResponseException if the status code of response is 5xx
443
+	 *
444
+	 * @return Elasticsearch|Promise
445
+	 */
446
+	public function updateSettings(array $params = [])
447
+	{
448
+		$this->checkRequiredParameters(['body'], $params);
449
+		$url = '/_watcher/settings';
450
+		$method = 'PUT';
451
+		$url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
452
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
453
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
454
+		$request = $this->addOtelAttributes($params, [], $request, 'watcher.update_settings');
455
+		return $this->client->sendRequest($request);
456
+	}
457 457
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Security.php 3 patches
Spacing   +35 added lines, -35 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;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     {
137 137
         $this->checkRequiredParameters(['body'], $params);
138 138
         if (isset($params['username'])) {
139
-            $url = '/_security/user/' . $this->encode($params['username']) . '/_password';
139
+            $url = '/_security/user/'.$this->encode($params['username']).'/_password';
140 140
             $method = 'PUT';
141 141
         } else {
142 142
             $url = '/_security/user/_password';
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     public function clearApiKeyCache(array $params = [])
171 171
     {
172 172
         $this->checkRequiredParameters(['ids'], $params);
173
-        $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache';
173
+        $url = '/_security/api_key/'.$this->encode($params['ids']).'/_clear_cache';
174 174
         $method = 'POST';
175 175
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
176 176
         $headers = ['Accept' => 'application/json'];
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     public function clearCachedPrivileges(array $params = [])
201 201
     {
202 202
         $this->checkRequiredParameters(['application'], $params);
203
-        $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache';
203
+        $url = '/_security/privilege/'.$this->encode($params['application']).'/_clear_cache';
204 204
         $method = 'POST';
205 205
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
206 206
         $headers = ['Accept' => 'application/json'];
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
     public function clearCachedRealms(array $params = [])
232 232
     {
233 233
         $this->checkRequiredParameters(['realms'], $params);
234
-        $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache';
234
+        $url = '/_security/realm/'.$this->encode($params['realms']).'/_clear_cache';
235 235
         $method = 'POST';
236 236
         $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
237 237
         $headers = ['Accept' => 'application/json'];
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     public function clearCachedRoles(array $params = [])
262 262
     {
263 263
         $this->checkRequiredParameters(['name'], $params);
264
-        $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache';
264
+        $url = '/_security/role/'.$this->encode($params['name']).'/_clear_cache';
265 265
         $method = 'POST';
266 266
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
267 267
         $headers = ['Accept' => 'application/json'];
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     public function clearCachedServiceTokens(array $params = [])
294 294
     {
295 295
         $this->checkRequiredParameters(['namespace', 'service', 'name'], $params);
296
-        $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache';
296
+        $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']).'/_clear_cache';
297 297
         $method = 'POST';
298 298
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
299 299
         $headers = ['Accept' => 'application/json'];
@@ -386,10 +386,10 @@  discard block
 block discarded – undo
386 386
     {
387 387
         $this->checkRequiredParameters(['namespace', 'service'], $params);
388 388
         if (isset($params['name'])) {
389
-            $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']);
389
+            $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']);
390 390
             $method = 'PUT';
391 391
         } else {
392
-            $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token';
392
+            $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token';
393 393
             $method = 'POST';
394 394
         }
395 395
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     public function deletePrivileges(array $params = [])
423 423
     {
424 424
         $this->checkRequiredParameters(['application', 'name'], $params);
425
-        $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']);
425
+        $url = '/_security/privilege/'.$this->encode($params['application']).'/'.$this->encode($params['name']);
426 426
         $method = 'DELETE';
427 427
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
428 428
         $headers = ['Accept' => 'application/json'];
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     public function deleteRole(array $params = [])
454 454
     {
455 455
         $this->checkRequiredParameters(['name'], $params);
456
-        $url = '/_security/role/' . $this->encode($params['name']);
456
+        $url = '/_security/role/'.$this->encode($params['name']);
457 457
         $method = 'DELETE';
458 458
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
459 459
         $headers = ['Accept' => 'application/json'];
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     public function deleteRoleMapping(array $params = [])
485 485
     {
486 486
         $this->checkRequiredParameters(['name'], $params);
487
-        $url = '/_security/role_mapping/' . $this->encode($params['name']);
487
+        $url = '/_security/role_mapping/'.$this->encode($params['name']);
488 488
         $method = 'DELETE';
489 489
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
490 490
         $headers = ['Accept' => 'application/json'];
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
     public function deleteServiceToken(array $params = [])
518 518
     {
519 519
         $this->checkRequiredParameters(['namespace', 'service', 'name'], $params);
520
-        $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']);
520
+        $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']);
521 521
         $method = 'DELETE';
522 522
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
523 523
         $headers = ['Accept' => 'application/json'];
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
     public function deleteUser(array $params = [])
549 549
     {
550 550
         $this->checkRequiredParameters(['username'], $params);
551
-        $url = '/_security/user/' . $this->encode($params['username']);
551
+        $url = '/_security/user/'.$this->encode($params['username']);
552 552
         $method = 'DELETE';
553 553
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
554 554
         $headers = ['Accept' => 'application/json'];
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
     public function disableUser(array $params = [])
580 580
     {
581 581
         $this->checkRequiredParameters(['username'], $params);
582
-        $url = '/_security/user/' . $this->encode($params['username']) . '/_disable';
582
+        $url = '/_security/user/'.$this->encode($params['username']).'/_disable';
583 583
         $method = 'PUT';
584 584
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
585 585
         $headers = ['Accept' => 'application/json'];
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
     public function disableUserProfile(array $params = [])
611 611
     {
612 612
         $this->checkRequiredParameters(['uid'], $params);
613
-        $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable';
613
+        $url = '/_security/profile/'.$this->encode($params['uid']).'/_disable';
614 614
         $method = 'PUT';
615 615
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
616 616
         $headers = ['Accept' => 'application/json'];
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
     public function enableUser(array $params = [])
642 642
     {
643 643
         $this->checkRequiredParameters(['username'], $params);
644
-        $url = '/_security/user/' . $this->encode($params['username']) . '/_enable';
644
+        $url = '/_security/user/'.$this->encode($params['username']).'/_enable';
645 645
         $method = 'PUT';
646 646
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
647 647
         $headers = ['Accept' => 'application/json'];
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
     public function enableUserProfile(array $params = [])
673 673
     {
674 674
         $this->checkRequiredParameters(['uid'], $params);
675
-        $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable';
675
+        $url = '/_security/profile/'.$this->encode($params['uid']).'/_enable';
676 676
         $method = 'PUT';
677 677
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
678 678
         $headers = ['Accept' => 'application/json'];
@@ -817,10 +817,10 @@  discard block
 block discarded – undo
817 817
     public function getPrivileges(array $params = [])
818 818
     {
819 819
         if (isset($params['application']) && isset($params['name'])) {
820
-            $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']);
820
+            $url = '/_security/privilege/'.$this->encode($params['application']).'/'.$this->encode($params['name']);
821 821
             $method = 'GET';
822 822
         } elseif (isset($params['application'])) {
823
-            $url = '/_security/privilege/' . $this->encode($params['application']);
823
+            $url = '/_security/privilege/'.$this->encode($params['application']);
824 824
             $method = 'GET';
825 825
         } else {
826 826
             $url = '/_security/privilege';
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
     public function getRole(array $params = [])
854 854
     {
855 855
         if (isset($params['name'])) {
856
-            $url = '/_security/role/' . $this->encode($params['name']);
856
+            $url = '/_security/role/'.$this->encode($params['name']);
857 857
             $method = 'GET';
858 858
         } else {
859 859
             $url = '/_security/role';
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
     public function getRoleMapping(array $params = [])
887 887
     {
888 888
         if (isset($params['name'])) {
889
-            $url = '/_security/role_mapping/' . $this->encode($params['name']);
889
+            $url = '/_security/role_mapping/'.$this->encode($params['name']);
890 890
             $method = 'GET';
891 891
         } else {
892 892
             $url = '/_security/role_mapping';
@@ -920,10 +920,10 @@  discard block
 block discarded – undo
920 920
     public function getServiceAccounts(array $params = [])
921 921
     {
922 922
         if (isset($params['namespace']) && isset($params['service'])) {
923
-            $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']);
923
+            $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']);
924 924
             $method = 'GET';
925 925
         } elseif (isset($params['namespace'])) {
926
-            $url = '/_security/service/' . $this->encode($params['namespace']);
926
+            $url = '/_security/service/'.$this->encode($params['namespace']);
927 927
             $method = 'GET';
928 928
         } else {
929 929
             $url = '/_security/service';
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
     public function getServiceCredentials(array $params = [])
959 959
     {
960 960
         $this->checkRequiredParameters(['namespace', 'service'], $params);
961
-        $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential';
961
+        $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential';
962 962
         $method = 'GET';
963 963
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
964 964
         $headers = ['Accept' => 'application/json'];
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
     public function getUser(array $params = [])
1045 1045
     {
1046 1046
         if (isset($params['username'])) {
1047
-            $url = '/_security/user/' . $this->encode($params['username']);
1047
+            $url = '/_security/user/'.$this->encode($params['username']);
1048 1048
             $method = 'GET';
1049 1049
         } else {
1050 1050
             $url = '/_security/user';
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
     public function getUserProfile(array $params = [])
1107 1107
     {
1108 1108
         $this->checkRequiredParameters(['uid'], $params);
1109
-        $url = '/_security/profile/' . $this->encode($params['uid']);
1109
+        $url = '/_security/profile/'.$this->encode($params['uid']);
1110 1110
         $method = 'GET';
1111 1111
         $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1112 1112
         $headers = ['Accept' => 'application/json'];
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
     {
1168 1168
         $this->checkRequiredParameters(['body'], $params);
1169 1169
         if (isset($params['user'])) {
1170
-            $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges';
1170
+            $url = '/_security/user/'.$this->encode($params['user']).'/_has_privileges';
1171 1171
             $method = empty($params['body']) ? 'GET' : 'POST';
1172 1172
         } else {
1173 1173
             $url = '/_security/user/_has_privileges';
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
     public function putRole(array $params = [])
1408 1408
     {
1409 1409
         $this->checkRequiredParameters(['name', 'body'], $params);
1410
-        $url = '/_security/role/' . $this->encode($params['name']);
1410
+        $url = '/_security/role/'.$this->encode($params['name']);
1411 1411
         $method = 'PUT';
1412 1412
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1413 1413
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1439,7 +1439,7 @@  discard block
 block discarded – undo
1439 1439
     public function putRoleMapping(array $params = [])
1440 1440
     {
1441 1441
         $this->checkRequiredParameters(['name', 'body'], $params);
1442
-        $url = '/_security/role_mapping/' . $this->encode($params['name']);
1442
+        $url = '/_security/role_mapping/'.$this->encode($params['name']);
1443 1443
         $method = 'PUT';
1444 1444
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1445 1445
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
     public function putUser(array $params = [])
1472 1472
     {
1473 1473
         $this->checkRequiredParameters(['username', 'body'], $params);
1474
-        $url = '/_security/user/' . $this->encode($params['username']);
1474
+        $url = '/_security/user/'.$this->encode($params['username']);
1475 1475
         $method = 'PUT';
1476 1476
         $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1477 1477
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
     public function samlServiceProviderMetadata(array $params = [])
1705 1705
     {
1706 1706
         $this->checkRequiredParameters(['realm_name'], $params);
1707
-        $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']);
1707
+        $url = '/_security/saml/metadata/'.$this->encode($params['realm_name']);
1708 1708
         $method = 'GET';
1709 1709
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1710 1710
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1764,7 +1764,7 @@  discard block
 block discarded – undo
1764 1764
     public function updateApiKey(array $params = [])
1765 1765
     {
1766 1766
         $this->checkRequiredParameters(['id'], $params);
1767
-        $url = '/_security/api_key/' . $this->encode($params['id']);
1767
+        $url = '/_security/api_key/'.$this->encode($params['id']);
1768 1768
         $method = 'PUT';
1769 1769
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1770 1770
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
     public function updateCrossClusterApiKey(array $params = [])
1796 1796
     {
1797 1797
         $this->checkRequiredParameters(['id', 'body'], $params);
1798
-        $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']);
1798
+        $url = '/_security/cross_cluster/api_key/'.$this->encode($params['id']);
1799 1799
         $method = 'PUT';
1800 1800
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1801 1801
         $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
     public function updateUserProfileData(array $params = [])
1859 1859
     {
1860 1860
         $this->checkRequiredParameters(['uid', 'body'], $params);
1861
-        $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data';
1861
+        $url = '/_security/profile/'.$this->encode($params['uid']).'/_data';
1862 1862
         $method = 'PUT';
1863 1863
         $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1864 1864
         $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 Security extends AbstractEndpoint
27
-{
26
+class Security extends AbstractEndpoint {
28 27
     /**
29 28
      * Creates or updates the user profile on behalf of another user.
30 29
      *
Please login to merge, or discard this patch.
Indentation   +2059 added lines, -2059 removed lines patch added patch discarded remove patch
@@ -25,2063 +25,2063 @@
 block discarded – undo
25 25
  */
26 26
 class Security extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Creates or updates the user profile on behalf of another user.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html
32
-     *
33
-     * @param array{
34
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
35
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
36
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
37
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
38
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
39
-     *     body: array, // (REQUIRED) The grant type and user's credential
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 activateUserProfile(array $params = [])
49
-    {
50
-        $this->checkRequiredParameters(['body'], $params);
51
-        $url = '/_security/profile/_activate';
52
-        $method = 'POST';
53
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
54
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
55
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
56
-        $request = $this->addOtelAttributes($params, [], $request, 'security.activate_user_profile');
57
-        return $this->client->sendRequest($request);
58
-    }
59
-    /**
60
-     * Enables authentication as a user and retrieve information about the authenticated user.
61
-     *
62
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html
63
-     *
64
-     * @param array{
65
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
66
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
67
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
68
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
69
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
70
-     * } $params
71
-     *
72
-     * @throws NoNodeAvailableException if all the hosts are offline
73
-     * @throws ClientResponseException if the status code of response is 4xx
74
-     * @throws ServerResponseException if the status code of response is 5xx
75
-     *
76
-     * @return Elasticsearch|Promise
77
-     */
78
-    public function authenticate(array $params = [])
79
-    {
80
-        $url = '/_security/_authenticate';
81
-        $method = 'GET';
82
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
83
-        $headers = ['Accept' => 'application/json'];
84
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
85
-        $request = $this->addOtelAttributes($params, [], $request, 'security.authenticate');
86
-        return $this->client->sendRequest($request);
87
-    }
88
-    /**
89
-     * Bulk delete roles in the native realm.
90
-     *
91
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html
92
-     *
93
-     * @param array{
94
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
95
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
96
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
97
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
98
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
99
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
100
-     *     body: array, // (REQUIRED) The roles to delete
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 bulkDeleteRole(array $params = [])
110
-    {
111
-        $this->checkRequiredParameters(['body'], $params);
112
-        $url = '/_security/role';
113
-        $method = 'DELETE';
114
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
115
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
116
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
117
-        $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_delete_role');
118
-        return $this->client->sendRequest($request);
119
-    }
120
-    /**
121
-     * Bulk adds and updates roles in the native realm.
122
-     *
123
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html
124
-     *
125
-     * @param array{
126
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
127
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
128
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
129
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
130
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
131
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
132
-     *     body: array, // (REQUIRED) The roles to add
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 bulkPutRole(array $params = [])
142
-    {
143
-        $this->checkRequiredParameters(['body'], $params);
144
-        $url = '/_security/role';
145
-        $method = 'POST';
146
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
147
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
148
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
149
-        $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_put_role');
150
-        return $this->client->sendRequest($request);
151
-    }
152
-    /**
153
-     * Updates the attributes of multiple existing API keys.
154
-     *
155
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html
156
-     *
157
-     * @param array{
158
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
159
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
160
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
161
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
162
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
163
-     *     body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys.
164
-     * } $params
165
-     *
166
-     * @throws NoNodeAvailableException if all the hosts are offline
167
-     * @throws ClientResponseException if the status code of response is 4xx
168
-     * @throws ServerResponseException if the status code of response is 5xx
169
-     *
170
-     * @return Elasticsearch|Promise
171
-     */
172
-    public function bulkUpdateApiKeys(array $params = [])
173
-    {
174
-        $this->checkRequiredParameters(['body'], $params);
175
-        $url = '/_security/api_key/_bulk_update';
176
-        $method = 'POST';
177
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
178
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
179
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
180
-        $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_update_api_keys');
181
-        return $this->client->sendRequest($request);
182
-    }
183
-    /**
184
-     * Changes the passwords of users in the native realm and built-in users.
185
-     *
186
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html
187
-     *
188
-     * @param array{
189
-     *     username: string, //  The username of the user to change the password for
190
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
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 new password for the user
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 changePassword(array $params = [])
206
-    {
207
-        $this->checkRequiredParameters(['body'], $params);
208
-        if (isset($params['username'])) {
209
-            $url = '/_security/user/' . $this->encode($params['username']) . '/_password';
210
-            $method = 'PUT';
211
-        } else {
212
-            $url = '/_security/user/_password';
213
-            $method = 'PUT';
214
-        }
215
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
216
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
217
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
218
-        $request = $this->addOtelAttributes($params, ['username'], $request, 'security.change_password');
219
-        return $this->client->sendRequest($request);
220
-    }
221
-    /**
222
-     * Clear a subset or all entries from the API key cache.
223
-     *
224
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html
225
-     *
226
-     * @param array{
227
-     *     ids: list, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache
228
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
229
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
230
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
231
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
232
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
233
-     * } $params
234
-     *
235
-     * @throws MissingParameterException if a required parameter is missing
236
-     * @throws NoNodeAvailableException if all the hosts are offline
237
-     * @throws ClientResponseException if the status code of response is 4xx
238
-     * @throws ServerResponseException if the status code of response is 5xx
239
-     *
240
-     * @return Elasticsearch|Promise
241
-     */
242
-    public function clearApiKeyCache(array $params = [])
243
-    {
244
-        $this->checkRequiredParameters(['ids'], $params);
245
-        $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache';
246
-        $method = 'POST';
247
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
248
-        $headers = ['Accept' => 'application/json'];
249
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
250
-        $request = $this->addOtelAttributes($params, ['ids'], $request, 'security.clear_api_key_cache');
251
-        return $this->client->sendRequest($request);
252
-    }
253
-    /**
254
-     * Evicts application privileges from the native application privileges cache.
255
-     *
256
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html
257
-     *
258
-     * @param array{
259
-     *     application: list, // (REQUIRED) A comma-separated list of application names
260
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
261
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
262
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
263
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
264
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
265
-     * } $params
266
-     *
267
-     * @throws MissingParameterException if a required parameter is missing
268
-     * @throws NoNodeAvailableException if all the hosts are offline
269
-     * @throws ClientResponseException if the status code of response is 4xx
270
-     * @throws ServerResponseException if the status code of response is 5xx
271
-     *
272
-     * @return Elasticsearch|Promise
273
-     */
274
-    public function clearCachedPrivileges(array $params = [])
275
-    {
276
-        $this->checkRequiredParameters(['application'], $params);
277
-        $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache';
278
-        $method = 'POST';
279
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
280
-        $headers = ['Accept' => 'application/json'];
281
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
282
-        $request = $this->addOtelAttributes($params, ['application'], $request, 'security.clear_cached_privileges');
283
-        return $this->client->sendRequest($request);
284
-    }
285
-    /**
286
-     * Evicts users from the user cache. Can completely clear the cache or evict specific users.
287
-     *
288
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html
289
-     *
290
-     * @param array{
291
-     *     realms: list, // (REQUIRED) Comma-separated list of realms to clear
292
-     *     usernames: list, // Comma-separated list of usernames to clear from the cache
293
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
294
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
295
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
296
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
297
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
298
-     * } $params
299
-     *
300
-     * @throws MissingParameterException if a required parameter is missing
301
-     * @throws NoNodeAvailableException if all the hosts are offline
302
-     * @throws ClientResponseException if the status code of response is 4xx
303
-     * @throws ServerResponseException if the status code of response is 5xx
304
-     *
305
-     * @return Elasticsearch|Promise
306
-     */
307
-    public function clearCachedRealms(array $params = [])
308
-    {
309
-        $this->checkRequiredParameters(['realms'], $params);
310
-        $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache';
311
-        $method = 'POST';
312
-        $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
313
-        $headers = ['Accept' => 'application/json'];
314
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
315
-        $request = $this->addOtelAttributes($params, ['realms'], $request, 'security.clear_cached_realms');
316
-        return $this->client->sendRequest($request);
317
-    }
318
-    /**
319
-     * Evicts roles from the native role cache.
320
-     *
321
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html
322
-     *
323
-     * @param array{
324
-     *     name: list, // (REQUIRED) Role name
325
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
326
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
327
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
328
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
329
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
330
-     * } $params
331
-     *
332
-     * @throws MissingParameterException if a required parameter is missing
333
-     * @throws NoNodeAvailableException if all the hosts are offline
334
-     * @throws ClientResponseException if the status code of response is 4xx
335
-     * @throws ServerResponseException if the status code of response is 5xx
336
-     *
337
-     * @return Elasticsearch|Promise
338
-     */
339
-    public function clearCachedRoles(array $params = [])
340
-    {
341
-        $this->checkRequiredParameters(['name'], $params);
342
-        $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache';
343
-        $method = 'POST';
344
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
345
-        $headers = ['Accept' => 'application/json'];
346
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
347
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.clear_cached_roles');
348
-        return $this->client->sendRequest($request);
349
-    }
350
-    /**
351
-     * Evicts tokens from the service account token caches.
352
-     *
353
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html
354
-     *
355
-     * @param array{
356
-     *     namespace: string, // (REQUIRED) An identifier for the namespace
357
-     *     service: string, // (REQUIRED) An identifier for the service name
358
-     *     name: list, // (REQUIRED) A comma-separated list of service token names
359
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
360
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
361
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
362
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
363
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
364
-     * } $params
365
-     *
366
-     * @throws MissingParameterException if a required parameter is missing
367
-     * @throws NoNodeAvailableException if all the hosts are offline
368
-     * @throws ClientResponseException if the status code of response is 4xx
369
-     * @throws ServerResponseException if the status code of response is 5xx
370
-     *
371
-     * @return Elasticsearch|Promise
372
-     */
373
-    public function clearCachedServiceTokens(array $params = [])
374
-    {
375
-        $this->checkRequiredParameters(['namespace', 'service', 'name'], $params);
376
-        $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache';
377
-        $method = 'POST';
378
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
379
-        $headers = ['Accept' => 'application/json'];
380
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
381
-        $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.clear_cached_service_tokens');
382
-        return $this->client->sendRequest($request);
383
-    }
384
-    /**
385
-     * Creates an API key for access without requiring basic authentication.
386
-     *
387
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
388
-     *
389
-     * @param array{
390
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
391
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
392
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
393
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
394
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
395
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
396
-     *     body: array, // (REQUIRED) The api key request to create an API key
397
-     * } $params
398
-     *
399
-     * @throws NoNodeAvailableException if all the hosts are offline
400
-     * @throws ClientResponseException if the status code of response is 4xx
401
-     * @throws ServerResponseException if the status code of response is 5xx
402
-     *
403
-     * @return Elasticsearch|Promise
404
-     */
405
-    public function createApiKey(array $params = [])
406
-    {
407
-        $this->checkRequiredParameters(['body'], $params);
408
-        $url = '/_security/api_key';
409
-        $method = 'PUT';
410
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
411
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
412
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
413
-        $request = $this->addOtelAttributes($params, [], $request, 'security.create_api_key');
414
-        return $this->client->sendRequest($request);
415
-    }
416
-    /**
417
-     * Creates a cross-cluster API key for API key based remote cluster access.
418
-     *
419
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html
420
-     *
421
-     * @param array{
422
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
423
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
424
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
425
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
426
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
427
-     *     body: array, // (REQUIRED) The request to create a cross-cluster API key
428
-     * } $params
429
-     *
430
-     * @throws NoNodeAvailableException if all the hosts are offline
431
-     * @throws ClientResponseException if the status code of response is 4xx
432
-     * @throws ServerResponseException if the status code of response is 5xx
433
-     *
434
-     * @return Elasticsearch|Promise
435
-     */
436
-    public function createCrossClusterApiKey(array $params = [])
437
-    {
438
-        $this->checkRequiredParameters(['body'], $params);
439
-        $url = '/_security/cross_cluster/api_key';
440
-        $method = 'POST';
441
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
442
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
443
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
444
-        $request = $this->addOtelAttributes($params, [], $request, 'security.create_cross_cluster_api_key');
445
-        return $this->client->sendRequest($request);
446
-    }
447
-    /**
448
-     * Creates a service account token for access without requiring basic authentication.
449
-     *
450
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html
451
-     *
452
-     * @param array{
453
-     *     namespace: string, // (REQUIRED) An identifier for the namespace
454
-     *     service: string, // (REQUIRED) An identifier for the service name
455
-     *     name: string, //  An identifier for the token name
456
-     *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
457
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
458
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
459
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
460
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
461
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
462
-     * } $params
463
-     *
464
-     * @throws MissingParameterException if a required parameter is missing
465
-     * @throws NoNodeAvailableException if all the hosts are offline
466
-     * @throws ClientResponseException if the status code of response is 4xx
467
-     * @throws ServerResponseException if the status code of response is 5xx
468
-     *
469
-     * @return Elasticsearch|Promise
470
-     */
471
-    public function createServiceToken(array $params = [])
472
-    {
473
-        $this->checkRequiredParameters(['namespace', 'service'], $params);
474
-        if (isset($params['name'])) {
475
-            $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']);
476
-            $method = 'PUT';
477
-        } else {
478
-            $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token';
479
-            $method = 'POST';
480
-        }
481
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
482
-        $headers = ['Accept' => 'application/json'];
483
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
484
-        $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.create_service_token');
485
-        return $this->client->sendRequest($request);
486
-    }
487
-    /**
488
-     * Removes application privileges.
489
-     *
490
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html
491
-     *
492
-     * @param array{
493
-     *     application: string, // (REQUIRED) Application name
494
-     *     name: string, // (REQUIRED) Privilege name
495
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
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 MissingParameterException if a required parameter is missing
504
-     * @throws NoNodeAvailableException if all the hosts are offline
505
-     * @throws ClientResponseException if the status code of response is 4xx
506
-     * @throws ServerResponseException if the status code of response is 5xx
507
-     *
508
-     * @return Elasticsearch|Promise
509
-     */
510
-    public function deletePrivileges(array $params = [])
511
-    {
512
-        $this->checkRequiredParameters(['application', 'name'], $params);
513
-        $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']);
514
-        $method = 'DELETE';
515
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
516
-        $headers = ['Accept' => 'application/json'];
517
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
518
-        $request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.delete_privileges');
519
-        return $this->client->sendRequest($request);
520
-    }
521
-    /**
522
-     * Removes roles in the native realm.
523
-     *
524
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html
525
-     *
526
-     * @param array{
527
-     *     name: string, // (REQUIRED) Role name
528
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
529
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
530
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
531
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
532
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
533
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
534
-     * } $params
535
-     *
536
-     * @throws MissingParameterException if a required parameter is missing
537
-     * @throws NoNodeAvailableException if all the hosts are offline
538
-     * @throws ClientResponseException if the status code of response is 4xx
539
-     * @throws ServerResponseException if the status code of response is 5xx
540
-     *
541
-     * @return Elasticsearch|Promise
542
-     */
543
-    public function deleteRole(array $params = [])
544
-    {
545
-        $this->checkRequiredParameters(['name'], $params);
546
-        $url = '/_security/role/' . $this->encode($params['name']);
547
-        $method = 'DELETE';
548
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
549
-        $headers = ['Accept' => 'application/json'];
550
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
551
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role');
552
-        return $this->client->sendRequest($request);
553
-    }
554
-    /**
555
-     * Removes role mappings.
556
-     *
557
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html
558
-     *
559
-     * @param array{
560
-     *     name: string, // (REQUIRED) Role-mapping name
561
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
562
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
563
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
564
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
565
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
566
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
567
-     * } $params
568
-     *
569
-     * @throws MissingParameterException if a required parameter is missing
570
-     * @throws NoNodeAvailableException if all the hosts are offline
571
-     * @throws ClientResponseException if the status code of response is 4xx
572
-     * @throws ServerResponseException if the status code of response is 5xx
573
-     *
574
-     * @return Elasticsearch|Promise
575
-     */
576
-    public function deleteRoleMapping(array $params = [])
577
-    {
578
-        $this->checkRequiredParameters(['name'], $params);
579
-        $url = '/_security/role_mapping/' . $this->encode($params['name']);
580
-        $method = 'DELETE';
581
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
582
-        $headers = ['Accept' => 'application/json'];
583
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
584
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role_mapping');
585
-        return $this->client->sendRequest($request);
586
-    }
587
-    /**
588
-     * Deletes a service account token.
589
-     *
590
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html
591
-     *
592
-     * @param array{
593
-     *     namespace: string, // (REQUIRED) An identifier for the namespace
594
-     *     service: string, // (REQUIRED) An identifier for the service name
595
-     *     name: string, // (REQUIRED) An identifier for the token name
596
-     *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
597
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
598
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
599
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
600
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
601
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
602
-     * } $params
603
-     *
604
-     * @throws MissingParameterException if a required parameter is missing
605
-     * @throws NoNodeAvailableException if all the hosts are offline
606
-     * @throws ClientResponseException if the status code of response is 4xx
607
-     * @throws ServerResponseException if the status code of response is 5xx
608
-     *
609
-     * @return Elasticsearch|Promise
610
-     */
611
-    public function deleteServiceToken(array $params = [])
612
-    {
613
-        $this->checkRequiredParameters(['namespace', 'service', 'name'], $params);
614
-        $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']);
615
-        $method = 'DELETE';
616
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
617
-        $headers = ['Accept' => 'application/json'];
618
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
619
-        $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.delete_service_token');
620
-        return $this->client->sendRequest($request);
621
-    }
622
-    /**
623
-     * Deletes users from the native realm.
624
-     *
625
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html
626
-     *
627
-     * @param array{
628
-     *     username: string, // (REQUIRED) username
629
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
630
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
631
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
632
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
633
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
634
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
635
-     * } $params
636
-     *
637
-     * @throws MissingParameterException if a required parameter is missing
638
-     * @throws NoNodeAvailableException if all the hosts are offline
639
-     * @throws ClientResponseException if the status code of response is 4xx
640
-     * @throws ServerResponseException if the status code of response is 5xx
641
-     *
642
-     * @return Elasticsearch|Promise
643
-     */
644
-    public function deleteUser(array $params = [])
645
-    {
646
-        $this->checkRequiredParameters(['username'], $params);
647
-        $url = '/_security/user/' . $this->encode($params['username']);
648
-        $method = 'DELETE';
649
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
650
-        $headers = ['Accept' => 'application/json'];
651
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
652
-        $request = $this->addOtelAttributes($params, ['username'], $request, 'security.delete_user');
653
-        return $this->client->sendRequest($request);
654
-    }
655
-    /**
656
-     * Disables users in the native realm.
657
-     *
658
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html
659
-     *
660
-     * @param array{
661
-     *     username: string, // (REQUIRED) The username of the user to disable
662
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
663
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
664
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
665
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
666
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
667
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
668
-     * } $params
669
-     *
670
-     * @throws MissingParameterException if a required parameter is missing
671
-     * @throws NoNodeAvailableException if all the hosts are offline
672
-     * @throws ClientResponseException if the status code of response is 4xx
673
-     * @throws ServerResponseException if the status code of response is 5xx
674
-     *
675
-     * @return Elasticsearch|Promise
676
-     */
677
-    public function disableUser(array $params = [])
678
-    {
679
-        $this->checkRequiredParameters(['username'], $params);
680
-        $url = '/_security/user/' . $this->encode($params['username']) . '/_disable';
681
-        $method = 'PUT';
682
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
683
-        $headers = ['Accept' => 'application/json'];
684
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
685
-        $request = $this->addOtelAttributes($params, ['username'], $request, 'security.disable_user');
686
-        return $this->client->sendRequest($request);
687
-    }
688
-    /**
689
-     * Disables a user profile so it's not visible in user profile searches.
690
-     *
691
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html
692
-     *
693
-     * @param array{
694
-     *     uid: string, // (REQUIRED) Unique identifier for the user profile
695
-     *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
696
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
697
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
698
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
699
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
700
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
701
-     * } $params
702
-     *
703
-     * @throws MissingParameterException if a required parameter is missing
704
-     * @throws NoNodeAvailableException if all the hosts are offline
705
-     * @throws ClientResponseException if the status code of response is 4xx
706
-     * @throws ServerResponseException if the status code of response is 5xx
707
-     *
708
-     * @return Elasticsearch|Promise
709
-     */
710
-    public function disableUserProfile(array $params = [])
711
-    {
712
-        $this->checkRequiredParameters(['uid'], $params);
713
-        $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable';
714
-        $method = 'PUT';
715
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
716
-        $headers = ['Accept' => 'application/json'];
717
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
718
-        $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.disable_user_profile');
719
-        return $this->client->sendRequest($request);
720
-    }
721
-    /**
722
-     * Enables users in the native realm.
723
-     *
724
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html
725
-     *
726
-     * @param array{
727
-     *     username: string, // (REQUIRED) The username of the user to enable
728
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
729
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
730
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
731
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
732
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
733
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
734
-     * } $params
735
-     *
736
-     * @throws MissingParameterException if a required parameter is missing
737
-     * @throws NoNodeAvailableException if all the hosts are offline
738
-     * @throws ClientResponseException if the status code of response is 4xx
739
-     * @throws ServerResponseException if the status code of response is 5xx
740
-     *
741
-     * @return Elasticsearch|Promise
742
-     */
743
-    public function enableUser(array $params = [])
744
-    {
745
-        $this->checkRequiredParameters(['username'], $params);
746
-        $url = '/_security/user/' . $this->encode($params['username']) . '/_enable';
747
-        $method = 'PUT';
748
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
749
-        $headers = ['Accept' => 'application/json'];
750
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
751
-        $request = $this->addOtelAttributes($params, ['username'], $request, 'security.enable_user');
752
-        return $this->client->sendRequest($request);
753
-    }
754
-    /**
755
-     * Enables a user profile so it's visible in user profile searches.
756
-     *
757
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html
758
-     *
759
-     * @param array{
760
-     *     uid: string, // (REQUIRED) An unique identifier of the user profile
761
-     *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
762
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
763
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
764
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
765
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
766
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
767
-     * } $params
768
-     *
769
-     * @throws MissingParameterException if a required parameter is missing
770
-     * @throws NoNodeAvailableException if all the hosts are offline
771
-     * @throws ClientResponseException if the status code of response is 4xx
772
-     * @throws ServerResponseException if the status code of response is 5xx
773
-     *
774
-     * @return Elasticsearch|Promise
775
-     */
776
-    public function enableUserProfile(array $params = [])
777
-    {
778
-        $this->checkRequiredParameters(['uid'], $params);
779
-        $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable';
780
-        $method = 'PUT';
781
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
782
-        $headers = ['Accept' => 'application/json'];
783
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
784
-        $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.enable_user_profile');
785
-        return $this->client->sendRequest($request);
786
-    }
787
-    /**
788
-     * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster.
789
-     *
790
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html
791
-     *
792
-     * @param array{
793
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
794
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
795
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
796
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
797
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
798
-     * } $params
799
-     *
800
-     * @throws NoNodeAvailableException if all the hosts are offline
801
-     * @throws ClientResponseException if the status code of response is 4xx
802
-     * @throws ServerResponseException if the status code of response is 5xx
803
-     *
804
-     * @return Elasticsearch|Promise
805
-     */
806
-    public function enrollKibana(array $params = [])
807
-    {
808
-        $url = '/_security/enroll/kibana';
809
-        $method = 'GET';
810
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
811
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
812
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
813
-        $request = $this->addOtelAttributes($params, [], $request, 'security.enroll_kibana');
814
-        return $this->client->sendRequest($request);
815
-    }
816
-    /**
817
-     * Allows a new node to enroll to an existing cluster with security enabled.
818
-     *
819
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html
820
-     *
821
-     * @param array{
822
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
823
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
824
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
825
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
826
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
827
-     * } $params
828
-     *
829
-     * @throws NoNodeAvailableException if all the hosts are offline
830
-     * @throws ClientResponseException if the status code of response is 4xx
831
-     * @throws ServerResponseException if the status code of response is 5xx
832
-     *
833
-     * @return Elasticsearch|Promise
834
-     */
835
-    public function enrollNode(array $params = [])
836
-    {
837
-        $url = '/_security/enroll/node';
838
-        $method = 'GET';
839
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
840
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
841
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
842
-        $request = $this->addOtelAttributes($params, [], $request, 'security.enroll_node');
843
-        return $this->client->sendRequest($request);
844
-    }
845
-    /**
846
-     * Retrieves information for one or more API keys.
847
-     *
848
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html
849
-     *
850
-     * @param array{
851
-     *     id: string, // API key id of the API key to be retrieved
852
-     *     name: string, // API key name of the API key to be retrieved
853
-     *     username: string, // user name of the user who created this API key to be retrieved
854
-     *     realm_name: string, // realm name of the user who created this API key to be retrieved
855
-     *     owner: boolean, // flag to query API keys owned by the currently authenticated user
856
-     *     with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
857
-     *     with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists
858
-     *     active_only: boolean, // flag to limit response to only active (not invalidated or expired) API keys
859
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
860
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
861
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
862
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
863
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
864
-     * } $params
865
-     *
866
-     * @throws NoNodeAvailableException if all the hosts are offline
867
-     * @throws ClientResponseException if the status code of response is 4xx
868
-     * @throws ServerResponseException if the status code of response is 5xx
869
-     *
870
-     * @return Elasticsearch|Promise
871
-     */
872
-    public function getApiKey(array $params = [])
873
-    {
874
-        $url = '/_security/api_key';
875
-        $method = 'GET';
876
-        $url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'with_profile_uid', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
877
-        $headers = ['Accept' => 'application/json'];
878
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
879
-        $request = $this->addOtelAttributes($params, [], $request, 'security.get_api_key');
880
-        return $this->client->sendRequest($request);
881
-    }
882
-    /**
883
-     * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.
884
-     *
885
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html
886
-     *
887
-     * @param array{
888
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
889
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
890
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
891
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
892
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
893
-     * } $params
894
-     *
895
-     * @throws NoNodeAvailableException if all the hosts are offline
896
-     * @throws ClientResponseException if the status code of response is 4xx
897
-     * @throws ServerResponseException if the status code of response is 5xx
898
-     *
899
-     * @return Elasticsearch|Promise
900
-     */
901
-    public function getBuiltinPrivileges(array $params = [])
902
-    {
903
-        $url = '/_security/privilege/_builtin';
904
-        $method = 'GET';
905
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
906
-        $headers = ['Accept' => 'application/json'];
907
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
908
-        $request = $this->addOtelAttributes($params, [], $request, 'security.get_builtin_privileges');
909
-        return $this->client->sendRequest($request);
910
-    }
911
-    /**
912
-     * Retrieves application privileges.
913
-     *
914
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html
915
-     *
916
-     * @param array{
917
-     *     application: string, //  Application name
918
-     *     name: string, //  Privilege name
919
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
920
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
921
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
922
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
923
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
924
-     * } $params
925
-     *
926
-     * @throws NoNodeAvailableException if all the hosts are offline
927
-     * @throws ClientResponseException if the status code of response is 4xx
928
-     * @throws ServerResponseException if the status code of response is 5xx
929
-     *
930
-     * @return Elasticsearch|Promise
931
-     */
932
-    public function getPrivileges(array $params = [])
933
-    {
934
-        if (isset($params['application']) && isset($params['name'])) {
935
-            $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']);
936
-            $method = 'GET';
937
-        } elseif (isset($params['application'])) {
938
-            $url = '/_security/privilege/' . $this->encode($params['application']);
939
-            $method = 'GET';
940
-        } else {
941
-            $url = '/_security/privilege';
942
-            $method = 'GET';
943
-        }
944
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
945
-        $headers = ['Accept' => 'application/json'];
946
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
947
-        $request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.get_privileges');
948
-        return $this->client->sendRequest($request);
949
-    }
950
-    /**
951
-     * Retrieves roles in the native realm.
952
-     *
953
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html
954
-     *
955
-     * @param array{
956
-     *     name: list, //  A comma-separated list of role names
957
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
958
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
959
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
960
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
961
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
962
-     * } $params
963
-     *
964
-     * @throws NoNodeAvailableException if all the hosts are offline
965
-     * @throws ClientResponseException if the status code of response is 4xx
966
-     * @throws ServerResponseException if the status code of response is 5xx
967
-     *
968
-     * @return Elasticsearch|Promise
969
-     */
970
-    public function getRole(array $params = [])
971
-    {
972
-        if (isset($params['name'])) {
973
-            $url = '/_security/role/' . $this->encode($params['name']);
974
-            $method = 'GET';
975
-        } else {
976
-            $url = '/_security/role';
977
-            $method = 'GET';
978
-        }
979
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
980
-        $headers = ['Accept' => 'application/json'];
981
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
982
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role');
983
-        return $this->client->sendRequest($request);
984
-    }
985
-    /**
986
-     * Retrieves role mappings.
987
-     *
988
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html
989
-     *
990
-     * @param array{
991
-     *     name: list, //  A comma-separated list of role-mapping names
992
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
993
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
994
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
995
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
996
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
997
-     * } $params
998
-     *
999
-     * @throws NoNodeAvailableException if all the hosts are offline
1000
-     * @throws ClientResponseException if the status code of response is 4xx
1001
-     * @throws ServerResponseException if the status code of response is 5xx
1002
-     *
1003
-     * @return Elasticsearch|Promise
1004
-     */
1005
-    public function getRoleMapping(array $params = [])
1006
-    {
1007
-        if (isset($params['name'])) {
1008
-            $url = '/_security/role_mapping/' . $this->encode($params['name']);
1009
-            $method = 'GET';
1010
-        } else {
1011
-            $url = '/_security/role_mapping';
1012
-            $method = 'GET';
1013
-        }
1014
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1015
-        $headers = ['Accept' => 'application/json'];
1016
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1017
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role_mapping');
1018
-        return $this->client->sendRequest($request);
1019
-    }
1020
-    /**
1021
-     * Retrieves information about service accounts.
1022
-     *
1023
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html
1024
-     *
1025
-     * @param array{
1026
-     *     namespace: string, //  An identifier for the namespace
1027
-     *     service: string, //  An identifier for the service name
1028
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1029
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1030
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1031
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1032
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1033
-     * } $params
1034
-     *
1035
-     * @throws NoNodeAvailableException if all the hosts are offline
1036
-     * @throws ClientResponseException if the status code of response is 4xx
1037
-     * @throws ServerResponseException if the status code of response is 5xx
1038
-     *
1039
-     * @return Elasticsearch|Promise
1040
-     */
1041
-    public function getServiceAccounts(array $params = [])
1042
-    {
1043
-        if (isset($params['namespace']) && isset($params['service'])) {
1044
-            $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']);
1045
-            $method = 'GET';
1046
-        } elseif (isset($params['namespace'])) {
1047
-            $url = '/_security/service/' . $this->encode($params['namespace']);
1048
-            $method = 'GET';
1049
-        } else {
1050
-            $url = '/_security/service';
1051
-            $method = 'GET';
1052
-        }
1053
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1054
-        $headers = ['Accept' => 'application/json'];
1055
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1056
-        $request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_accounts');
1057
-        return $this->client->sendRequest($request);
1058
-    }
1059
-    /**
1060
-     * Retrieves information of all service credentials for a service account.
1061
-     *
1062
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html
1063
-     *
1064
-     * @param array{
1065
-     *     namespace: string, // (REQUIRED) An identifier for the namespace
1066
-     *     service: string, // (REQUIRED) An identifier for the service name
1067
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1068
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1069
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1070
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1071
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1072
-     * } $params
1073
-     *
1074
-     * @throws MissingParameterException if a required parameter is missing
1075
-     * @throws NoNodeAvailableException if all the hosts are offline
1076
-     * @throws ClientResponseException if the status code of response is 4xx
1077
-     * @throws ServerResponseException if the status code of response is 5xx
1078
-     *
1079
-     * @return Elasticsearch|Promise
1080
-     */
1081
-    public function getServiceCredentials(array $params = [])
1082
-    {
1083
-        $this->checkRequiredParameters(['namespace', 'service'], $params);
1084
-        $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential';
1085
-        $method = 'GET';
1086
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1087
-        $headers = ['Accept' => 'application/json'];
1088
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1089
-        $request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_credentials');
1090
-        return $this->client->sendRequest($request);
1091
-    }
1092
-    /**
1093
-     * Retrieve settings for the security system indices
1094
-     *
1095
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html
1096
-     *
1097
-     * @param array{
1098
-     *     master_timeout: time, // Timeout for connection to master
1099
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1100
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1101
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1102
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1103
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1104
-     * } $params
1105
-     *
1106
-     * @throws NoNodeAvailableException if all the hosts are offline
1107
-     * @throws ClientResponseException if the status code of response is 4xx
1108
-     * @throws ServerResponseException if the status code of response is 5xx
1109
-     *
1110
-     * @return Elasticsearch|Promise
1111
-     */
1112
-    public function getSettings(array $params = [])
1113
-    {
1114
-        $url = '/_security/settings';
1115
-        $method = 'GET';
1116
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1117
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1118
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1119
-        $request = $this->addOtelAttributes($params, [], $request, 'security.get_settings');
1120
-        return $this->client->sendRequest($request);
1121
-    }
1122
-    /**
1123
-     * Creates a bearer token for access without requiring basic authentication.
1124
-     *
1125
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html
1126
-     *
1127
-     * @param array{
1128
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1129
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1130
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1131
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1132
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1133
-     *     body: array, // (REQUIRED) The token request to get
1134
-     * } $params
1135
-     *
1136
-     * @throws NoNodeAvailableException if all the hosts are offline
1137
-     * @throws ClientResponseException if the status code of response is 4xx
1138
-     * @throws ServerResponseException if the status code of response is 5xx
1139
-     *
1140
-     * @return Elasticsearch|Promise
1141
-     */
1142
-    public function getToken(array $params = [])
1143
-    {
1144
-        $this->checkRequiredParameters(['body'], $params);
1145
-        $url = '/_security/oauth2/token';
1146
-        $method = 'POST';
1147
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1148
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1149
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1150
-        $request = $this->addOtelAttributes($params, [], $request, 'security.get_token');
1151
-        return $this->client->sendRequest($request);
1152
-    }
1153
-    /**
1154
-     * Retrieves information about users in the native realm and built-in users.
1155
-     *
1156
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html
1157
-     *
1158
-     * @param array{
1159
-     *     username: list, //  A comma-separated list of usernames
1160
-     *     with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user
1161
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1162
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1163
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1164
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1165
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1166
-     * } $params
1167
-     *
1168
-     * @throws NoNodeAvailableException if all the hosts are offline
1169
-     * @throws ClientResponseException if the status code of response is 4xx
1170
-     * @throws ServerResponseException if the status code of response is 5xx
1171
-     *
1172
-     * @return Elasticsearch|Promise
1173
-     */
1174
-    public function getUser(array $params = [])
1175
-    {
1176
-        if (isset($params['username'])) {
1177
-            $url = '/_security/user/' . $this->encode($params['username']);
1178
-            $method = 'GET';
1179
-        } else {
1180
-            $url = '/_security/user';
1181
-            $method = 'GET';
1182
-        }
1183
-        $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1184
-        $headers = ['Accept' => 'application/json'];
1185
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1186
-        $request = $this->addOtelAttributes($params, ['username'], $request, 'security.get_user');
1187
-        return $this->client->sendRequest($request);
1188
-    }
1189
-    /**
1190
-     * Retrieves security privileges for the logged in user.
1191
-     *
1192
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html
1193
-     *
1194
-     * @param array{
1195
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1196
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1197
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1198
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1199
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1200
-     * } $params
1201
-     *
1202
-     * @throws NoNodeAvailableException if all the hosts are offline
1203
-     * @throws ClientResponseException if the status code of response is 4xx
1204
-     * @throws ServerResponseException if the status code of response is 5xx
1205
-     *
1206
-     * @return Elasticsearch|Promise
1207
-     */
1208
-    public function getUserPrivileges(array $params = [])
1209
-    {
1210
-        $url = '/_security/user/_privileges';
1211
-        $method = 'GET';
1212
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1213
-        $headers = ['Accept' => 'application/json'];
1214
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1215
-        $request = $this->addOtelAttributes($params, [], $request, 'security.get_user_privileges');
1216
-        return $this->client->sendRequest($request);
1217
-    }
1218
-    /**
1219
-     * Retrieves user profiles for the given unique ID(s).
1220
-     *
1221
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html
1222
-     *
1223
-     * @param array{
1224
-     *     uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles
1225
-     *     data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
1226
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1227
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1228
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1229
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1230
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1231
-     * } $params
1232
-     *
1233
-     * @throws MissingParameterException if a required parameter is missing
1234
-     * @throws NoNodeAvailableException if all the hosts are offline
1235
-     * @throws ClientResponseException if the status code of response is 4xx
1236
-     * @throws ServerResponseException if the status code of response is 5xx
1237
-     *
1238
-     * @return Elasticsearch|Promise
1239
-     */
1240
-    public function getUserProfile(array $params = [])
1241
-    {
1242
-        $this->checkRequiredParameters(['uid'], $params);
1243
-        $url = '/_security/profile/' . $this->encode($params['uid']);
1244
-        $method = 'GET';
1245
-        $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1246
-        $headers = ['Accept' => 'application/json'];
1247
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1248
-        $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.get_user_profile');
1249
-        return $this->client->sendRequest($request);
1250
-    }
1251
-    /**
1252
-     * Creates an API key on behalf of another user.
1253
-     *
1254
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html
1255
-     *
1256
-     * @param array{
1257
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1258
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1259
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1260
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1261
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1262
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1263
-     *     body: array, // (REQUIRED) The api key request to create an API key
1264
-     * } $params
1265
-     *
1266
-     * @throws NoNodeAvailableException if all the hosts are offline
1267
-     * @throws ClientResponseException if the status code of response is 4xx
1268
-     * @throws ServerResponseException if the status code of response is 5xx
1269
-     *
1270
-     * @return Elasticsearch|Promise
1271
-     */
1272
-    public function grantApiKey(array $params = [])
1273
-    {
1274
-        $this->checkRequiredParameters(['body'], $params);
1275
-        $url = '/_security/api_key/grant';
1276
-        $method = 'POST';
1277
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1278
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1279
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1280
-        $request = $this->addOtelAttributes($params, [], $request, 'security.grant_api_key');
1281
-        return $this->client->sendRequest($request);
1282
-    }
1283
-    /**
1284
-     * Determines whether the specified user has a specified list of privileges.
1285
-     *
1286
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html
1287
-     *
1288
-     * @param array{
1289
-     *     user: string, //  Username
1290
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1291
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1292
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1293
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1294
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1295
-     *     body: array, // (REQUIRED) The privileges to test
1296
-     * } $params
1297
-     *
1298
-     * @throws NoNodeAvailableException if all the hosts are offline
1299
-     * @throws ClientResponseException if the status code of response is 4xx
1300
-     * @throws ServerResponseException if the status code of response is 5xx
1301
-     *
1302
-     * @return Elasticsearch|Promise
1303
-     */
1304
-    public function hasPrivileges(array $params = [])
1305
-    {
1306
-        $this->checkRequiredParameters(['body'], $params);
1307
-        if (isset($params['user'])) {
1308
-            $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges';
1309
-            $method = empty($params['body']) ? 'GET' : 'POST';
1310
-        } else {
1311
-            $url = '/_security/user/_has_privileges';
1312
-            $method = empty($params['body']) ? 'GET' : 'POST';
1313
-        }
1314
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1315
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1316
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1317
-        $request = $this->addOtelAttributes($params, ['user'], $request, 'security.has_privileges');
1318
-        return $this->client->sendRequest($request);
1319
-    }
1320
-    /**
1321
-     * Determines whether the users associated with the specified profile IDs have all the requested privileges.
1322
-     *
1323
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html
1324
-     *
1325
-     * @param array{
1326
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1327
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1328
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1329
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1330
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1331
-     *     body: array, // (REQUIRED) The privileges to check and the list of profile IDs
1332
-     * } $params
1333
-     *
1334
-     * @throws NoNodeAvailableException if all the hosts are offline
1335
-     * @throws ClientResponseException if the status code of response is 4xx
1336
-     * @throws ServerResponseException if the status code of response is 5xx
1337
-     *
1338
-     * @return Elasticsearch|Promise
1339
-     */
1340
-    public function hasPrivilegesUserProfile(array $params = [])
1341
-    {
1342
-        $this->checkRequiredParameters(['body'], $params);
1343
-        $url = '/_security/profile/_has_privileges';
1344
-        $method = empty($params['body']) ? 'GET' : 'POST';
1345
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1346
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1347
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1348
-        $request = $this->addOtelAttributes($params, [], $request, 'security.has_privileges_user_profile');
1349
-        return $this->client->sendRequest($request);
1350
-    }
1351
-    /**
1352
-     * Invalidates one or more API keys.
1353
-     *
1354
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html
1355
-     *
1356
-     * @param array{
1357
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1358
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1359
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1360
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1361
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1362
-     *     body: array, // (REQUIRED) The api key request to invalidate API key(s)
1363
-     * } $params
1364
-     *
1365
-     * @throws NoNodeAvailableException if all the hosts are offline
1366
-     * @throws ClientResponseException if the status code of response is 4xx
1367
-     * @throws ServerResponseException if the status code of response is 5xx
1368
-     *
1369
-     * @return Elasticsearch|Promise
1370
-     */
1371
-    public function invalidateApiKey(array $params = [])
1372
-    {
1373
-        $this->checkRequiredParameters(['body'], $params);
1374
-        $url = '/_security/api_key';
1375
-        $method = 'DELETE';
1376
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1377
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1378
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1379
-        $request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_api_key');
1380
-        return $this->client->sendRequest($request);
1381
-    }
1382
-    /**
1383
-     * Invalidates one or more access tokens or refresh tokens.
1384
-     *
1385
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html
1386
-     *
1387
-     * @param array{
1388
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1389
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1390
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1391
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1392
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1393
-     *     body: array, // (REQUIRED) The token to invalidate
1394
-     * } $params
1395
-     *
1396
-     * @throws NoNodeAvailableException if all the hosts are offline
1397
-     * @throws ClientResponseException if the status code of response is 4xx
1398
-     * @throws ServerResponseException if the status code of response is 5xx
1399
-     *
1400
-     * @return Elasticsearch|Promise
1401
-     */
1402
-    public function invalidateToken(array $params = [])
1403
-    {
1404
-        $this->checkRequiredParameters(['body'], $params);
1405
-        $url = '/_security/oauth2/token';
1406
-        $method = 'DELETE';
1407
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1408
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1409
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1410
-        $request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_token');
1411
-        return $this->client->sendRequest($request);
1412
-    }
1413
-    /**
1414
-     * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair
1415
-     *
1416
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html
1417
-     *
1418
-     * @param array{
1419
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1420
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1421
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1422
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1423
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1424
-     *     body: array, // (REQUIRED) The OpenID Connect response to authenticate
1425
-     * } $params
1426
-     *
1427
-     * @throws NoNodeAvailableException if all the hosts are offline
1428
-     * @throws ClientResponseException if the status code of response is 4xx
1429
-     * @throws ServerResponseException if the status code of response is 5xx
1430
-     *
1431
-     * @return Elasticsearch|Promise
1432
-     */
1433
-    public function oidcAuthenticate(array $params = [])
1434
-    {
1435
-        $this->checkRequiredParameters(['body'], $params);
1436
-        $url = '/_security/oidc/authenticate';
1437
-        $method = 'POST';
1438
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1439
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1440
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1441
-        $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_authenticate');
1442
-        return $this->client->sendRequest($request);
1443
-    }
1444
-    /**
1445
-     * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API
1446
-     *
1447
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html
1448
-     *
1449
-     * @param array{
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) Access token and refresh token to invalidate
1456
-     * } $params
1457
-     *
1458
-     * @throws NoNodeAvailableException if all the hosts are offline
1459
-     * @throws ClientResponseException if the status code of response is 4xx
1460
-     * @throws ServerResponseException if the status code of response is 5xx
1461
-     *
1462
-     * @return Elasticsearch|Promise
1463
-     */
1464
-    public function oidcLogout(array $params = [])
1465
-    {
1466
-        $this->checkRequiredParameters(['body'], $params);
1467
-        $url = '/_security/oidc/logout';
1468
-        $method = 'POST';
1469
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1470
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1471
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1472
-        $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_logout');
1473
-        return $this->client->sendRequest($request);
1474
-    }
1475
-    /**
1476
-     * Creates an OAuth 2.0 authentication request as a URL string
1477
-     *
1478
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html
1479
-     *
1480
-     * @param array{
1481
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1482
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1483
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1484
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1485
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1486
-     *     body: array, // (REQUIRED) The OpenID Connect authentication realm configuration
1487
-     * } $params
1488
-     *
1489
-     * @throws NoNodeAvailableException if all the hosts are offline
1490
-     * @throws ClientResponseException if the status code of response is 4xx
1491
-     * @throws ServerResponseException if the status code of response is 5xx
1492
-     *
1493
-     * @return Elasticsearch|Promise
1494
-     */
1495
-    public function oidcPrepareAuthentication(array $params = [])
1496
-    {
1497
-        $this->checkRequiredParameters(['body'], $params);
1498
-        $url = '/_security/oidc/prepare';
1499
-        $method = 'POST';
1500
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1501
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1502
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1503
-        $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_prepare_authentication');
1504
-        return $this->client->sendRequest($request);
1505
-    }
1506
-    /**
1507
-     * Adds or updates application privileges.
1508
-     *
1509
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html
1510
-     *
1511
-     * @param array{
1512
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1513
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1514
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1515
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1516
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1517
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1518
-     *     body: array, // (REQUIRED) The privilege(s) to add
1519
-     * } $params
1520
-     *
1521
-     * @throws NoNodeAvailableException if all the hosts are offline
1522
-     * @throws ClientResponseException if the status code of response is 4xx
1523
-     * @throws ServerResponseException if the status code of response is 5xx
1524
-     *
1525
-     * @return Elasticsearch|Promise
1526
-     */
1527
-    public function putPrivileges(array $params = [])
1528
-    {
1529
-        $this->checkRequiredParameters(['body'], $params);
1530
-        $url = '/_security/privilege';
1531
-        $method = 'PUT';
1532
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1533
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1534
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1535
-        $request = $this->addOtelAttributes($params, [], $request, 'security.put_privileges');
1536
-        return $this->client->sendRequest($request);
1537
-    }
1538
-    /**
1539
-     * Adds and updates roles in the native realm.
1540
-     *
1541
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html
1542
-     *
1543
-     * @param array{
1544
-     *     name: string, // (REQUIRED) Role name
1545
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1546
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1547
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1548
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1549
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1550
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1551
-     *     body: array, // (REQUIRED) The role to add
1552
-     * } $params
1553
-     *
1554
-     * @throws MissingParameterException if a required parameter is missing
1555
-     * @throws NoNodeAvailableException if all the hosts are offline
1556
-     * @throws ClientResponseException if the status code of response is 4xx
1557
-     * @throws ServerResponseException if the status code of response is 5xx
1558
-     *
1559
-     * @return Elasticsearch|Promise
1560
-     */
1561
-    public function putRole(array $params = [])
1562
-    {
1563
-        $this->checkRequiredParameters(['name', 'body'], $params);
1564
-        $url = '/_security/role/' . $this->encode($params['name']);
1565
-        $method = 'PUT';
1566
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1567
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1568
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1569
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role');
1570
-        return $this->client->sendRequest($request);
1571
-    }
1572
-    /**
1573
-     * Creates and updates role mappings.
1574
-     *
1575
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html
1576
-     *
1577
-     * @param array{
1578
-     *     name: string, // (REQUIRED) Role-mapping name
1579
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1580
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1581
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1582
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1583
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1584
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1585
-     *     body: array, // (REQUIRED) The role mapping to add
1586
-     * } $params
1587
-     *
1588
-     * @throws MissingParameterException if a required parameter is missing
1589
-     * @throws NoNodeAvailableException if all the hosts are offline
1590
-     * @throws ClientResponseException if the status code of response is 4xx
1591
-     * @throws ServerResponseException if the status code of response is 5xx
1592
-     *
1593
-     * @return Elasticsearch|Promise
1594
-     */
1595
-    public function putRoleMapping(array $params = [])
1596
-    {
1597
-        $this->checkRequiredParameters(['name', 'body'], $params);
1598
-        $url = '/_security/role_mapping/' . $this->encode($params['name']);
1599
-        $method = 'PUT';
1600
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1601
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1602
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1603
-        $request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role_mapping');
1604
-        return $this->client->sendRequest($request);
1605
-    }
1606
-    /**
1607
-     * Adds and updates users in the native realm. These users are commonly referred to as native users.
1608
-     *
1609
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html
1610
-     *
1611
-     * @param array{
1612
-     *     username: string, // (REQUIRED) The username of the User
1613
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1614
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1615
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1616
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1617
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1618
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1619
-     *     body: array, // (REQUIRED) The user to add
1620
-     * } $params
1621
-     *
1622
-     * @throws MissingParameterException if a required parameter is missing
1623
-     * @throws NoNodeAvailableException if all the hosts are offline
1624
-     * @throws ClientResponseException if the status code of response is 4xx
1625
-     * @throws ServerResponseException if the status code of response is 5xx
1626
-     *
1627
-     * @return Elasticsearch|Promise
1628
-     */
1629
-    public function putUser(array $params = [])
1630
-    {
1631
-        $this->checkRequiredParameters(['username', 'body'], $params);
1632
-        $url = '/_security/user/' . $this->encode($params['username']);
1633
-        $method = 'PUT';
1634
-        $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1635
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1636
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1637
-        $request = $this->addOtelAttributes($params, ['username'], $request, 'security.put_user');
1638
-        return $this->client->sendRequest($request);
1639
-    }
1640
-    /**
1641
-     * Retrieves information for API keys using a subset of query DSL
1642
-     *
1643
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html
1644
-     *
1645
-     * @param array{
1646
-     *     with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
1647
-     *     with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists
1648
-     *     typed_keys: boolean, // flag to prefix aggregation names by their respective types in the response
1649
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1650
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1651
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1652
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1653
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1654
-     *     body: array, //  From, size, query, sort and search_after
1655
-     * } $params
1656
-     *
1657
-     * @throws NoNodeAvailableException if all the hosts are offline
1658
-     * @throws ClientResponseException if the status code of response is 4xx
1659
-     * @throws ServerResponseException if the status code of response is 5xx
1660
-     *
1661
-     * @return Elasticsearch|Promise
1662
-     */
1663
-    public function queryApiKeys(array $params = [])
1664
-    {
1665
-        $url = '/_security/_query/api_key';
1666
-        $method = empty($params['body']) ? 'GET' : 'POST';
1667
-        $url = $this->addQueryString($url, $params, ['with_limited_by', 'with_profile_uid', 'typed_keys', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1668
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1669
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1670
-        $request = $this->addOtelAttributes($params, [], $request, 'security.query_api_keys');
1671
-        return $this->client->sendRequest($request);
1672
-    }
1673
-    /**
1674
-     * Retrieves information for Roles using a subset of query DSL
1675
-     *
1676
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html
1677
-     *
1678
-     * @param array{
1679
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1680
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1681
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1682
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1683
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1684
-     *     body: array, //  From, size, query, sort and search_after
1685
-     * } $params
1686
-     *
1687
-     * @throws NoNodeAvailableException if all the hosts are offline
1688
-     * @throws ClientResponseException if the status code of response is 4xx
1689
-     * @throws ServerResponseException if the status code of response is 5xx
1690
-     *
1691
-     * @return Elasticsearch|Promise
1692
-     */
1693
-    public function queryRole(array $params = [])
1694
-    {
1695
-        $url = '/_security/_query/role';
1696
-        $method = empty($params['body']) ? 'GET' : 'POST';
1697
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1698
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1699
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1700
-        $request = $this->addOtelAttributes($params, [], $request, 'security.query_role');
1701
-        return $this->client->sendRequest($request);
1702
-    }
1703
-    /**
1704
-     * Retrieves information for Users using a subset of query DSL
1705
-     *
1706
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html
1707
-     *
1708
-     * @param array{
1709
-     *     with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated with the user
1710
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1711
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1712
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1713
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1714
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1715
-     *     body: array, //  From, size, query, sort and search_after
1716
-     * } $params
1717
-     *
1718
-     * @throws NoNodeAvailableException if all the hosts are offline
1719
-     * @throws ClientResponseException if the status code of response is 4xx
1720
-     * @throws ServerResponseException if the status code of response is 5xx
1721
-     *
1722
-     * @return Elasticsearch|Promise
1723
-     */
1724
-    public function queryUser(array $params = [])
1725
-    {
1726
-        $url = '/_security/_query/user';
1727
-        $method = empty($params['body']) ? 'GET' : 'POST';
1728
-        $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1729
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1730
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1731
-        $request = $this->addOtelAttributes($params, [], $request, 'security.query_user');
1732
-        return $this->client->sendRequest($request);
1733
-    }
1734
-    /**
1735
-     * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair
1736
-     *
1737
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html
1738
-     *
1739
-     * @param array{
1740
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1741
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1742
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1743
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1744
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1745
-     *     body: array, // (REQUIRED) The SAML response to authenticate
1746
-     * } $params
1747
-     *
1748
-     * @throws NoNodeAvailableException if all the hosts are offline
1749
-     * @throws ClientResponseException if the status code of response is 4xx
1750
-     * @throws ServerResponseException if the status code of response is 5xx
1751
-     *
1752
-     * @return Elasticsearch|Promise
1753
-     */
1754
-    public function samlAuthenticate(array $params = [])
1755
-    {
1756
-        $this->checkRequiredParameters(['body'], $params);
1757
-        $url = '/_security/saml/authenticate';
1758
-        $method = 'POST';
1759
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1760
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1761
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1762
-        $request = $this->addOtelAttributes($params, [], $request, 'security.saml_authenticate');
1763
-        return $this->client->sendRequest($request);
1764
-    }
1765
-    /**
1766
-     * Verifies the logout response sent from the SAML IdP
1767
-     *
1768
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html
1769
-     *
1770
-     * @param array{
1771
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1772
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1773
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1774
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1775
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1776
-     *     body: array, // (REQUIRED) The logout response to verify
1777
-     * } $params
1778
-     *
1779
-     * @throws NoNodeAvailableException if all the hosts are offline
1780
-     * @throws ClientResponseException if the status code of response is 4xx
1781
-     * @throws ServerResponseException if the status code of response is 5xx
1782
-     *
1783
-     * @return Elasticsearch|Promise
1784
-     */
1785
-    public function samlCompleteLogout(array $params = [])
1786
-    {
1787
-        $this->checkRequiredParameters(['body'], $params);
1788
-        $url = '/_security/saml/complete_logout';
1789
-        $method = 'POST';
1790
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1791
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1792
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1793
-        $request = $this->addOtelAttributes($params, [], $request, 'security.saml_complete_logout');
1794
-        return $this->client->sendRequest($request);
1795
-    }
1796
-    /**
1797
-     * Consumes a SAML LogoutRequest
1798
-     *
1799
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html
1800
-     *
1801
-     * @param array{
1802
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1803
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1804
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1805
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1806
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1807
-     *     body: array, // (REQUIRED) The LogoutRequest message
1808
-     * } $params
1809
-     *
1810
-     * @throws NoNodeAvailableException if all the hosts are offline
1811
-     * @throws ClientResponseException if the status code of response is 4xx
1812
-     * @throws ServerResponseException if the status code of response is 5xx
1813
-     *
1814
-     * @return Elasticsearch|Promise
1815
-     */
1816
-    public function samlInvalidate(array $params = [])
1817
-    {
1818
-        $this->checkRequiredParameters(['body'], $params);
1819
-        $url = '/_security/saml/invalidate';
1820
-        $method = 'POST';
1821
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1822
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1823
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1824
-        $request = $this->addOtelAttributes($params, [], $request, 'security.saml_invalidate');
1825
-        return $this->client->sendRequest($request);
1826
-    }
1827
-    /**
1828
-     * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API
1829
-     *
1830
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html
1831
-     *
1832
-     * @param array{
1833
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1834
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1835
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1836
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1837
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1838
-     *     body: array, // (REQUIRED) The tokens to invalidate
1839
-     * } $params
1840
-     *
1841
-     * @throws NoNodeAvailableException if all the hosts are offline
1842
-     * @throws ClientResponseException if the status code of response is 4xx
1843
-     * @throws ServerResponseException if the status code of response is 5xx
1844
-     *
1845
-     * @return Elasticsearch|Promise
1846
-     */
1847
-    public function samlLogout(array $params = [])
1848
-    {
1849
-        $this->checkRequiredParameters(['body'], $params);
1850
-        $url = '/_security/saml/logout';
1851
-        $method = 'POST';
1852
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1853
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1854
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1855
-        $request = $this->addOtelAttributes($params, [], $request, 'security.saml_logout');
1856
-        return $this->client->sendRequest($request);
1857
-    }
1858
-    /**
1859
-     * Creates a SAML authentication request
1860
-     *
1861
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html
1862
-     *
1863
-     * @param array{
1864
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1865
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1866
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1867
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1868
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1869
-     *     body: array, // (REQUIRED) The realm for which to create the authentication request, identified by either its name or the ACS URL
1870
-     * } $params
1871
-     *
1872
-     * @throws NoNodeAvailableException if all the hosts are offline
1873
-     * @throws ClientResponseException if the status code of response is 4xx
1874
-     * @throws ServerResponseException if the status code of response is 5xx
1875
-     *
1876
-     * @return Elasticsearch|Promise
1877
-     */
1878
-    public function samlPrepareAuthentication(array $params = [])
1879
-    {
1880
-        $this->checkRequiredParameters(['body'], $params);
1881
-        $url = '/_security/saml/prepare';
1882
-        $method = 'POST';
1883
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1884
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1885
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1886
-        $request = $this->addOtelAttributes($params, [], $request, 'security.saml_prepare_authentication');
1887
-        return $this->client->sendRequest($request);
1888
-    }
1889
-    /**
1890
-     * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
1891
-     *
1892
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html
1893
-     *
1894
-     * @param array{
1895
-     *     realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for
1896
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1897
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1898
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1899
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1900
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1901
-     * } $params
1902
-     *
1903
-     * @throws MissingParameterException if a required parameter is missing
1904
-     * @throws NoNodeAvailableException if all the hosts are offline
1905
-     * @throws ClientResponseException if the status code of response is 4xx
1906
-     * @throws ServerResponseException if the status code of response is 5xx
1907
-     *
1908
-     * @return Elasticsearch|Promise
1909
-     */
1910
-    public function samlServiceProviderMetadata(array $params = [])
1911
-    {
1912
-        $this->checkRequiredParameters(['realm_name'], $params);
1913
-        $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']);
1914
-        $method = 'GET';
1915
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1916
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1917
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1918
-        $request = $this->addOtelAttributes($params, ['realm_name'], $request, 'security.saml_service_provider_metadata');
1919
-        return $this->client->sendRequest($request);
1920
-    }
1921
-    /**
1922
-     * Get suggestions for user profiles that match specified search criteria.
1923
-     *
1924
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html
1925
-     *
1926
-     * @param array{
1927
-     *     data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
1928
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1929
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1930
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1931
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1932
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1933
-     *     body: array, //  The suggestion definition for user profiles
1934
-     * } $params
1935
-     *
1936
-     * @throws NoNodeAvailableException if all the hosts are offline
1937
-     * @throws ClientResponseException if the status code of response is 4xx
1938
-     * @throws ServerResponseException if the status code of response is 5xx
1939
-     *
1940
-     * @return Elasticsearch|Promise
1941
-     */
1942
-    public function suggestUserProfiles(array $params = [])
1943
-    {
1944
-        $url = '/_security/profile/_suggest';
1945
-        $method = empty($params['body']) ? 'GET' : 'POST';
1946
-        $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1947
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1948
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1949
-        $request = $this->addOtelAttributes($params, [], $request, 'security.suggest_user_profiles');
1950
-        return $this->client->sendRequest($request);
1951
-    }
1952
-    /**
1953
-     * Updates attributes of an existing API key.
1954
-     *
1955
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html
1956
-     *
1957
-     * @param array{
1958
-     *     id: string, // (REQUIRED) The ID of the API key to update
1959
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1960
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1961
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1962
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1963
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1964
-     *     body: array, //  The API key request to update attributes of an API key.
1965
-     * } $params
1966
-     *
1967
-     * @throws MissingParameterException if a required parameter is missing
1968
-     * @throws NoNodeAvailableException if all the hosts are offline
1969
-     * @throws ClientResponseException if the status code of response is 4xx
1970
-     * @throws ServerResponseException if the status code of response is 5xx
1971
-     *
1972
-     * @return Elasticsearch|Promise
1973
-     */
1974
-    public function updateApiKey(array $params = [])
1975
-    {
1976
-        $this->checkRequiredParameters(['id'], $params);
1977
-        $url = '/_security/api_key/' . $this->encode($params['id']);
1978
-        $method = 'PUT';
1979
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1980
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1981
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1982
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_api_key');
1983
-        return $this->client->sendRequest($request);
1984
-    }
1985
-    /**
1986
-     * Updates attributes of an existing cross-cluster API key.
1987
-     *
1988
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html
1989
-     *
1990
-     * @param array{
1991
-     *     id: string, // (REQUIRED) The ID of the cross-cluster API key to update
1992
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1993
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1994
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1995
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1996
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1997
-     *     body: array, // (REQUIRED) The request to update attributes of a cross-cluster API key.
1998
-     * } $params
1999
-     *
2000
-     * @throws MissingParameterException if a required parameter is missing
2001
-     * @throws NoNodeAvailableException if all the hosts are offline
2002
-     * @throws ClientResponseException if the status code of response is 4xx
2003
-     * @throws ServerResponseException if the status code of response is 5xx
2004
-     *
2005
-     * @return Elasticsearch|Promise
2006
-     */
2007
-    public function updateCrossClusterApiKey(array $params = [])
2008
-    {
2009
-        $this->checkRequiredParameters(['id', 'body'], $params);
2010
-        $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']);
2011
-        $method = 'PUT';
2012
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
2013
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2014
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
2015
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_cross_cluster_api_key');
2016
-        return $this->client->sendRequest($request);
2017
-    }
2018
-    /**
2019
-     * Update settings for the security system index
2020
-     *
2021
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html
2022
-     *
2023
-     * @param array{
2024
-     *     master_timeout: time, // Timeout for connection to master
2025
-     *     timeout: time, // Timeout for acknowledgements from all nodes
2026
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2027
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2028
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2029
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2030
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2031
-     *     body: array, // (REQUIRED) An object with the new settings for each index, if any
2032
-     * } $params
2033
-     *
2034
-     * @throws NoNodeAvailableException if all the hosts are offline
2035
-     * @throws ClientResponseException if the status code of response is 4xx
2036
-     * @throws ServerResponseException if the status code of response is 5xx
2037
-     *
2038
-     * @return Elasticsearch|Promise
2039
-     */
2040
-    public function updateSettings(array $params = [])
2041
-    {
2042
-        $this->checkRequiredParameters(['body'], $params);
2043
-        $url = '/_security/settings';
2044
-        $method = 'PUT';
2045
-        $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2046
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2047
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
2048
-        $request = $this->addOtelAttributes($params, [], $request, 'security.update_settings');
2049
-        return $this->client->sendRequest($request);
2050
-    }
2051
-    /**
2052
-     * Update application specific data for the user profile of the given unique ID.
2053
-     *
2054
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html
2055
-     *
2056
-     * @param array{
2057
-     *     uid: string, // (REQUIRED) An unique identifier of the user profile
2058
-     *     if_seq_no: number, // only perform the update operation if the last operation that has changed the document has the specified sequence number
2059
-     *     if_primary_term: number, // only perform the update operation if the last operation that has changed the document has the specified primary term
2060
-     *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
2061
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2062
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2063
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2064
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2065
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2066
-     *     body: array, // (REQUIRED) The application data to update
2067
-     * } $params
2068
-     *
2069
-     * @throws MissingParameterException if a required parameter is missing
2070
-     * @throws NoNodeAvailableException if all the hosts are offline
2071
-     * @throws ClientResponseException if the status code of response is 4xx
2072
-     * @throws ServerResponseException if the status code of response is 5xx
2073
-     *
2074
-     * @return Elasticsearch|Promise
2075
-     */
2076
-    public function updateUserProfileData(array $params = [])
2077
-    {
2078
-        $this->checkRequiredParameters(['uid', 'body'], $params);
2079
-        $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data';
2080
-        $method = 'PUT';
2081
-        $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2082
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2083
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
2084
-        $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.update_user_profile_data');
2085
-        return $this->client->sendRequest($request);
2086
-    }
28
+	/**
29
+	 * Creates or updates the user profile on behalf of another user.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html
32
+	 *
33
+	 * @param array{
34
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
35
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
36
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
37
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
38
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
39
+	 *     body: array, // (REQUIRED) The grant type and user's credential
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 activateUserProfile(array $params = [])
49
+	{
50
+		$this->checkRequiredParameters(['body'], $params);
51
+		$url = '/_security/profile/_activate';
52
+		$method = 'POST';
53
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
54
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
55
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
56
+		$request = $this->addOtelAttributes($params, [], $request, 'security.activate_user_profile');
57
+		return $this->client->sendRequest($request);
58
+	}
59
+	/**
60
+	 * Enables authentication as a user and retrieve information about the authenticated user.
61
+	 *
62
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html
63
+	 *
64
+	 * @param array{
65
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
66
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
67
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
68
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
69
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
70
+	 * } $params
71
+	 *
72
+	 * @throws NoNodeAvailableException if all the hosts are offline
73
+	 * @throws ClientResponseException if the status code of response is 4xx
74
+	 * @throws ServerResponseException if the status code of response is 5xx
75
+	 *
76
+	 * @return Elasticsearch|Promise
77
+	 */
78
+	public function authenticate(array $params = [])
79
+	{
80
+		$url = '/_security/_authenticate';
81
+		$method = 'GET';
82
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
83
+		$headers = ['Accept' => 'application/json'];
84
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
85
+		$request = $this->addOtelAttributes($params, [], $request, 'security.authenticate');
86
+		return $this->client->sendRequest($request);
87
+	}
88
+	/**
89
+	 * Bulk delete roles in the native realm.
90
+	 *
91
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html
92
+	 *
93
+	 * @param array{
94
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
95
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
96
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
97
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
98
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
99
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
100
+	 *     body: array, // (REQUIRED) The roles to delete
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 bulkDeleteRole(array $params = [])
110
+	{
111
+		$this->checkRequiredParameters(['body'], $params);
112
+		$url = '/_security/role';
113
+		$method = 'DELETE';
114
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
115
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
116
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
117
+		$request = $this->addOtelAttributes($params, [], $request, 'security.bulk_delete_role');
118
+		return $this->client->sendRequest($request);
119
+	}
120
+	/**
121
+	 * Bulk adds and updates roles in the native realm.
122
+	 *
123
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html
124
+	 *
125
+	 * @param array{
126
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
127
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
128
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
129
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
130
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
131
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
132
+	 *     body: array, // (REQUIRED) The roles to add
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 bulkPutRole(array $params = [])
142
+	{
143
+		$this->checkRequiredParameters(['body'], $params);
144
+		$url = '/_security/role';
145
+		$method = 'POST';
146
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
147
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
148
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
149
+		$request = $this->addOtelAttributes($params, [], $request, 'security.bulk_put_role');
150
+		return $this->client->sendRequest($request);
151
+	}
152
+	/**
153
+	 * Updates the attributes of multiple existing API keys.
154
+	 *
155
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html
156
+	 *
157
+	 * @param array{
158
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
159
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
160
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
161
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
162
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
163
+	 *     body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys.
164
+	 * } $params
165
+	 *
166
+	 * @throws NoNodeAvailableException if all the hosts are offline
167
+	 * @throws ClientResponseException if the status code of response is 4xx
168
+	 * @throws ServerResponseException if the status code of response is 5xx
169
+	 *
170
+	 * @return Elasticsearch|Promise
171
+	 */
172
+	public function bulkUpdateApiKeys(array $params = [])
173
+	{
174
+		$this->checkRequiredParameters(['body'], $params);
175
+		$url = '/_security/api_key/_bulk_update';
176
+		$method = 'POST';
177
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
178
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
179
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
180
+		$request = $this->addOtelAttributes($params, [], $request, 'security.bulk_update_api_keys');
181
+		return $this->client->sendRequest($request);
182
+	}
183
+	/**
184
+	 * Changes the passwords of users in the native realm and built-in users.
185
+	 *
186
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html
187
+	 *
188
+	 * @param array{
189
+	 *     username: string, //  The username of the user to change the password for
190
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
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 new password for the user
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 changePassword(array $params = [])
206
+	{
207
+		$this->checkRequiredParameters(['body'], $params);
208
+		if (isset($params['username'])) {
209
+			$url = '/_security/user/' . $this->encode($params['username']) . '/_password';
210
+			$method = 'PUT';
211
+		} else {
212
+			$url = '/_security/user/_password';
213
+			$method = 'PUT';
214
+		}
215
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
216
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
217
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
218
+		$request = $this->addOtelAttributes($params, ['username'], $request, 'security.change_password');
219
+		return $this->client->sendRequest($request);
220
+	}
221
+	/**
222
+	 * Clear a subset or all entries from the API key cache.
223
+	 *
224
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html
225
+	 *
226
+	 * @param array{
227
+	 *     ids: list, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache
228
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
229
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
230
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
231
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
232
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
233
+	 * } $params
234
+	 *
235
+	 * @throws MissingParameterException if a required parameter is missing
236
+	 * @throws NoNodeAvailableException if all the hosts are offline
237
+	 * @throws ClientResponseException if the status code of response is 4xx
238
+	 * @throws ServerResponseException if the status code of response is 5xx
239
+	 *
240
+	 * @return Elasticsearch|Promise
241
+	 */
242
+	public function clearApiKeyCache(array $params = [])
243
+	{
244
+		$this->checkRequiredParameters(['ids'], $params);
245
+		$url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache';
246
+		$method = 'POST';
247
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
248
+		$headers = ['Accept' => 'application/json'];
249
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
250
+		$request = $this->addOtelAttributes($params, ['ids'], $request, 'security.clear_api_key_cache');
251
+		return $this->client->sendRequest($request);
252
+	}
253
+	/**
254
+	 * Evicts application privileges from the native application privileges cache.
255
+	 *
256
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html
257
+	 *
258
+	 * @param array{
259
+	 *     application: list, // (REQUIRED) A comma-separated list of application names
260
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
261
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
262
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
263
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
264
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
265
+	 * } $params
266
+	 *
267
+	 * @throws MissingParameterException if a required parameter is missing
268
+	 * @throws NoNodeAvailableException if all the hosts are offline
269
+	 * @throws ClientResponseException if the status code of response is 4xx
270
+	 * @throws ServerResponseException if the status code of response is 5xx
271
+	 *
272
+	 * @return Elasticsearch|Promise
273
+	 */
274
+	public function clearCachedPrivileges(array $params = [])
275
+	{
276
+		$this->checkRequiredParameters(['application'], $params);
277
+		$url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache';
278
+		$method = 'POST';
279
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
280
+		$headers = ['Accept' => 'application/json'];
281
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
282
+		$request = $this->addOtelAttributes($params, ['application'], $request, 'security.clear_cached_privileges');
283
+		return $this->client->sendRequest($request);
284
+	}
285
+	/**
286
+	 * Evicts users from the user cache. Can completely clear the cache or evict specific users.
287
+	 *
288
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html
289
+	 *
290
+	 * @param array{
291
+	 *     realms: list, // (REQUIRED) Comma-separated list of realms to clear
292
+	 *     usernames: list, // Comma-separated list of usernames to clear from the cache
293
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
294
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
295
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
296
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
297
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
298
+	 * } $params
299
+	 *
300
+	 * @throws MissingParameterException if a required parameter is missing
301
+	 * @throws NoNodeAvailableException if all the hosts are offline
302
+	 * @throws ClientResponseException if the status code of response is 4xx
303
+	 * @throws ServerResponseException if the status code of response is 5xx
304
+	 *
305
+	 * @return Elasticsearch|Promise
306
+	 */
307
+	public function clearCachedRealms(array $params = [])
308
+	{
309
+		$this->checkRequiredParameters(['realms'], $params);
310
+		$url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache';
311
+		$method = 'POST';
312
+		$url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
313
+		$headers = ['Accept' => 'application/json'];
314
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
315
+		$request = $this->addOtelAttributes($params, ['realms'], $request, 'security.clear_cached_realms');
316
+		return $this->client->sendRequest($request);
317
+	}
318
+	/**
319
+	 * Evicts roles from the native role cache.
320
+	 *
321
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html
322
+	 *
323
+	 * @param array{
324
+	 *     name: list, // (REQUIRED) Role name
325
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
326
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
327
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
328
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
329
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
330
+	 * } $params
331
+	 *
332
+	 * @throws MissingParameterException if a required parameter is missing
333
+	 * @throws NoNodeAvailableException if all the hosts are offline
334
+	 * @throws ClientResponseException if the status code of response is 4xx
335
+	 * @throws ServerResponseException if the status code of response is 5xx
336
+	 *
337
+	 * @return Elasticsearch|Promise
338
+	 */
339
+	public function clearCachedRoles(array $params = [])
340
+	{
341
+		$this->checkRequiredParameters(['name'], $params);
342
+		$url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache';
343
+		$method = 'POST';
344
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
345
+		$headers = ['Accept' => 'application/json'];
346
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
347
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.clear_cached_roles');
348
+		return $this->client->sendRequest($request);
349
+	}
350
+	/**
351
+	 * Evicts tokens from the service account token caches.
352
+	 *
353
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html
354
+	 *
355
+	 * @param array{
356
+	 *     namespace: string, // (REQUIRED) An identifier for the namespace
357
+	 *     service: string, // (REQUIRED) An identifier for the service name
358
+	 *     name: list, // (REQUIRED) A comma-separated list of service token names
359
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
360
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
361
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
362
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
363
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
364
+	 * } $params
365
+	 *
366
+	 * @throws MissingParameterException if a required parameter is missing
367
+	 * @throws NoNodeAvailableException if all the hosts are offline
368
+	 * @throws ClientResponseException if the status code of response is 4xx
369
+	 * @throws ServerResponseException if the status code of response is 5xx
370
+	 *
371
+	 * @return Elasticsearch|Promise
372
+	 */
373
+	public function clearCachedServiceTokens(array $params = [])
374
+	{
375
+		$this->checkRequiredParameters(['namespace', 'service', 'name'], $params);
376
+		$url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache';
377
+		$method = 'POST';
378
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
379
+		$headers = ['Accept' => 'application/json'];
380
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
381
+		$request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.clear_cached_service_tokens');
382
+		return $this->client->sendRequest($request);
383
+	}
384
+	/**
385
+	 * Creates an API key for access without requiring basic authentication.
386
+	 *
387
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
388
+	 *
389
+	 * @param array{
390
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
391
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
392
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
393
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
394
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
395
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
396
+	 *     body: array, // (REQUIRED) The api key request to create an API key
397
+	 * } $params
398
+	 *
399
+	 * @throws NoNodeAvailableException if all the hosts are offline
400
+	 * @throws ClientResponseException if the status code of response is 4xx
401
+	 * @throws ServerResponseException if the status code of response is 5xx
402
+	 *
403
+	 * @return Elasticsearch|Promise
404
+	 */
405
+	public function createApiKey(array $params = [])
406
+	{
407
+		$this->checkRequiredParameters(['body'], $params);
408
+		$url = '/_security/api_key';
409
+		$method = 'PUT';
410
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
411
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
412
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
413
+		$request = $this->addOtelAttributes($params, [], $request, 'security.create_api_key');
414
+		return $this->client->sendRequest($request);
415
+	}
416
+	/**
417
+	 * Creates a cross-cluster API key for API key based remote cluster access.
418
+	 *
419
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html
420
+	 *
421
+	 * @param array{
422
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
423
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
424
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
425
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
426
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
427
+	 *     body: array, // (REQUIRED) The request to create a cross-cluster API key
428
+	 * } $params
429
+	 *
430
+	 * @throws NoNodeAvailableException if all the hosts are offline
431
+	 * @throws ClientResponseException if the status code of response is 4xx
432
+	 * @throws ServerResponseException if the status code of response is 5xx
433
+	 *
434
+	 * @return Elasticsearch|Promise
435
+	 */
436
+	public function createCrossClusterApiKey(array $params = [])
437
+	{
438
+		$this->checkRequiredParameters(['body'], $params);
439
+		$url = '/_security/cross_cluster/api_key';
440
+		$method = 'POST';
441
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
442
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
443
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
444
+		$request = $this->addOtelAttributes($params, [], $request, 'security.create_cross_cluster_api_key');
445
+		return $this->client->sendRequest($request);
446
+	}
447
+	/**
448
+	 * Creates a service account token for access without requiring basic authentication.
449
+	 *
450
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html
451
+	 *
452
+	 * @param array{
453
+	 *     namespace: string, // (REQUIRED) An identifier for the namespace
454
+	 *     service: string, // (REQUIRED) An identifier for the service name
455
+	 *     name: string, //  An identifier for the token name
456
+	 *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
457
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
458
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
459
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
460
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
461
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
462
+	 * } $params
463
+	 *
464
+	 * @throws MissingParameterException if a required parameter is missing
465
+	 * @throws NoNodeAvailableException if all the hosts are offline
466
+	 * @throws ClientResponseException if the status code of response is 4xx
467
+	 * @throws ServerResponseException if the status code of response is 5xx
468
+	 *
469
+	 * @return Elasticsearch|Promise
470
+	 */
471
+	public function createServiceToken(array $params = [])
472
+	{
473
+		$this->checkRequiredParameters(['namespace', 'service'], $params);
474
+		if (isset($params['name'])) {
475
+			$url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']);
476
+			$method = 'PUT';
477
+		} else {
478
+			$url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token';
479
+			$method = 'POST';
480
+		}
481
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
482
+		$headers = ['Accept' => 'application/json'];
483
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
484
+		$request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.create_service_token');
485
+		return $this->client->sendRequest($request);
486
+	}
487
+	/**
488
+	 * Removes application privileges.
489
+	 *
490
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html
491
+	 *
492
+	 * @param array{
493
+	 *     application: string, // (REQUIRED) Application name
494
+	 *     name: string, // (REQUIRED) Privilege name
495
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
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 MissingParameterException if a required parameter is missing
504
+	 * @throws NoNodeAvailableException if all the hosts are offline
505
+	 * @throws ClientResponseException if the status code of response is 4xx
506
+	 * @throws ServerResponseException if the status code of response is 5xx
507
+	 *
508
+	 * @return Elasticsearch|Promise
509
+	 */
510
+	public function deletePrivileges(array $params = [])
511
+	{
512
+		$this->checkRequiredParameters(['application', 'name'], $params);
513
+		$url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']);
514
+		$method = 'DELETE';
515
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
516
+		$headers = ['Accept' => 'application/json'];
517
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
518
+		$request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.delete_privileges');
519
+		return $this->client->sendRequest($request);
520
+	}
521
+	/**
522
+	 * Removes roles in the native realm.
523
+	 *
524
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html
525
+	 *
526
+	 * @param array{
527
+	 *     name: string, // (REQUIRED) Role name
528
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
529
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
530
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
531
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
532
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
533
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
534
+	 * } $params
535
+	 *
536
+	 * @throws MissingParameterException if a required parameter is missing
537
+	 * @throws NoNodeAvailableException if all the hosts are offline
538
+	 * @throws ClientResponseException if the status code of response is 4xx
539
+	 * @throws ServerResponseException if the status code of response is 5xx
540
+	 *
541
+	 * @return Elasticsearch|Promise
542
+	 */
543
+	public function deleteRole(array $params = [])
544
+	{
545
+		$this->checkRequiredParameters(['name'], $params);
546
+		$url = '/_security/role/' . $this->encode($params['name']);
547
+		$method = 'DELETE';
548
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
549
+		$headers = ['Accept' => 'application/json'];
550
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
551
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role');
552
+		return $this->client->sendRequest($request);
553
+	}
554
+	/**
555
+	 * Removes role mappings.
556
+	 *
557
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html
558
+	 *
559
+	 * @param array{
560
+	 *     name: string, // (REQUIRED) Role-mapping name
561
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
562
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
563
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
564
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
565
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
566
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
567
+	 * } $params
568
+	 *
569
+	 * @throws MissingParameterException if a required parameter is missing
570
+	 * @throws NoNodeAvailableException if all the hosts are offline
571
+	 * @throws ClientResponseException if the status code of response is 4xx
572
+	 * @throws ServerResponseException if the status code of response is 5xx
573
+	 *
574
+	 * @return Elasticsearch|Promise
575
+	 */
576
+	public function deleteRoleMapping(array $params = [])
577
+	{
578
+		$this->checkRequiredParameters(['name'], $params);
579
+		$url = '/_security/role_mapping/' . $this->encode($params['name']);
580
+		$method = 'DELETE';
581
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
582
+		$headers = ['Accept' => 'application/json'];
583
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
584
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role_mapping');
585
+		return $this->client->sendRequest($request);
586
+	}
587
+	/**
588
+	 * Deletes a service account token.
589
+	 *
590
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html
591
+	 *
592
+	 * @param array{
593
+	 *     namespace: string, // (REQUIRED) An identifier for the namespace
594
+	 *     service: string, // (REQUIRED) An identifier for the service name
595
+	 *     name: string, // (REQUIRED) An identifier for the token name
596
+	 *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
597
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
598
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
599
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
600
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
601
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
602
+	 * } $params
603
+	 *
604
+	 * @throws MissingParameterException if a required parameter is missing
605
+	 * @throws NoNodeAvailableException if all the hosts are offline
606
+	 * @throws ClientResponseException if the status code of response is 4xx
607
+	 * @throws ServerResponseException if the status code of response is 5xx
608
+	 *
609
+	 * @return Elasticsearch|Promise
610
+	 */
611
+	public function deleteServiceToken(array $params = [])
612
+	{
613
+		$this->checkRequiredParameters(['namespace', 'service', 'name'], $params);
614
+		$url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']);
615
+		$method = 'DELETE';
616
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
617
+		$headers = ['Accept' => 'application/json'];
618
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
619
+		$request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.delete_service_token');
620
+		return $this->client->sendRequest($request);
621
+	}
622
+	/**
623
+	 * Deletes users from the native realm.
624
+	 *
625
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html
626
+	 *
627
+	 * @param array{
628
+	 *     username: string, // (REQUIRED) username
629
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
630
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
631
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
632
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
633
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
634
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
635
+	 * } $params
636
+	 *
637
+	 * @throws MissingParameterException if a required parameter is missing
638
+	 * @throws NoNodeAvailableException if all the hosts are offline
639
+	 * @throws ClientResponseException if the status code of response is 4xx
640
+	 * @throws ServerResponseException if the status code of response is 5xx
641
+	 *
642
+	 * @return Elasticsearch|Promise
643
+	 */
644
+	public function deleteUser(array $params = [])
645
+	{
646
+		$this->checkRequiredParameters(['username'], $params);
647
+		$url = '/_security/user/' . $this->encode($params['username']);
648
+		$method = 'DELETE';
649
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
650
+		$headers = ['Accept' => 'application/json'];
651
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
652
+		$request = $this->addOtelAttributes($params, ['username'], $request, 'security.delete_user');
653
+		return $this->client->sendRequest($request);
654
+	}
655
+	/**
656
+	 * Disables users in the native realm.
657
+	 *
658
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html
659
+	 *
660
+	 * @param array{
661
+	 *     username: string, // (REQUIRED) The username of the user to disable
662
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
663
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
664
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
665
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
666
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
667
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
668
+	 * } $params
669
+	 *
670
+	 * @throws MissingParameterException if a required parameter is missing
671
+	 * @throws NoNodeAvailableException if all the hosts are offline
672
+	 * @throws ClientResponseException if the status code of response is 4xx
673
+	 * @throws ServerResponseException if the status code of response is 5xx
674
+	 *
675
+	 * @return Elasticsearch|Promise
676
+	 */
677
+	public function disableUser(array $params = [])
678
+	{
679
+		$this->checkRequiredParameters(['username'], $params);
680
+		$url = '/_security/user/' . $this->encode($params['username']) . '/_disable';
681
+		$method = 'PUT';
682
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
683
+		$headers = ['Accept' => 'application/json'];
684
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
685
+		$request = $this->addOtelAttributes($params, ['username'], $request, 'security.disable_user');
686
+		return $this->client->sendRequest($request);
687
+	}
688
+	/**
689
+	 * Disables a user profile so it's not visible in user profile searches.
690
+	 *
691
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html
692
+	 *
693
+	 * @param array{
694
+	 *     uid: string, // (REQUIRED) Unique identifier for the user profile
695
+	 *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
696
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
697
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
698
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
699
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
700
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
701
+	 * } $params
702
+	 *
703
+	 * @throws MissingParameterException if a required parameter is missing
704
+	 * @throws NoNodeAvailableException if all the hosts are offline
705
+	 * @throws ClientResponseException if the status code of response is 4xx
706
+	 * @throws ServerResponseException if the status code of response is 5xx
707
+	 *
708
+	 * @return Elasticsearch|Promise
709
+	 */
710
+	public function disableUserProfile(array $params = [])
711
+	{
712
+		$this->checkRequiredParameters(['uid'], $params);
713
+		$url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable';
714
+		$method = 'PUT';
715
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
716
+		$headers = ['Accept' => 'application/json'];
717
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
718
+		$request = $this->addOtelAttributes($params, ['uid'], $request, 'security.disable_user_profile');
719
+		return $this->client->sendRequest($request);
720
+	}
721
+	/**
722
+	 * Enables users in the native realm.
723
+	 *
724
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html
725
+	 *
726
+	 * @param array{
727
+	 *     username: string, // (REQUIRED) The username of the user to enable
728
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
729
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
730
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
731
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
732
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
733
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
734
+	 * } $params
735
+	 *
736
+	 * @throws MissingParameterException if a required parameter is missing
737
+	 * @throws NoNodeAvailableException if all the hosts are offline
738
+	 * @throws ClientResponseException if the status code of response is 4xx
739
+	 * @throws ServerResponseException if the status code of response is 5xx
740
+	 *
741
+	 * @return Elasticsearch|Promise
742
+	 */
743
+	public function enableUser(array $params = [])
744
+	{
745
+		$this->checkRequiredParameters(['username'], $params);
746
+		$url = '/_security/user/' . $this->encode($params['username']) . '/_enable';
747
+		$method = 'PUT';
748
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
749
+		$headers = ['Accept' => 'application/json'];
750
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
751
+		$request = $this->addOtelAttributes($params, ['username'], $request, 'security.enable_user');
752
+		return $this->client->sendRequest($request);
753
+	}
754
+	/**
755
+	 * Enables a user profile so it's visible in user profile searches.
756
+	 *
757
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html
758
+	 *
759
+	 * @param array{
760
+	 *     uid: string, // (REQUIRED) An unique identifier of the user profile
761
+	 *     refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
762
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
763
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
764
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
765
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
766
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
767
+	 * } $params
768
+	 *
769
+	 * @throws MissingParameterException if a required parameter is missing
770
+	 * @throws NoNodeAvailableException if all the hosts are offline
771
+	 * @throws ClientResponseException if the status code of response is 4xx
772
+	 * @throws ServerResponseException if the status code of response is 5xx
773
+	 *
774
+	 * @return Elasticsearch|Promise
775
+	 */
776
+	public function enableUserProfile(array $params = [])
777
+	{
778
+		$this->checkRequiredParameters(['uid'], $params);
779
+		$url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable';
780
+		$method = 'PUT';
781
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
782
+		$headers = ['Accept' => 'application/json'];
783
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
784
+		$request = $this->addOtelAttributes($params, ['uid'], $request, 'security.enable_user_profile');
785
+		return $this->client->sendRequest($request);
786
+	}
787
+	/**
788
+	 * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster.
789
+	 *
790
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html
791
+	 *
792
+	 * @param array{
793
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
794
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
795
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
796
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
797
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
798
+	 * } $params
799
+	 *
800
+	 * @throws NoNodeAvailableException if all the hosts are offline
801
+	 * @throws ClientResponseException if the status code of response is 4xx
802
+	 * @throws ServerResponseException if the status code of response is 5xx
803
+	 *
804
+	 * @return Elasticsearch|Promise
805
+	 */
806
+	public function enrollKibana(array $params = [])
807
+	{
808
+		$url = '/_security/enroll/kibana';
809
+		$method = 'GET';
810
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
811
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
812
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
813
+		$request = $this->addOtelAttributes($params, [], $request, 'security.enroll_kibana');
814
+		return $this->client->sendRequest($request);
815
+	}
816
+	/**
817
+	 * Allows a new node to enroll to an existing cluster with security enabled.
818
+	 *
819
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html
820
+	 *
821
+	 * @param array{
822
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
823
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
824
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
825
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
826
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
827
+	 * } $params
828
+	 *
829
+	 * @throws NoNodeAvailableException if all the hosts are offline
830
+	 * @throws ClientResponseException if the status code of response is 4xx
831
+	 * @throws ServerResponseException if the status code of response is 5xx
832
+	 *
833
+	 * @return Elasticsearch|Promise
834
+	 */
835
+	public function enrollNode(array $params = [])
836
+	{
837
+		$url = '/_security/enroll/node';
838
+		$method = 'GET';
839
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
840
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
841
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
842
+		$request = $this->addOtelAttributes($params, [], $request, 'security.enroll_node');
843
+		return $this->client->sendRequest($request);
844
+	}
845
+	/**
846
+	 * Retrieves information for one or more API keys.
847
+	 *
848
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html
849
+	 *
850
+	 * @param array{
851
+	 *     id: string, // API key id of the API key to be retrieved
852
+	 *     name: string, // API key name of the API key to be retrieved
853
+	 *     username: string, // user name of the user who created this API key to be retrieved
854
+	 *     realm_name: string, // realm name of the user who created this API key to be retrieved
855
+	 *     owner: boolean, // flag to query API keys owned by the currently authenticated user
856
+	 *     with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
857
+	 *     with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists
858
+	 *     active_only: boolean, // flag to limit response to only active (not invalidated or expired) API keys
859
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
860
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
861
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
862
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
863
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
864
+	 * } $params
865
+	 *
866
+	 * @throws NoNodeAvailableException if all the hosts are offline
867
+	 * @throws ClientResponseException if the status code of response is 4xx
868
+	 * @throws ServerResponseException if the status code of response is 5xx
869
+	 *
870
+	 * @return Elasticsearch|Promise
871
+	 */
872
+	public function getApiKey(array $params = [])
873
+	{
874
+		$url = '/_security/api_key';
875
+		$method = 'GET';
876
+		$url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'with_profile_uid', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
877
+		$headers = ['Accept' => 'application/json'];
878
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
879
+		$request = $this->addOtelAttributes($params, [], $request, 'security.get_api_key');
880
+		return $this->client->sendRequest($request);
881
+	}
882
+	/**
883
+	 * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.
884
+	 *
885
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html
886
+	 *
887
+	 * @param array{
888
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
889
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
890
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
891
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
892
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
893
+	 * } $params
894
+	 *
895
+	 * @throws NoNodeAvailableException if all the hosts are offline
896
+	 * @throws ClientResponseException if the status code of response is 4xx
897
+	 * @throws ServerResponseException if the status code of response is 5xx
898
+	 *
899
+	 * @return Elasticsearch|Promise
900
+	 */
901
+	public function getBuiltinPrivileges(array $params = [])
902
+	{
903
+		$url = '/_security/privilege/_builtin';
904
+		$method = 'GET';
905
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
906
+		$headers = ['Accept' => 'application/json'];
907
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
908
+		$request = $this->addOtelAttributes($params, [], $request, 'security.get_builtin_privileges');
909
+		return $this->client->sendRequest($request);
910
+	}
911
+	/**
912
+	 * Retrieves application privileges.
913
+	 *
914
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html
915
+	 *
916
+	 * @param array{
917
+	 *     application: string, //  Application name
918
+	 *     name: string, //  Privilege name
919
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
920
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
921
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
922
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
923
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
924
+	 * } $params
925
+	 *
926
+	 * @throws NoNodeAvailableException if all the hosts are offline
927
+	 * @throws ClientResponseException if the status code of response is 4xx
928
+	 * @throws ServerResponseException if the status code of response is 5xx
929
+	 *
930
+	 * @return Elasticsearch|Promise
931
+	 */
932
+	public function getPrivileges(array $params = [])
933
+	{
934
+		if (isset($params['application']) && isset($params['name'])) {
935
+			$url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']);
936
+			$method = 'GET';
937
+		} elseif (isset($params['application'])) {
938
+			$url = '/_security/privilege/' . $this->encode($params['application']);
939
+			$method = 'GET';
940
+		} else {
941
+			$url = '/_security/privilege';
942
+			$method = 'GET';
943
+		}
944
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
945
+		$headers = ['Accept' => 'application/json'];
946
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
947
+		$request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.get_privileges');
948
+		return $this->client->sendRequest($request);
949
+	}
950
+	/**
951
+	 * Retrieves roles in the native realm.
952
+	 *
953
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html
954
+	 *
955
+	 * @param array{
956
+	 *     name: list, //  A comma-separated list of role names
957
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
958
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
959
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
960
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
961
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
962
+	 * } $params
963
+	 *
964
+	 * @throws NoNodeAvailableException if all the hosts are offline
965
+	 * @throws ClientResponseException if the status code of response is 4xx
966
+	 * @throws ServerResponseException if the status code of response is 5xx
967
+	 *
968
+	 * @return Elasticsearch|Promise
969
+	 */
970
+	public function getRole(array $params = [])
971
+	{
972
+		if (isset($params['name'])) {
973
+			$url = '/_security/role/' . $this->encode($params['name']);
974
+			$method = 'GET';
975
+		} else {
976
+			$url = '/_security/role';
977
+			$method = 'GET';
978
+		}
979
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
980
+		$headers = ['Accept' => 'application/json'];
981
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
982
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role');
983
+		return $this->client->sendRequest($request);
984
+	}
985
+	/**
986
+	 * Retrieves role mappings.
987
+	 *
988
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html
989
+	 *
990
+	 * @param array{
991
+	 *     name: list, //  A comma-separated list of role-mapping names
992
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
993
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
994
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
995
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
996
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
997
+	 * } $params
998
+	 *
999
+	 * @throws NoNodeAvailableException if all the hosts are offline
1000
+	 * @throws ClientResponseException if the status code of response is 4xx
1001
+	 * @throws ServerResponseException if the status code of response is 5xx
1002
+	 *
1003
+	 * @return Elasticsearch|Promise
1004
+	 */
1005
+	public function getRoleMapping(array $params = [])
1006
+	{
1007
+		if (isset($params['name'])) {
1008
+			$url = '/_security/role_mapping/' . $this->encode($params['name']);
1009
+			$method = 'GET';
1010
+		} else {
1011
+			$url = '/_security/role_mapping';
1012
+			$method = 'GET';
1013
+		}
1014
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1015
+		$headers = ['Accept' => 'application/json'];
1016
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1017
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role_mapping');
1018
+		return $this->client->sendRequest($request);
1019
+	}
1020
+	/**
1021
+	 * Retrieves information about service accounts.
1022
+	 *
1023
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html
1024
+	 *
1025
+	 * @param array{
1026
+	 *     namespace: string, //  An identifier for the namespace
1027
+	 *     service: string, //  An identifier for the service name
1028
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1029
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1030
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1031
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1032
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1033
+	 * } $params
1034
+	 *
1035
+	 * @throws NoNodeAvailableException if all the hosts are offline
1036
+	 * @throws ClientResponseException if the status code of response is 4xx
1037
+	 * @throws ServerResponseException if the status code of response is 5xx
1038
+	 *
1039
+	 * @return Elasticsearch|Promise
1040
+	 */
1041
+	public function getServiceAccounts(array $params = [])
1042
+	{
1043
+		if (isset($params['namespace']) && isset($params['service'])) {
1044
+			$url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']);
1045
+			$method = 'GET';
1046
+		} elseif (isset($params['namespace'])) {
1047
+			$url = '/_security/service/' . $this->encode($params['namespace']);
1048
+			$method = 'GET';
1049
+		} else {
1050
+			$url = '/_security/service';
1051
+			$method = 'GET';
1052
+		}
1053
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1054
+		$headers = ['Accept' => 'application/json'];
1055
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1056
+		$request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_accounts');
1057
+		return $this->client->sendRequest($request);
1058
+	}
1059
+	/**
1060
+	 * Retrieves information of all service credentials for a service account.
1061
+	 *
1062
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html
1063
+	 *
1064
+	 * @param array{
1065
+	 *     namespace: string, // (REQUIRED) An identifier for the namespace
1066
+	 *     service: string, // (REQUIRED) An identifier for the service name
1067
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1068
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1069
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1070
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1071
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1072
+	 * } $params
1073
+	 *
1074
+	 * @throws MissingParameterException if a required parameter is missing
1075
+	 * @throws NoNodeAvailableException if all the hosts are offline
1076
+	 * @throws ClientResponseException if the status code of response is 4xx
1077
+	 * @throws ServerResponseException if the status code of response is 5xx
1078
+	 *
1079
+	 * @return Elasticsearch|Promise
1080
+	 */
1081
+	public function getServiceCredentials(array $params = [])
1082
+	{
1083
+		$this->checkRequiredParameters(['namespace', 'service'], $params);
1084
+		$url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential';
1085
+		$method = 'GET';
1086
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1087
+		$headers = ['Accept' => 'application/json'];
1088
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1089
+		$request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_credentials');
1090
+		return $this->client->sendRequest($request);
1091
+	}
1092
+	/**
1093
+	 * Retrieve settings for the security system indices
1094
+	 *
1095
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html
1096
+	 *
1097
+	 * @param array{
1098
+	 *     master_timeout: time, // Timeout for connection to master
1099
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1100
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1101
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1102
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1103
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1104
+	 * } $params
1105
+	 *
1106
+	 * @throws NoNodeAvailableException if all the hosts are offline
1107
+	 * @throws ClientResponseException if the status code of response is 4xx
1108
+	 * @throws ServerResponseException if the status code of response is 5xx
1109
+	 *
1110
+	 * @return Elasticsearch|Promise
1111
+	 */
1112
+	public function getSettings(array $params = [])
1113
+	{
1114
+		$url = '/_security/settings';
1115
+		$method = 'GET';
1116
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1117
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1118
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1119
+		$request = $this->addOtelAttributes($params, [], $request, 'security.get_settings');
1120
+		return $this->client->sendRequest($request);
1121
+	}
1122
+	/**
1123
+	 * Creates a bearer token for access without requiring basic authentication.
1124
+	 *
1125
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html
1126
+	 *
1127
+	 * @param array{
1128
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1129
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1130
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1131
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1132
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1133
+	 *     body: array, // (REQUIRED) The token request to get
1134
+	 * } $params
1135
+	 *
1136
+	 * @throws NoNodeAvailableException if all the hosts are offline
1137
+	 * @throws ClientResponseException if the status code of response is 4xx
1138
+	 * @throws ServerResponseException if the status code of response is 5xx
1139
+	 *
1140
+	 * @return Elasticsearch|Promise
1141
+	 */
1142
+	public function getToken(array $params = [])
1143
+	{
1144
+		$this->checkRequiredParameters(['body'], $params);
1145
+		$url = '/_security/oauth2/token';
1146
+		$method = 'POST';
1147
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1148
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1149
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1150
+		$request = $this->addOtelAttributes($params, [], $request, 'security.get_token');
1151
+		return $this->client->sendRequest($request);
1152
+	}
1153
+	/**
1154
+	 * Retrieves information about users in the native realm and built-in users.
1155
+	 *
1156
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html
1157
+	 *
1158
+	 * @param array{
1159
+	 *     username: list, //  A comma-separated list of usernames
1160
+	 *     with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user
1161
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1162
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1163
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1164
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1165
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1166
+	 * } $params
1167
+	 *
1168
+	 * @throws NoNodeAvailableException if all the hosts are offline
1169
+	 * @throws ClientResponseException if the status code of response is 4xx
1170
+	 * @throws ServerResponseException if the status code of response is 5xx
1171
+	 *
1172
+	 * @return Elasticsearch|Promise
1173
+	 */
1174
+	public function getUser(array $params = [])
1175
+	{
1176
+		if (isset($params['username'])) {
1177
+			$url = '/_security/user/' . $this->encode($params['username']);
1178
+			$method = 'GET';
1179
+		} else {
1180
+			$url = '/_security/user';
1181
+			$method = 'GET';
1182
+		}
1183
+		$url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1184
+		$headers = ['Accept' => 'application/json'];
1185
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1186
+		$request = $this->addOtelAttributes($params, ['username'], $request, 'security.get_user');
1187
+		return $this->client->sendRequest($request);
1188
+	}
1189
+	/**
1190
+	 * Retrieves security privileges for the logged in user.
1191
+	 *
1192
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html
1193
+	 *
1194
+	 * @param array{
1195
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1196
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1197
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1198
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1199
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1200
+	 * } $params
1201
+	 *
1202
+	 * @throws NoNodeAvailableException if all the hosts are offline
1203
+	 * @throws ClientResponseException if the status code of response is 4xx
1204
+	 * @throws ServerResponseException if the status code of response is 5xx
1205
+	 *
1206
+	 * @return Elasticsearch|Promise
1207
+	 */
1208
+	public function getUserPrivileges(array $params = [])
1209
+	{
1210
+		$url = '/_security/user/_privileges';
1211
+		$method = 'GET';
1212
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1213
+		$headers = ['Accept' => 'application/json'];
1214
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1215
+		$request = $this->addOtelAttributes($params, [], $request, 'security.get_user_privileges');
1216
+		return $this->client->sendRequest($request);
1217
+	}
1218
+	/**
1219
+	 * Retrieves user profiles for the given unique ID(s).
1220
+	 *
1221
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html
1222
+	 *
1223
+	 * @param array{
1224
+	 *     uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles
1225
+	 *     data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
1226
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1227
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1228
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1229
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1230
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1231
+	 * } $params
1232
+	 *
1233
+	 * @throws MissingParameterException if a required parameter is missing
1234
+	 * @throws NoNodeAvailableException if all the hosts are offline
1235
+	 * @throws ClientResponseException if the status code of response is 4xx
1236
+	 * @throws ServerResponseException if the status code of response is 5xx
1237
+	 *
1238
+	 * @return Elasticsearch|Promise
1239
+	 */
1240
+	public function getUserProfile(array $params = [])
1241
+	{
1242
+		$this->checkRequiredParameters(['uid'], $params);
1243
+		$url = '/_security/profile/' . $this->encode($params['uid']);
1244
+		$method = 'GET';
1245
+		$url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1246
+		$headers = ['Accept' => 'application/json'];
1247
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1248
+		$request = $this->addOtelAttributes($params, ['uid'], $request, 'security.get_user_profile');
1249
+		return $this->client->sendRequest($request);
1250
+	}
1251
+	/**
1252
+	 * Creates an API key on behalf of another user.
1253
+	 *
1254
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html
1255
+	 *
1256
+	 * @param array{
1257
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1258
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1259
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1260
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1261
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1262
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1263
+	 *     body: array, // (REQUIRED) The api key request to create an API key
1264
+	 * } $params
1265
+	 *
1266
+	 * @throws NoNodeAvailableException if all the hosts are offline
1267
+	 * @throws ClientResponseException if the status code of response is 4xx
1268
+	 * @throws ServerResponseException if the status code of response is 5xx
1269
+	 *
1270
+	 * @return Elasticsearch|Promise
1271
+	 */
1272
+	public function grantApiKey(array $params = [])
1273
+	{
1274
+		$this->checkRequiredParameters(['body'], $params);
1275
+		$url = '/_security/api_key/grant';
1276
+		$method = 'POST';
1277
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1278
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1279
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1280
+		$request = $this->addOtelAttributes($params, [], $request, 'security.grant_api_key');
1281
+		return $this->client->sendRequest($request);
1282
+	}
1283
+	/**
1284
+	 * Determines whether the specified user has a specified list of privileges.
1285
+	 *
1286
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html
1287
+	 *
1288
+	 * @param array{
1289
+	 *     user: string, //  Username
1290
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1291
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1292
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1293
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1294
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1295
+	 *     body: array, // (REQUIRED) The privileges to test
1296
+	 * } $params
1297
+	 *
1298
+	 * @throws NoNodeAvailableException if all the hosts are offline
1299
+	 * @throws ClientResponseException if the status code of response is 4xx
1300
+	 * @throws ServerResponseException if the status code of response is 5xx
1301
+	 *
1302
+	 * @return Elasticsearch|Promise
1303
+	 */
1304
+	public function hasPrivileges(array $params = [])
1305
+	{
1306
+		$this->checkRequiredParameters(['body'], $params);
1307
+		if (isset($params['user'])) {
1308
+			$url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges';
1309
+			$method = empty($params['body']) ? 'GET' : 'POST';
1310
+		} else {
1311
+			$url = '/_security/user/_has_privileges';
1312
+			$method = empty($params['body']) ? 'GET' : 'POST';
1313
+		}
1314
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1315
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1316
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1317
+		$request = $this->addOtelAttributes($params, ['user'], $request, 'security.has_privileges');
1318
+		return $this->client->sendRequest($request);
1319
+	}
1320
+	/**
1321
+	 * Determines whether the users associated with the specified profile IDs have all the requested privileges.
1322
+	 *
1323
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html
1324
+	 *
1325
+	 * @param array{
1326
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1327
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1328
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1329
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1330
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1331
+	 *     body: array, // (REQUIRED) The privileges to check and the list of profile IDs
1332
+	 * } $params
1333
+	 *
1334
+	 * @throws NoNodeAvailableException if all the hosts are offline
1335
+	 * @throws ClientResponseException if the status code of response is 4xx
1336
+	 * @throws ServerResponseException if the status code of response is 5xx
1337
+	 *
1338
+	 * @return Elasticsearch|Promise
1339
+	 */
1340
+	public function hasPrivilegesUserProfile(array $params = [])
1341
+	{
1342
+		$this->checkRequiredParameters(['body'], $params);
1343
+		$url = '/_security/profile/_has_privileges';
1344
+		$method = empty($params['body']) ? 'GET' : 'POST';
1345
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1346
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1347
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1348
+		$request = $this->addOtelAttributes($params, [], $request, 'security.has_privileges_user_profile');
1349
+		return $this->client->sendRequest($request);
1350
+	}
1351
+	/**
1352
+	 * Invalidates one or more API keys.
1353
+	 *
1354
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html
1355
+	 *
1356
+	 * @param array{
1357
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1358
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1359
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1360
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1361
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1362
+	 *     body: array, // (REQUIRED) The api key request to invalidate API key(s)
1363
+	 * } $params
1364
+	 *
1365
+	 * @throws NoNodeAvailableException if all the hosts are offline
1366
+	 * @throws ClientResponseException if the status code of response is 4xx
1367
+	 * @throws ServerResponseException if the status code of response is 5xx
1368
+	 *
1369
+	 * @return Elasticsearch|Promise
1370
+	 */
1371
+	public function invalidateApiKey(array $params = [])
1372
+	{
1373
+		$this->checkRequiredParameters(['body'], $params);
1374
+		$url = '/_security/api_key';
1375
+		$method = 'DELETE';
1376
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1377
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1378
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1379
+		$request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_api_key');
1380
+		return $this->client->sendRequest($request);
1381
+	}
1382
+	/**
1383
+	 * Invalidates one or more access tokens or refresh tokens.
1384
+	 *
1385
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html
1386
+	 *
1387
+	 * @param array{
1388
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1389
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1390
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1391
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1392
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1393
+	 *     body: array, // (REQUIRED) The token to invalidate
1394
+	 * } $params
1395
+	 *
1396
+	 * @throws NoNodeAvailableException if all the hosts are offline
1397
+	 * @throws ClientResponseException if the status code of response is 4xx
1398
+	 * @throws ServerResponseException if the status code of response is 5xx
1399
+	 *
1400
+	 * @return Elasticsearch|Promise
1401
+	 */
1402
+	public function invalidateToken(array $params = [])
1403
+	{
1404
+		$this->checkRequiredParameters(['body'], $params);
1405
+		$url = '/_security/oauth2/token';
1406
+		$method = 'DELETE';
1407
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1408
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1409
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1410
+		$request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_token');
1411
+		return $this->client->sendRequest($request);
1412
+	}
1413
+	/**
1414
+	 * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair
1415
+	 *
1416
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html
1417
+	 *
1418
+	 * @param array{
1419
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1420
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1421
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1422
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1423
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1424
+	 *     body: array, // (REQUIRED) The OpenID Connect response to authenticate
1425
+	 * } $params
1426
+	 *
1427
+	 * @throws NoNodeAvailableException if all the hosts are offline
1428
+	 * @throws ClientResponseException if the status code of response is 4xx
1429
+	 * @throws ServerResponseException if the status code of response is 5xx
1430
+	 *
1431
+	 * @return Elasticsearch|Promise
1432
+	 */
1433
+	public function oidcAuthenticate(array $params = [])
1434
+	{
1435
+		$this->checkRequiredParameters(['body'], $params);
1436
+		$url = '/_security/oidc/authenticate';
1437
+		$method = 'POST';
1438
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1439
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1440
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1441
+		$request = $this->addOtelAttributes($params, [], $request, 'security.oidc_authenticate');
1442
+		return $this->client->sendRequest($request);
1443
+	}
1444
+	/**
1445
+	 * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API
1446
+	 *
1447
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html
1448
+	 *
1449
+	 * @param array{
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) Access token and refresh token to invalidate
1456
+	 * } $params
1457
+	 *
1458
+	 * @throws NoNodeAvailableException if all the hosts are offline
1459
+	 * @throws ClientResponseException if the status code of response is 4xx
1460
+	 * @throws ServerResponseException if the status code of response is 5xx
1461
+	 *
1462
+	 * @return Elasticsearch|Promise
1463
+	 */
1464
+	public function oidcLogout(array $params = [])
1465
+	{
1466
+		$this->checkRequiredParameters(['body'], $params);
1467
+		$url = '/_security/oidc/logout';
1468
+		$method = 'POST';
1469
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1470
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1471
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1472
+		$request = $this->addOtelAttributes($params, [], $request, 'security.oidc_logout');
1473
+		return $this->client->sendRequest($request);
1474
+	}
1475
+	/**
1476
+	 * Creates an OAuth 2.0 authentication request as a URL string
1477
+	 *
1478
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html
1479
+	 *
1480
+	 * @param array{
1481
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1482
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1483
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1484
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1485
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1486
+	 *     body: array, // (REQUIRED) The OpenID Connect authentication realm configuration
1487
+	 * } $params
1488
+	 *
1489
+	 * @throws NoNodeAvailableException if all the hosts are offline
1490
+	 * @throws ClientResponseException if the status code of response is 4xx
1491
+	 * @throws ServerResponseException if the status code of response is 5xx
1492
+	 *
1493
+	 * @return Elasticsearch|Promise
1494
+	 */
1495
+	public function oidcPrepareAuthentication(array $params = [])
1496
+	{
1497
+		$this->checkRequiredParameters(['body'], $params);
1498
+		$url = '/_security/oidc/prepare';
1499
+		$method = 'POST';
1500
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1501
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1502
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1503
+		$request = $this->addOtelAttributes($params, [], $request, 'security.oidc_prepare_authentication');
1504
+		return $this->client->sendRequest($request);
1505
+	}
1506
+	/**
1507
+	 * Adds or updates application privileges.
1508
+	 *
1509
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html
1510
+	 *
1511
+	 * @param array{
1512
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1513
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1514
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1515
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1516
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1517
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1518
+	 *     body: array, // (REQUIRED) The privilege(s) to add
1519
+	 * } $params
1520
+	 *
1521
+	 * @throws NoNodeAvailableException if all the hosts are offline
1522
+	 * @throws ClientResponseException if the status code of response is 4xx
1523
+	 * @throws ServerResponseException if the status code of response is 5xx
1524
+	 *
1525
+	 * @return Elasticsearch|Promise
1526
+	 */
1527
+	public function putPrivileges(array $params = [])
1528
+	{
1529
+		$this->checkRequiredParameters(['body'], $params);
1530
+		$url = '/_security/privilege';
1531
+		$method = 'PUT';
1532
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1533
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1534
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1535
+		$request = $this->addOtelAttributes($params, [], $request, 'security.put_privileges');
1536
+		return $this->client->sendRequest($request);
1537
+	}
1538
+	/**
1539
+	 * Adds and updates roles in the native realm.
1540
+	 *
1541
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html
1542
+	 *
1543
+	 * @param array{
1544
+	 *     name: string, // (REQUIRED) Role name
1545
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1546
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1547
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1548
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1549
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1550
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1551
+	 *     body: array, // (REQUIRED) The role to add
1552
+	 * } $params
1553
+	 *
1554
+	 * @throws MissingParameterException if a required parameter is missing
1555
+	 * @throws NoNodeAvailableException if all the hosts are offline
1556
+	 * @throws ClientResponseException if the status code of response is 4xx
1557
+	 * @throws ServerResponseException if the status code of response is 5xx
1558
+	 *
1559
+	 * @return Elasticsearch|Promise
1560
+	 */
1561
+	public function putRole(array $params = [])
1562
+	{
1563
+		$this->checkRequiredParameters(['name', 'body'], $params);
1564
+		$url = '/_security/role/' . $this->encode($params['name']);
1565
+		$method = 'PUT';
1566
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1567
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1568
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1569
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role');
1570
+		return $this->client->sendRequest($request);
1571
+	}
1572
+	/**
1573
+	 * Creates and updates role mappings.
1574
+	 *
1575
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html
1576
+	 *
1577
+	 * @param array{
1578
+	 *     name: string, // (REQUIRED) Role-mapping name
1579
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1580
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1581
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1582
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1583
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1584
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1585
+	 *     body: array, // (REQUIRED) The role mapping to add
1586
+	 * } $params
1587
+	 *
1588
+	 * @throws MissingParameterException if a required parameter is missing
1589
+	 * @throws NoNodeAvailableException if all the hosts are offline
1590
+	 * @throws ClientResponseException if the status code of response is 4xx
1591
+	 * @throws ServerResponseException if the status code of response is 5xx
1592
+	 *
1593
+	 * @return Elasticsearch|Promise
1594
+	 */
1595
+	public function putRoleMapping(array $params = [])
1596
+	{
1597
+		$this->checkRequiredParameters(['name', 'body'], $params);
1598
+		$url = '/_security/role_mapping/' . $this->encode($params['name']);
1599
+		$method = 'PUT';
1600
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1601
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1602
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1603
+		$request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role_mapping');
1604
+		return $this->client->sendRequest($request);
1605
+	}
1606
+	/**
1607
+	 * Adds and updates users in the native realm. These users are commonly referred to as native users.
1608
+	 *
1609
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html
1610
+	 *
1611
+	 * @param array{
1612
+	 *     username: string, // (REQUIRED) The username of the User
1613
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
1614
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1615
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1616
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1617
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1618
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1619
+	 *     body: array, // (REQUIRED) The user to add
1620
+	 * } $params
1621
+	 *
1622
+	 * @throws MissingParameterException if a required parameter is missing
1623
+	 * @throws NoNodeAvailableException if all the hosts are offline
1624
+	 * @throws ClientResponseException if the status code of response is 4xx
1625
+	 * @throws ServerResponseException if the status code of response is 5xx
1626
+	 *
1627
+	 * @return Elasticsearch|Promise
1628
+	 */
1629
+	public function putUser(array $params = [])
1630
+	{
1631
+		$this->checkRequiredParameters(['username', 'body'], $params);
1632
+		$url = '/_security/user/' . $this->encode($params['username']);
1633
+		$method = 'PUT';
1634
+		$url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1635
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1636
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1637
+		$request = $this->addOtelAttributes($params, ['username'], $request, 'security.put_user');
1638
+		return $this->client->sendRequest($request);
1639
+	}
1640
+	/**
1641
+	 * Retrieves information for API keys using a subset of query DSL
1642
+	 *
1643
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html
1644
+	 *
1645
+	 * @param array{
1646
+	 *     with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
1647
+	 *     with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists
1648
+	 *     typed_keys: boolean, // flag to prefix aggregation names by their respective types in the response
1649
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1650
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1651
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1652
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1653
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1654
+	 *     body: array, //  From, size, query, sort and search_after
1655
+	 * } $params
1656
+	 *
1657
+	 * @throws NoNodeAvailableException if all the hosts are offline
1658
+	 * @throws ClientResponseException if the status code of response is 4xx
1659
+	 * @throws ServerResponseException if the status code of response is 5xx
1660
+	 *
1661
+	 * @return Elasticsearch|Promise
1662
+	 */
1663
+	public function queryApiKeys(array $params = [])
1664
+	{
1665
+		$url = '/_security/_query/api_key';
1666
+		$method = empty($params['body']) ? 'GET' : 'POST';
1667
+		$url = $this->addQueryString($url, $params, ['with_limited_by', 'with_profile_uid', 'typed_keys', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1668
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1669
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1670
+		$request = $this->addOtelAttributes($params, [], $request, 'security.query_api_keys');
1671
+		return $this->client->sendRequest($request);
1672
+	}
1673
+	/**
1674
+	 * Retrieves information for Roles using a subset of query DSL
1675
+	 *
1676
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html
1677
+	 *
1678
+	 * @param array{
1679
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1680
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1681
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1682
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1683
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1684
+	 *     body: array, //  From, size, query, sort and search_after
1685
+	 * } $params
1686
+	 *
1687
+	 * @throws NoNodeAvailableException if all the hosts are offline
1688
+	 * @throws ClientResponseException if the status code of response is 4xx
1689
+	 * @throws ServerResponseException if the status code of response is 5xx
1690
+	 *
1691
+	 * @return Elasticsearch|Promise
1692
+	 */
1693
+	public function queryRole(array $params = [])
1694
+	{
1695
+		$url = '/_security/_query/role';
1696
+		$method = empty($params['body']) ? 'GET' : 'POST';
1697
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1698
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1699
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1700
+		$request = $this->addOtelAttributes($params, [], $request, 'security.query_role');
1701
+		return $this->client->sendRequest($request);
1702
+	}
1703
+	/**
1704
+	 * Retrieves information for Users using a subset of query DSL
1705
+	 *
1706
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html
1707
+	 *
1708
+	 * @param array{
1709
+	 *     with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated with the user
1710
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1711
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1712
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1713
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1714
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1715
+	 *     body: array, //  From, size, query, sort and search_after
1716
+	 * } $params
1717
+	 *
1718
+	 * @throws NoNodeAvailableException if all the hosts are offline
1719
+	 * @throws ClientResponseException if the status code of response is 4xx
1720
+	 * @throws ServerResponseException if the status code of response is 5xx
1721
+	 *
1722
+	 * @return Elasticsearch|Promise
1723
+	 */
1724
+	public function queryUser(array $params = [])
1725
+	{
1726
+		$url = '/_security/_query/user';
1727
+		$method = empty($params['body']) ? 'GET' : 'POST';
1728
+		$url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1729
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1730
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1731
+		$request = $this->addOtelAttributes($params, [], $request, 'security.query_user');
1732
+		return $this->client->sendRequest($request);
1733
+	}
1734
+	/**
1735
+	 * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair
1736
+	 *
1737
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html
1738
+	 *
1739
+	 * @param array{
1740
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1741
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1742
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1743
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1744
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1745
+	 *     body: array, // (REQUIRED) The SAML response to authenticate
1746
+	 * } $params
1747
+	 *
1748
+	 * @throws NoNodeAvailableException if all the hosts are offline
1749
+	 * @throws ClientResponseException if the status code of response is 4xx
1750
+	 * @throws ServerResponseException if the status code of response is 5xx
1751
+	 *
1752
+	 * @return Elasticsearch|Promise
1753
+	 */
1754
+	public function samlAuthenticate(array $params = [])
1755
+	{
1756
+		$this->checkRequiredParameters(['body'], $params);
1757
+		$url = '/_security/saml/authenticate';
1758
+		$method = 'POST';
1759
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1760
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1761
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1762
+		$request = $this->addOtelAttributes($params, [], $request, 'security.saml_authenticate');
1763
+		return $this->client->sendRequest($request);
1764
+	}
1765
+	/**
1766
+	 * Verifies the logout response sent from the SAML IdP
1767
+	 *
1768
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html
1769
+	 *
1770
+	 * @param array{
1771
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1772
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1773
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1774
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1775
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1776
+	 *     body: array, // (REQUIRED) The logout response to verify
1777
+	 * } $params
1778
+	 *
1779
+	 * @throws NoNodeAvailableException if all the hosts are offline
1780
+	 * @throws ClientResponseException if the status code of response is 4xx
1781
+	 * @throws ServerResponseException if the status code of response is 5xx
1782
+	 *
1783
+	 * @return Elasticsearch|Promise
1784
+	 */
1785
+	public function samlCompleteLogout(array $params = [])
1786
+	{
1787
+		$this->checkRequiredParameters(['body'], $params);
1788
+		$url = '/_security/saml/complete_logout';
1789
+		$method = 'POST';
1790
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1791
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1792
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1793
+		$request = $this->addOtelAttributes($params, [], $request, 'security.saml_complete_logout');
1794
+		return $this->client->sendRequest($request);
1795
+	}
1796
+	/**
1797
+	 * Consumes a SAML LogoutRequest
1798
+	 *
1799
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html
1800
+	 *
1801
+	 * @param array{
1802
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1803
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1804
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1805
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1806
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1807
+	 *     body: array, // (REQUIRED) The LogoutRequest message
1808
+	 * } $params
1809
+	 *
1810
+	 * @throws NoNodeAvailableException if all the hosts are offline
1811
+	 * @throws ClientResponseException if the status code of response is 4xx
1812
+	 * @throws ServerResponseException if the status code of response is 5xx
1813
+	 *
1814
+	 * @return Elasticsearch|Promise
1815
+	 */
1816
+	public function samlInvalidate(array $params = [])
1817
+	{
1818
+		$this->checkRequiredParameters(['body'], $params);
1819
+		$url = '/_security/saml/invalidate';
1820
+		$method = 'POST';
1821
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1822
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1823
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1824
+		$request = $this->addOtelAttributes($params, [], $request, 'security.saml_invalidate');
1825
+		return $this->client->sendRequest($request);
1826
+	}
1827
+	/**
1828
+	 * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API
1829
+	 *
1830
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html
1831
+	 *
1832
+	 * @param array{
1833
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1834
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1835
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1836
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1837
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1838
+	 *     body: array, // (REQUIRED) The tokens to invalidate
1839
+	 * } $params
1840
+	 *
1841
+	 * @throws NoNodeAvailableException if all the hosts are offline
1842
+	 * @throws ClientResponseException if the status code of response is 4xx
1843
+	 * @throws ServerResponseException if the status code of response is 5xx
1844
+	 *
1845
+	 * @return Elasticsearch|Promise
1846
+	 */
1847
+	public function samlLogout(array $params = [])
1848
+	{
1849
+		$this->checkRequiredParameters(['body'], $params);
1850
+		$url = '/_security/saml/logout';
1851
+		$method = 'POST';
1852
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1853
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1854
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1855
+		$request = $this->addOtelAttributes($params, [], $request, 'security.saml_logout');
1856
+		return $this->client->sendRequest($request);
1857
+	}
1858
+	/**
1859
+	 * Creates a SAML authentication request
1860
+	 *
1861
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html
1862
+	 *
1863
+	 * @param array{
1864
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1865
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1866
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1867
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1868
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1869
+	 *     body: array, // (REQUIRED) The realm for which to create the authentication request, identified by either its name or the ACS URL
1870
+	 * } $params
1871
+	 *
1872
+	 * @throws NoNodeAvailableException if all the hosts are offline
1873
+	 * @throws ClientResponseException if the status code of response is 4xx
1874
+	 * @throws ServerResponseException if the status code of response is 5xx
1875
+	 *
1876
+	 * @return Elasticsearch|Promise
1877
+	 */
1878
+	public function samlPrepareAuthentication(array $params = [])
1879
+	{
1880
+		$this->checkRequiredParameters(['body'], $params);
1881
+		$url = '/_security/saml/prepare';
1882
+		$method = 'POST';
1883
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1884
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1885
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1886
+		$request = $this->addOtelAttributes($params, [], $request, 'security.saml_prepare_authentication');
1887
+		return $this->client->sendRequest($request);
1888
+	}
1889
+	/**
1890
+	 * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
1891
+	 *
1892
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html
1893
+	 *
1894
+	 * @param array{
1895
+	 *     realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for
1896
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1897
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1898
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1899
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1900
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1901
+	 * } $params
1902
+	 *
1903
+	 * @throws MissingParameterException if a required parameter is missing
1904
+	 * @throws NoNodeAvailableException if all the hosts are offline
1905
+	 * @throws ClientResponseException if the status code of response is 4xx
1906
+	 * @throws ServerResponseException if the status code of response is 5xx
1907
+	 *
1908
+	 * @return Elasticsearch|Promise
1909
+	 */
1910
+	public function samlServiceProviderMetadata(array $params = [])
1911
+	{
1912
+		$this->checkRequiredParameters(['realm_name'], $params);
1913
+		$url = '/_security/saml/metadata/' . $this->encode($params['realm_name']);
1914
+		$method = 'GET';
1915
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1916
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1917
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1918
+		$request = $this->addOtelAttributes($params, ['realm_name'], $request, 'security.saml_service_provider_metadata');
1919
+		return $this->client->sendRequest($request);
1920
+	}
1921
+	/**
1922
+	 * Get suggestions for user profiles that match specified search criteria.
1923
+	 *
1924
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html
1925
+	 *
1926
+	 * @param array{
1927
+	 *     data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
1928
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1929
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1930
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1931
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1932
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1933
+	 *     body: array, //  The suggestion definition for user profiles
1934
+	 * } $params
1935
+	 *
1936
+	 * @throws NoNodeAvailableException if all the hosts are offline
1937
+	 * @throws ClientResponseException if the status code of response is 4xx
1938
+	 * @throws ServerResponseException if the status code of response is 5xx
1939
+	 *
1940
+	 * @return Elasticsearch|Promise
1941
+	 */
1942
+	public function suggestUserProfiles(array $params = [])
1943
+	{
1944
+		$url = '/_security/profile/_suggest';
1945
+		$method = empty($params['body']) ? 'GET' : 'POST';
1946
+		$url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
1947
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1948
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1949
+		$request = $this->addOtelAttributes($params, [], $request, 'security.suggest_user_profiles');
1950
+		return $this->client->sendRequest($request);
1951
+	}
1952
+	/**
1953
+	 * Updates attributes of an existing API key.
1954
+	 *
1955
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html
1956
+	 *
1957
+	 * @param array{
1958
+	 *     id: string, // (REQUIRED) The ID of the API key to update
1959
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1960
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1961
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1962
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1963
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1964
+	 *     body: array, //  The API key request to update attributes of an API key.
1965
+	 * } $params
1966
+	 *
1967
+	 * @throws MissingParameterException if a required parameter is missing
1968
+	 * @throws NoNodeAvailableException if all the hosts are offline
1969
+	 * @throws ClientResponseException if the status code of response is 4xx
1970
+	 * @throws ServerResponseException if the status code of response is 5xx
1971
+	 *
1972
+	 * @return Elasticsearch|Promise
1973
+	 */
1974
+	public function updateApiKey(array $params = [])
1975
+	{
1976
+		$this->checkRequiredParameters(['id'], $params);
1977
+		$url = '/_security/api_key/' . $this->encode($params['id']);
1978
+		$method = 'PUT';
1979
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
1980
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
1981
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
1982
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_api_key');
1983
+		return $this->client->sendRequest($request);
1984
+	}
1985
+	/**
1986
+	 * Updates attributes of an existing cross-cluster API key.
1987
+	 *
1988
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html
1989
+	 *
1990
+	 * @param array{
1991
+	 *     id: string, // (REQUIRED) The ID of the cross-cluster API key to update
1992
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1993
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1994
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1995
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1996
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
1997
+	 *     body: array, // (REQUIRED) The request to update attributes of a cross-cluster API key.
1998
+	 * } $params
1999
+	 *
2000
+	 * @throws MissingParameterException if a required parameter is missing
2001
+	 * @throws NoNodeAvailableException if all the hosts are offline
2002
+	 * @throws ClientResponseException if the status code of response is 4xx
2003
+	 * @throws ServerResponseException if the status code of response is 5xx
2004
+	 *
2005
+	 * @return Elasticsearch|Promise
2006
+	 */
2007
+	public function updateCrossClusterApiKey(array $params = [])
2008
+	{
2009
+		$this->checkRequiredParameters(['id', 'body'], $params);
2010
+		$url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']);
2011
+		$method = 'PUT';
2012
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
2013
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2014
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
2015
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_cross_cluster_api_key');
2016
+		return $this->client->sendRequest($request);
2017
+	}
2018
+	/**
2019
+	 * Update settings for the security system index
2020
+	 *
2021
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html
2022
+	 *
2023
+	 * @param array{
2024
+	 *     master_timeout: time, // Timeout for connection to master
2025
+	 *     timeout: time, // Timeout for acknowledgements from all nodes
2026
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2027
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2028
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2029
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2030
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2031
+	 *     body: array, // (REQUIRED) An object with the new settings for each index, if any
2032
+	 * } $params
2033
+	 *
2034
+	 * @throws NoNodeAvailableException if all the hosts are offline
2035
+	 * @throws ClientResponseException if the status code of response is 4xx
2036
+	 * @throws ServerResponseException if the status code of response is 5xx
2037
+	 *
2038
+	 * @return Elasticsearch|Promise
2039
+	 */
2040
+	public function updateSettings(array $params = [])
2041
+	{
2042
+		$this->checkRequiredParameters(['body'], $params);
2043
+		$url = '/_security/settings';
2044
+		$method = 'PUT';
2045
+		$url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2046
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2047
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
2048
+		$request = $this->addOtelAttributes($params, [], $request, 'security.update_settings');
2049
+		return $this->client->sendRequest($request);
2050
+	}
2051
+	/**
2052
+	 * Update application specific data for the user profile of the given unique ID.
2053
+	 *
2054
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html
2055
+	 *
2056
+	 * @param array{
2057
+	 *     uid: string, // (REQUIRED) An unique identifier of the user profile
2058
+	 *     if_seq_no: number, // only perform the update operation if the last operation that has changed the document has the specified sequence number
2059
+	 *     if_primary_term: number, // only perform the update operation if the last operation that has changed the document has the specified primary term
2060
+	 *     refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
2061
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2062
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2063
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2064
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2065
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
2066
+	 *     body: array, // (REQUIRED) The application data to update
2067
+	 * } $params
2068
+	 *
2069
+	 * @throws MissingParameterException if a required parameter is missing
2070
+	 * @throws NoNodeAvailableException if all the hosts are offline
2071
+	 * @throws ClientResponseException if the status code of response is 4xx
2072
+	 * @throws ServerResponseException if the status code of response is 5xx
2073
+	 *
2074
+	 * @return Elasticsearch|Promise
2075
+	 */
2076
+	public function updateUserProfileData(array $params = [])
2077
+	{
2078
+		$this->checkRequiredParameters(['uid', 'body'], $params);
2079
+		$url = '/_security/profile/' . $this->encode($params['uid']) . '/_data';
2080
+		$method = 'PUT';
2081
+		$url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
2082
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
2083
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
2084
+		$request = $this->addOtelAttributes($params, ['uid'], $request, 'security.update_user_profile_data');
2085
+		return $this->client->sendRequest($request);
2086
+	}
2087 2087
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Tasks.php 3 patches
Spacing   +3 added lines, -3 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;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function cancel(array $params = [])
54 54
     {
55 55
         if (isset($params['task_id'])) {
56
-            $url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel';
56
+            $url = '/_tasks/'.$this->encode($params['task_id']).'/_cancel';
57 57
             $method = 'POST';
58 58
         } else {
59 59
             $url = '/_tasks/_cancel';
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     public function get(array $params = [])
91 91
     {
92 92
         $this->checkRequiredParameters(['task_id'], $params);
93
-        $url = '/_tasks/' . $this->encode($params['task_id']);
93
+        $url = '/_tasks/'.$this->encode($params['task_id']);
94 94
         $method = 'GET';
95 95
         $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
96 96
         $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 Tasks extends AbstractEndpoint
27
-{
26
+class Tasks extends AbstractEndpoint {
28 27
     /**
29 28
      * Cancels a task, if it can be cancelled through an API.
30 29
      *
Please login to merge, or discard this patch.
Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -25,116 +25,116 @@
 block discarded – undo
25 25
  */
26 26
 class Tasks extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Cancels a task, if it can be cancelled through an API.
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
32
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
33
-     *
34
-     * @param array{
35
-     *     task_id: string, //  Cancel the task with specified task id (node_id:task_number)
36
-     *     nodes: 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
37
-     *     actions: list, // A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
38
-     *     parent_task_id: string, // Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
39
-     *     wait_for_completion: boolean, // Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
40
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
41
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
42
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
43
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
45
-     * } $params
46
-     *
47
-     * @throws NoNodeAvailableException if all the hosts are offline
48
-     * @throws ClientResponseException if the status code of response is 4xx
49
-     * @throws ServerResponseException if the status code of response is 5xx
50
-     *
51
-     * @return Elasticsearch|Promise
52
-     */
53
-    public function cancel(array $params = [])
54
-    {
55
-        if (isset($params['task_id'])) {
56
-            $url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel';
57
-            $method = 'POST';
58
-        } else {
59
-            $url = '/_tasks/_cancel';
60
-            $method = 'POST';
61
-        }
62
-        $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'parent_task_id', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
63
-        $headers = ['Accept' => 'application/json'];
64
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
65
-        $request = $this->addOtelAttributes($params, ['task_id'], $request, 'tasks.cancel');
66
-        return $this->client->sendRequest($request);
67
-    }
68
-    /**
69
-     * Returns information about a task.
70
-     *
71
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
72
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
73
-     *
74
-     * @param array{
75
-     *     task_id: string, // (REQUIRED) Return the task with specified id (node_id:task_number)
76
-     *     wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false)
77
-     *     timeout: time, // Explicit operation timeout
78
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
79
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
80
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
81
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
82
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
83
-     * } $params
84
-     *
85
-     * @throws MissingParameterException if a required parameter is missing
86
-     * @throws NoNodeAvailableException if all the hosts are offline
87
-     * @throws ClientResponseException if the status code of response is 4xx
88
-     * @throws ServerResponseException if the status code of response is 5xx
89
-     *
90
-     * @return Elasticsearch|Promise
91
-     */
92
-    public function get(array $params = [])
93
-    {
94
-        $this->checkRequiredParameters(['task_id'], $params);
95
-        $url = '/_tasks/' . $this->encode($params['task_id']);
96
-        $method = 'GET';
97
-        $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
98
-        $headers = ['Accept' => 'application/json'];
99
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
100
-        $request = $this->addOtelAttributes($params, ['task_id'], $request, 'tasks.get');
101
-        return $this->client->sendRequest($request);
102
-    }
103
-    /**
104
-     * Returns a list of tasks.
105
-     *
106
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
107
-     * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
108
-     *
109
-     * @param array{
110
-     *     nodes: 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
111
-     *     actions: list, // A comma-separated list of actions that should be returned. Leave empty to return all.
112
-     *     detailed: boolean, // Return detailed task information (default: false)
113
-     *     parent_task_id: string, // Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.
114
-     *     wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false)
115
-     *     group_by: enum, // Group tasks by nodes or parent/child relationships
116
-     *     timeout: time, // Explicit operation timeout
117
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
118
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
119
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
120
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
121
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
122
-     * } $params
123
-     *
124
-     * @throws NoNodeAvailableException if all the hosts are offline
125
-     * @throws ClientResponseException if the status code of response is 4xx
126
-     * @throws ServerResponseException if the status code of response is 5xx
127
-     *
128
-     * @return Elasticsearch|Promise
129
-     */
130
-    public function list(array $params = [])
131
-    {
132
-        $url = '/_tasks';
133
-        $method = 'GET';
134
-        $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'detailed', 'parent_task_id', 'wait_for_completion', 'group_by', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
135
-        $headers = ['Accept' => 'application/json'];
136
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
137
-        $request = $this->addOtelAttributes($params, [], $request, 'tasks.list');
138
-        return $this->client->sendRequest($request);
139
-    }
28
+	/**
29
+	 * Cancels a task, if it can be cancelled through an API.
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
32
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
33
+	 *
34
+	 * @param array{
35
+	 *     task_id: string, //  Cancel the task with specified task id (node_id:task_number)
36
+	 *     nodes: 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
37
+	 *     actions: list, // A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
38
+	 *     parent_task_id: string, // Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
39
+	 *     wait_for_completion: boolean, // Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
40
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
41
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
42
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
43
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
45
+	 * } $params
46
+	 *
47
+	 * @throws NoNodeAvailableException if all the hosts are offline
48
+	 * @throws ClientResponseException if the status code of response is 4xx
49
+	 * @throws ServerResponseException if the status code of response is 5xx
50
+	 *
51
+	 * @return Elasticsearch|Promise
52
+	 */
53
+	public function cancel(array $params = [])
54
+	{
55
+		if (isset($params['task_id'])) {
56
+			$url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel';
57
+			$method = 'POST';
58
+		} else {
59
+			$url = '/_tasks/_cancel';
60
+			$method = 'POST';
61
+		}
62
+		$url = $this->addQueryString($url, $params, ['nodes', 'actions', 'parent_task_id', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
63
+		$headers = ['Accept' => 'application/json'];
64
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
65
+		$request = $this->addOtelAttributes($params, ['task_id'], $request, 'tasks.cancel');
66
+		return $this->client->sendRequest($request);
67
+	}
68
+	/**
69
+	 * Returns information about a task.
70
+	 *
71
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
72
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
73
+	 *
74
+	 * @param array{
75
+	 *     task_id: string, // (REQUIRED) Return the task with specified id (node_id:task_number)
76
+	 *     wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false)
77
+	 *     timeout: time, // Explicit operation timeout
78
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
79
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
80
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
81
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
82
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
83
+	 * } $params
84
+	 *
85
+	 * @throws MissingParameterException if a required parameter is missing
86
+	 * @throws NoNodeAvailableException if all the hosts are offline
87
+	 * @throws ClientResponseException if the status code of response is 4xx
88
+	 * @throws ServerResponseException if the status code of response is 5xx
89
+	 *
90
+	 * @return Elasticsearch|Promise
91
+	 */
92
+	public function get(array $params = [])
93
+	{
94
+		$this->checkRequiredParameters(['task_id'], $params);
95
+		$url = '/_tasks/' . $this->encode($params['task_id']);
96
+		$method = 'GET';
97
+		$url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
98
+		$headers = ['Accept' => 'application/json'];
99
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
100
+		$request = $this->addOtelAttributes($params, ['task_id'], $request, 'tasks.get');
101
+		return $this->client->sendRequest($request);
102
+	}
103
+	/**
104
+	 * Returns a list of tasks.
105
+	 *
106
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
107
+	 * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
108
+	 *
109
+	 * @param array{
110
+	 *     nodes: 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
111
+	 *     actions: list, // A comma-separated list of actions that should be returned. Leave empty to return all.
112
+	 *     detailed: boolean, // Return detailed task information (default: false)
113
+	 *     parent_task_id: string, // Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.
114
+	 *     wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false)
115
+	 *     group_by: enum, // Group tasks by nodes or parent/child relationships
116
+	 *     timeout: time, // Explicit operation timeout
117
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
118
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
119
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
120
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
121
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
122
+	 * } $params
123
+	 *
124
+	 * @throws NoNodeAvailableException if all the hosts are offline
125
+	 * @throws ClientResponseException if the status code of response is 4xx
126
+	 * @throws ServerResponseException if the status code of response is 5xx
127
+	 *
128
+	 * @return Elasticsearch|Promise
129
+	 */
130
+	public function list(array $params = [])
131
+	{
132
+		$url = '/_tasks';
133
+		$method = 'GET';
134
+		$url = $this->addQueryString($url, $params, ['nodes', 'actions', 'detailed', 'parent_task_id', 'wait_for_completion', 'group_by', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
135
+		$headers = ['Accept' => 'application/json'];
136
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
137
+		$request = $this->addOtelAttributes($params, [], $request, 'tasks.list');
138
+		return $this->client->sendRequest($request);
139
+	}
140 140
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Sql.php 3 patches
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;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     public function deleteAsync(array $params = [])
79 79
     {
80 80
         $this->checkRequiredParameters(['id'], $params);
81
-        $url = '/_sql/async/delete/' . $this->encode($params['id']);
81
+        $url = '/_sql/async/delete/'.$this->encode($params['id']);
82 82
         $method = 'DELETE';
83 83
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
84 84
         $headers = ['Accept' => 'application/json'];
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function getAsync(array $params = [])
113 113
     {
114 114
         $this->checkRequiredParameters(['id'], $params);
115
-        $url = '/_sql/async/' . $this->encode($params['id']);
115
+        $url = '/_sql/async/'.$this->encode($params['id']);
116 116
         $method = 'GET';
117 117
         $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
118 118
         $headers = ['Accept' => 'application/json'];
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function getAsyncStatus(array $params = [])
143 143
     {
144 144
         $this->checkRequiredParameters(['id'], $params);
145
-        $url = '/_sql/async/status/' . $this->encode($params['id']);
145
+        $url = '/_sql/async/status/'.$this->encode($params['id']);
146 146
         $method = 'GET';
147 147
         $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
148 148
         $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 Sql extends AbstractEndpoint
27
-{
26
+class Sql extends AbstractEndpoint {
28 27
     /**
29 28
      * Clears the SQL cursor
30 29
      *
Please login to merge, or discard this patch.
Indentation   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -25,198 +25,198 @@
 block discarded – undo
25 25
  */
26 26
 class Sql extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Clears the SQL cursor
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html
32
-     *
33
-     * @param array{
34
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
35
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
36
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
37
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
38
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
39
-     *     body: array, // (REQUIRED) Specify the cursor value in the `cursor` element to clean the cursor.
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 clearCursor(array $params = [])
49
-    {
50
-        $this->checkRequiredParameters(['body'], $params);
51
-        $url = '/_sql/close';
52
-        $method = 'POST';
53
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
54
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
55
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
56
-        $request = $this->addOtelAttributes($params, [], $request, 'sql.clear_cursor');
57
-        return $this->client->sendRequest($request);
58
-    }
59
-    /**
60
-     * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.
61
-     *
62
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html
63
-     *
64
-     * @param array{
65
-     *     id: string, // (REQUIRED) The async search ID
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 MissingParameterException if a required parameter is missing
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 deleteAsync(array $params = [])
81
-    {
82
-        $this->checkRequiredParameters(['id'], $params);
83
-        $url = '/_sql/async/delete/' . $this->encode($params['id']);
84
-        $method = 'DELETE';
85
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
86
-        $headers = ['Accept' => 'application/json'];
87
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
88
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.delete_async');
89
-        return $this->client->sendRequest($request);
90
-    }
91
-    /**
92
-     * Returns the current status and available results for an async SQL search or stored synchronous SQL search
93
-     *
94
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html
95
-     *
96
-     * @param array{
97
-     *     id: string, // (REQUIRED) The async search ID
98
-     *     delimiter: string, // Separator for CSV results
99
-     *     format: string, // Short version of the Accept header, e.g. json, yaml
100
-     *     keep_alive: time, // Retention period for the search and its results
101
-     *     wait_for_completion_timeout: time, // Duration to wait for complete results
102
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
103
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
104
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
105
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
106
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
107
-     * } $params
108
-     *
109
-     * @throws MissingParameterException if a required parameter is missing
110
-     * @throws NoNodeAvailableException if all the hosts are offline
111
-     * @throws ClientResponseException if the status code of response is 4xx
112
-     * @throws ServerResponseException if the status code of response is 5xx
113
-     *
114
-     * @return Elasticsearch|Promise
115
-     */
116
-    public function getAsync(array $params = [])
117
-    {
118
-        $this->checkRequiredParameters(['id'], $params);
119
-        $url = '/_sql/async/' . $this->encode($params['id']);
120
-        $method = 'GET';
121
-        $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
122
-        $headers = ['Accept' => 'application/json'];
123
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
124
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async');
125
-        return $this->client->sendRequest($request);
126
-    }
127
-    /**
128
-     * Returns the current status of an async SQL search or a stored synchronous SQL search
129
-     *
130
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html
131
-     *
132
-     * @param array{
133
-     *     id: string, // (REQUIRED) The async search ID
134
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
135
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
136
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
137
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
138
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
139
-     * } $params
140
-     *
141
-     * @throws MissingParameterException if a required parameter is missing
142
-     * @throws NoNodeAvailableException if all the hosts are offline
143
-     * @throws ClientResponseException if the status code of response is 4xx
144
-     * @throws ServerResponseException if the status code of response is 5xx
145
-     *
146
-     * @return Elasticsearch|Promise
147
-     */
148
-    public function getAsyncStatus(array $params = [])
149
-    {
150
-        $this->checkRequiredParameters(['id'], $params);
151
-        $url = '/_sql/async/status/' . $this->encode($params['id']);
152
-        $method = 'GET';
153
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
154
-        $headers = ['Accept' => 'application/json'];
155
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
156
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async_status');
157
-        return $this->client->sendRequest($request);
158
-    }
159
-    /**
160
-     * Executes a SQL request
161
-     *
162
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html
163
-     *
164
-     * @param array{
165
-     *     format: string, // a short version of the Accept header, e.g. json, yaml
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
-     *     body: array, // (REQUIRED) Use the `query` element to start a query. Use the `cursor` element to continue a query.
172
-     * } $params
173
-     *
174
-     * @throws NoNodeAvailableException if all the hosts are offline
175
-     * @throws ClientResponseException if the status code of response is 4xx
176
-     * @throws ServerResponseException if the status code of response is 5xx
177
-     *
178
-     * @return Elasticsearch|Promise
179
-     */
180
-    public function query(array $params = [])
181
-    {
182
-        $this->checkRequiredParameters(['body'], $params);
183
-        $url = '/_sql';
184
-        $method = empty($params['body']) ? 'GET' : 'POST';
185
-        $url = $this->addQueryString($url, $params, ['format', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
186
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
187
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
188
-        $request = $this->addOtelAttributes($params, [], $request, 'sql.query');
189
-        return $this->client->sendRequest($request);
190
-    }
191
-    /**
192
-     * Translates SQL into Elasticsearch queries
193
-     *
194
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html
195
-     *
196
-     * @param array{
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
-     *     body: array, // (REQUIRED) Specify the query in the `query` element.
203
-     * } $params
204
-     *
205
-     * @throws NoNodeAvailableException if all the hosts are offline
206
-     * @throws ClientResponseException if the status code of response is 4xx
207
-     * @throws ServerResponseException if the status code of response is 5xx
208
-     *
209
-     * @return Elasticsearch|Promise
210
-     */
211
-    public function translate(array $params = [])
212
-    {
213
-        $this->checkRequiredParameters(['body'], $params);
214
-        $url = '/_sql/translate';
215
-        $method = empty($params['body']) ? 'GET' : 'POST';
216
-        $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
217
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
218
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
219
-        $request = $this->addOtelAttributes($params, [], $request, 'sql.translate');
220
-        return $this->client->sendRequest($request);
221
-    }
28
+	/**
29
+	 * Clears the SQL cursor
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html
32
+	 *
33
+	 * @param array{
34
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
35
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
36
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
37
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
38
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
39
+	 *     body: array, // (REQUIRED) Specify the cursor value in the `cursor` element to clean the cursor.
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 clearCursor(array $params = [])
49
+	{
50
+		$this->checkRequiredParameters(['body'], $params);
51
+		$url = '/_sql/close';
52
+		$method = 'POST';
53
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
54
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
55
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
56
+		$request = $this->addOtelAttributes($params, [], $request, 'sql.clear_cursor');
57
+		return $this->client->sendRequest($request);
58
+	}
59
+	/**
60
+	 * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.
61
+	 *
62
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html
63
+	 *
64
+	 * @param array{
65
+	 *     id: string, // (REQUIRED) The async search ID
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 MissingParameterException if a required parameter is missing
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 deleteAsync(array $params = [])
81
+	{
82
+		$this->checkRequiredParameters(['id'], $params);
83
+		$url = '/_sql/async/delete/' . $this->encode($params['id']);
84
+		$method = 'DELETE';
85
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
86
+		$headers = ['Accept' => 'application/json'];
87
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
88
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'sql.delete_async');
89
+		return $this->client->sendRequest($request);
90
+	}
91
+	/**
92
+	 * Returns the current status and available results for an async SQL search or stored synchronous SQL search
93
+	 *
94
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html
95
+	 *
96
+	 * @param array{
97
+	 *     id: string, // (REQUIRED) The async search ID
98
+	 *     delimiter: string, // Separator for CSV results
99
+	 *     format: string, // Short version of the Accept header, e.g. json, yaml
100
+	 *     keep_alive: time, // Retention period for the search and its results
101
+	 *     wait_for_completion_timeout: time, // Duration to wait for complete results
102
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
103
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
104
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
105
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
106
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
107
+	 * } $params
108
+	 *
109
+	 * @throws MissingParameterException if a required parameter is missing
110
+	 * @throws NoNodeAvailableException if all the hosts are offline
111
+	 * @throws ClientResponseException if the status code of response is 4xx
112
+	 * @throws ServerResponseException if the status code of response is 5xx
113
+	 *
114
+	 * @return Elasticsearch|Promise
115
+	 */
116
+	public function getAsync(array $params = [])
117
+	{
118
+		$this->checkRequiredParameters(['id'], $params);
119
+		$url = '/_sql/async/' . $this->encode($params['id']);
120
+		$method = 'GET';
121
+		$url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
122
+		$headers = ['Accept' => 'application/json'];
123
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
124
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async');
125
+		return $this->client->sendRequest($request);
126
+	}
127
+	/**
128
+	 * Returns the current status of an async SQL search or a stored synchronous SQL search
129
+	 *
130
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html
131
+	 *
132
+	 * @param array{
133
+	 *     id: string, // (REQUIRED) The async search ID
134
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
135
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
136
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
137
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
138
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
139
+	 * } $params
140
+	 *
141
+	 * @throws MissingParameterException if a required parameter is missing
142
+	 * @throws NoNodeAvailableException if all the hosts are offline
143
+	 * @throws ClientResponseException if the status code of response is 4xx
144
+	 * @throws ServerResponseException if the status code of response is 5xx
145
+	 *
146
+	 * @return Elasticsearch|Promise
147
+	 */
148
+	public function getAsyncStatus(array $params = [])
149
+	{
150
+		$this->checkRequiredParameters(['id'], $params);
151
+		$url = '/_sql/async/status/' . $this->encode($params['id']);
152
+		$method = 'GET';
153
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
154
+		$headers = ['Accept' => 'application/json'];
155
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
156
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async_status');
157
+		return $this->client->sendRequest($request);
158
+	}
159
+	/**
160
+	 * Executes a SQL request
161
+	 *
162
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html
163
+	 *
164
+	 * @param array{
165
+	 *     format: string, // a short version of the Accept header, e.g. json, yaml
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
+	 *     body: array, // (REQUIRED) Use the `query` element to start a query. Use the `cursor` element to continue a query.
172
+	 * } $params
173
+	 *
174
+	 * @throws NoNodeAvailableException if all the hosts are offline
175
+	 * @throws ClientResponseException if the status code of response is 4xx
176
+	 * @throws ServerResponseException if the status code of response is 5xx
177
+	 *
178
+	 * @return Elasticsearch|Promise
179
+	 */
180
+	public function query(array $params = [])
181
+	{
182
+		$this->checkRequiredParameters(['body'], $params);
183
+		$url = '/_sql';
184
+		$method = empty($params['body']) ? 'GET' : 'POST';
185
+		$url = $this->addQueryString($url, $params, ['format', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
186
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
187
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
188
+		$request = $this->addOtelAttributes($params, [], $request, 'sql.query');
189
+		return $this->client->sendRequest($request);
190
+	}
191
+	/**
192
+	 * Translates SQL into Elasticsearch queries
193
+	 *
194
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html
195
+	 *
196
+	 * @param array{
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
+	 *     body: array, // (REQUIRED) Specify the query in the `query` element.
203
+	 * } $params
204
+	 *
205
+	 * @throws NoNodeAvailableException if all the hosts are offline
206
+	 * @throws ClientResponseException if the status code of response is 4xx
207
+	 * @throws ServerResponseException if the status code of response is 5xx
208
+	 *
209
+	 * @return Elasticsearch|Promise
210
+	 */
211
+	public function translate(array $params = [])
212
+	{
213
+		$this->checkRequiredParameters(['body'], $params);
214
+		$url = '/_sql/translate';
215
+		$method = empty($params['body']) ? 'GET' : 'POST';
216
+		$url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']);
217
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
218
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
219
+		$request = $this->addOtelAttributes($params, [], $request, 'sql.translate');
220
+		return $this->client->sendRequest($request);
221
+	}
222 222
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Endpoints/Esql.php 3 patches
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;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function asyncQueryGet(array $params = [])
86 86
     {
87 87
         $this->checkRequiredParameters(['id'], $params);
88
-        $url = '/_query/async/' . $this->encode($params['id']);
88
+        $url = '/_query/async/'.$this->encode($params['id']);
89 89
         $method = 'GET';
90 90
         $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
91 91
         $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 Esql extends AbstractEndpoint
27
-{
26
+class Esql extends AbstractEndpoint {
28 27
     /**
29 28
      * Executes an ESQL request asynchronously
30 29
      *
Please login to merge, or discard this patch.
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -25,107 +25,107 @@
 block discarded – undo
25 25
  */
26 26
 class Esql extends AbstractEndpoint
27 27
 {
28
-    /**
29
-     * Executes an ESQL request asynchronously
30
-     *
31
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html
32
-     *
33
-     * @param array{
34
-     *     format: string, // a short version of the Accept header, e.g. json, yaml
35
-     *     delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format.
36
-     *     drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
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
-     *     body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.
43
-     * } $params
44
-     *
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 asyncQuery(array $params = [])
52
-    {
53
-        $this->checkRequiredParameters(['body'], $params);
54
-        $url = '/_query/async';
55
-        $method = 'POST';
56
-        $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
57
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
58
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
59
-        $request = $this->addOtelAttributes($params, [], $request, 'esql.async_query');
60
-        return $this->client->sendRequest($request);
61
-    }
62
-    /**
63
-     * Retrieves the results of a previously submitted async query request given its ID.
64
-     *
65
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html
66
-     *
67
-     * @param array{
68
-     *     id: string, // (REQUIRED) The async query ID
69
-     *     wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response
70
-     *     keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available
71
-     *     drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
72
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
73
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
74
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
75
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
76
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
77
-     * } $params
78
-     *
79
-     * @throws MissingParameterException if a required parameter is missing
80
-     * @throws NoNodeAvailableException if all the hosts are offline
81
-     * @throws ClientResponseException if the status code of response is 4xx
82
-     * @throws ServerResponseException if the status code of response is 5xx
83
-     *
84
-     * @return Elasticsearch|Promise
85
-     */
86
-    public function asyncQueryGet(array $params = [])
87
-    {
88
-        $this->checkRequiredParameters(['id'], $params);
89
-        $url = '/_query/async/' . $this->encode($params['id']);
90
-        $method = 'GET';
91
-        $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
92
-        $headers = ['Accept' => 'application/json'];
93
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
94
-        $request = $this->addOtelAttributes($params, ['id'], $request, 'esql.async_query_get');
95
-        return $this->client->sendRequest($request);
96
-    }
97
-    /**
98
-     * Executes an ESQL request
99
-     *
100
-     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html
101
-     *
102
-     * @param array{
103
-     *     format: string, // a short version of the Accept header, e.g. json, yaml
104
-     *     delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format.
105
-     *     drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
106
-     *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
107
-     *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
108
-     *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
109
-     *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
110
-     *     filter_path: list, // A comma-separated list of filters used to reduce the response.
111
-     *     body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.
112
-     * } $params
113
-     *
114
-     * @throws NoNodeAvailableException if all the hosts are offline
115
-     * @throws ClientResponseException if the status code of response is 4xx
116
-     * @throws ServerResponseException if the status code of response is 5xx
117
-     *
118
-     * @return Elasticsearch|Promise
119
-     */
120
-    public function query(array $params = [])
121
-    {
122
-        $this->checkRequiredParameters(['body'], $params);
123
-        $url = '/_query';
124
-        $method = 'POST';
125
-        $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
126
-        $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
127
-        $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
128
-        $request = $this->addOtelAttributes($params, [], $request, 'esql.query');
129
-        return $this->client->sendRequest($request);
130
-    }
28
+	/**
29
+	 * Executes an ESQL request asynchronously
30
+	 *
31
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html
32
+	 *
33
+	 * @param array{
34
+	 *     format: string, // a short version of the Accept header, e.g. json, yaml
35
+	 *     delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format.
36
+	 *     drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
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
+	 *     body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.
43
+	 * } $params
44
+	 *
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 asyncQuery(array $params = [])
52
+	{
53
+		$this->checkRequiredParameters(['body'], $params);
54
+		$url = '/_query/async';
55
+		$method = 'POST';
56
+		$url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
57
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
58
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
59
+		$request = $this->addOtelAttributes($params, [], $request, 'esql.async_query');
60
+		return $this->client->sendRequest($request);
61
+	}
62
+	/**
63
+	 * Retrieves the results of a previously submitted async query request given its ID.
64
+	 *
65
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html
66
+	 *
67
+	 * @param array{
68
+	 *     id: string, // (REQUIRED) The async query ID
69
+	 *     wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response
70
+	 *     keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available
71
+	 *     drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
72
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
73
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
74
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
75
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
76
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
77
+	 * } $params
78
+	 *
79
+	 * @throws MissingParameterException if a required parameter is missing
80
+	 * @throws NoNodeAvailableException if all the hosts are offline
81
+	 * @throws ClientResponseException if the status code of response is 4xx
82
+	 * @throws ServerResponseException if the status code of response is 5xx
83
+	 *
84
+	 * @return Elasticsearch|Promise
85
+	 */
86
+	public function asyncQueryGet(array $params = [])
87
+	{
88
+		$this->checkRequiredParameters(['id'], $params);
89
+		$url = '/_query/async/' . $this->encode($params['id']);
90
+		$method = 'GET';
91
+		$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
92
+		$headers = ['Accept' => 'application/json'];
93
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
94
+		$request = $this->addOtelAttributes($params, ['id'], $request, 'esql.async_query_get');
95
+		return $this->client->sendRequest($request);
96
+	}
97
+	/**
98
+	 * Executes an ESQL request
99
+	 *
100
+	 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html
101
+	 *
102
+	 * @param array{
103
+	 *     format: string, // a short version of the Accept header, e.g. json, yaml
104
+	 *     delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format.
105
+	 *     drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
106
+	 *     pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
107
+	 *     human: boolean, // Return human readable values for statistics. (DEFAULT: true)
108
+	 *     error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
109
+	 *     source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
110
+	 *     filter_path: list, // A comma-separated list of filters used to reduce the response.
111
+	 *     body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.
112
+	 * } $params
113
+	 *
114
+	 * @throws NoNodeAvailableException if all the hosts are offline
115
+	 * @throws ClientResponseException if the status code of response is 4xx
116
+	 * @throws ServerResponseException if the status code of response is 5xx
117
+	 *
118
+	 * @return Elasticsearch|Promise
119
+	 */
120
+	public function query(array $params = [])
121
+	{
122
+		$this->checkRequiredParameters(['body'], $params);
123
+		$url = '/_query';
124
+		$method = 'POST';
125
+		$url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']);
126
+		$headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json'];
127
+		$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
128
+		$request = $this->addOtelAttributes($params, [], $request, 'esql.query');
129
+		return $this->client->sendRequest($request);
130
+	}
131 131
 }
Please login to merge, or discard this patch.