elasticsearch 8.11.1__py3-none-any.whl → 8.12.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. elasticsearch/_async/client/__init__.py +493 -347
  2. elasticsearch/_async/client/async_search.py +108 -72
  3. elasticsearch/_async/client/autoscaling.py +13 -8
  4. elasticsearch/_async/client/cat.py +26 -26
  5. elasticsearch/_async/client/ccr.py +178 -117
  6. elasticsearch/_async/client/cluster.py +56 -48
  7. elasticsearch/_async/client/dangling_indices.py +3 -3
  8. elasticsearch/_async/client/enrich.py +15 -13
  9. elasticsearch/_async/client/eql.py +53 -36
  10. elasticsearch/_async/client/esql.py +99 -0
  11. elasticsearch/_async/client/features.py +2 -2
  12. elasticsearch/_async/client/fleet.py +111 -71
  13. elasticsearch/_async/client/graph.py +13 -11
  14. elasticsearch/_async/client/ilm.py +33 -27
  15. elasticsearch/_async/client/indices.py +326 -227
  16. elasticsearch/_async/client/inference.py +212 -0
  17. elasticsearch/_async/client/ingest.py +28 -24
  18. elasticsearch/_async/client/license.py +15 -13
  19. elasticsearch/_async/client/logstash.py +13 -10
  20. elasticsearch/_async/client/migration.py +3 -3
  21. elasticsearch/_async/client/ml.py +758 -538
  22. elasticsearch/_async/client/monitoring.py +10 -5
  23. elasticsearch/_async/client/nodes.py +13 -11
  24. elasticsearch/_async/client/query_ruleset.py +12 -10
  25. elasticsearch/_async/client/rollup.py +59 -46
  26. elasticsearch/_async/client/search_application.py +23 -16
  27. elasticsearch/_async/client/searchable_snapshots.py +23 -16
  28. elasticsearch/_async/client/security.py +391 -289
  29. elasticsearch/_async/client/shutdown.py +18 -14
  30. elasticsearch/_async/client/slm.py +23 -21
  31. elasticsearch/_async/client/snapshot.py +91 -65
  32. elasticsearch/_async/client/sql.py +81 -58
  33. elasticsearch/_async/client/ssl.py +1 -1
  34. elasticsearch/_async/client/synonyms.py +23 -19
  35. elasticsearch/_async/client/tasks.py +3 -3
  36. elasticsearch/_async/client/text_structure.py +10 -5
  37. elasticsearch/_async/client/transform.py +111 -75
  38. elasticsearch/_async/client/watcher.py +77 -55
  39. elasticsearch/_async/client/xpack.py +2 -2
  40. elasticsearch/_async/helpers.py +1 -1
  41. elasticsearch/_sync/client/__init__.py +493 -347
  42. elasticsearch/_sync/client/async_search.py +108 -72
  43. elasticsearch/_sync/client/autoscaling.py +13 -8
  44. elasticsearch/_sync/client/cat.py +26 -26
  45. elasticsearch/_sync/client/ccr.py +178 -117
  46. elasticsearch/_sync/client/cluster.py +56 -48
  47. elasticsearch/_sync/client/dangling_indices.py +3 -3
  48. elasticsearch/_sync/client/enrich.py +15 -13
  49. elasticsearch/_sync/client/eql.py +53 -36
  50. elasticsearch/_sync/client/esql.py +99 -0
  51. elasticsearch/_sync/client/features.py +2 -2
  52. elasticsearch/_sync/client/fleet.py +111 -71
  53. elasticsearch/_sync/client/graph.py +13 -11
  54. elasticsearch/_sync/client/ilm.py +33 -27
  55. elasticsearch/_sync/client/indices.py +326 -227
  56. elasticsearch/_sync/client/inference.py +212 -0
  57. elasticsearch/_sync/client/ingest.py +28 -24
  58. elasticsearch/_sync/client/license.py +15 -13
  59. elasticsearch/_sync/client/logstash.py +13 -10
  60. elasticsearch/_sync/client/migration.py +3 -3
  61. elasticsearch/_sync/client/ml.py +758 -538
  62. elasticsearch/_sync/client/monitoring.py +10 -5
  63. elasticsearch/_sync/client/nodes.py +13 -11
  64. elasticsearch/_sync/client/query_ruleset.py +12 -10
  65. elasticsearch/_sync/client/rollup.py +59 -46
  66. elasticsearch/_sync/client/search_application.py +23 -16
  67. elasticsearch/_sync/client/searchable_snapshots.py +23 -16
  68. elasticsearch/_sync/client/security.py +391 -289
  69. elasticsearch/_sync/client/shutdown.py +18 -14
  70. elasticsearch/_sync/client/slm.py +23 -21
  71. elasticsearch/_sync/client/snapshot.py +91 -65
  72. elasticsearch/_sync/client/sql.py +81 -58
  73. elasticsearch/_sync/client/ssl.py +1 -1
  74. elasticsearch/_sync/client/synonyms.py +23 -19
  75. elasticsearch/_sync/client/tasks.py +3 -3
  76. elasticsearch/_sync/client/text_structure.py +10 -5
  77. elasticsearch/_sync/client/transform.py +111 -75
  78. elasticsearch/_sync/client/utils.py +34 -10
  79. elasticsearch/_sync/client/watcher.py +77 -55
  80. elasticsearch/_sync/client/xpack.py +2 -2
  81. elasticsearch/_version.py +1 -1
  82. elasticsearch/client.py +2 -0
  83. elasticsearch/helpers/actions.py +1 -1
  84. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/METADATA +2 -3
  85. elasticsearch-8.12.0.dist-info/RECORD +103 -0
  86. elasticsearch-8.11.1.dist-info/RECORD +0 -99
  87. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/LICENSE +0 -0
  88. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/NOTICE +0 -0
  89. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/WHEEL +0 -0
  90. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/top_level.txt +0 -0
@@ -40,7 +40,7 @@ class TransformClient(NamespacedClient):
40
40
  """
41
41
  Deletes an existing transform.
42
42
 
43
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/delete-transform.html>`_
43
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-transform.html>`_
44
44
 
45
45
  :param transform_id: Identifier for the transform.
46
46
  :param delete_dest_index: If this value is true, the destination index is deleted
@@ -94,7 +94,7 @@ class TransformClient(NamespacedClient):
94
94
  """
95
95
  Retrieves configuration information for transforms.
96
96
 
97
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-transform.html>`_
97
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-transform.html>`_
98
98
 
99
99
  :param transform_id: Identifier for the transform. It can be a transform identifier
100
100
  or a wildcard expression. You can get information for all transforms by using
@@ -155,7 +155,7 @@ class TransformClient(NamespacedClient):
155
155
  """
156
156
  Retrieves usage information for transforms.
157
157
 
158
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-transform-stats.html>`_
158
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-transform-stats.html>`_
159
159
 
160
160
  :param transform_id: Identifier for the transform. It can be a transform identifier
161
161
  or a wildcard expression. You can get information for all transforms by using
@@ -195,7 +195,17 @@ class TransformClient(NamespacedClient):
195
195
  )
196
196
 
197
197
  @_rewrite_parameters(
198
- body_fields=True,
198
+ body_fields=(
199
+ "description",
200
+ "dest",
201
+ "frequency",
202
+ "latest",
203
+ "pivot",
204
+ "retention_policy",
205
+ "settings",
206
+ "source",
207
+ "sync",
208
+ ),
199
209
  )
200
210
  async def preview_transform(
201
211
  self,
@@ -215,11 +225,12 @@ class TransformClient(NamespacedClient):
215
225
  source: t.Optional[t.Mapping[str, t.Any]] = None,
216
226
  sync: t.Optional[t.Mapping[str, t.Any]] = None,
217
227
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
228
+ body: t.Optional[t.Dict[str, t.Any]] = None,
218
229
  ) -> ObjectApiResponse[t.Any]:
219
230
  """
220
231
  Previews a transform.
221
232
 
222
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/preview-transform.html>`_
233
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/preview-transform.html>`_
223
234
 
224
235
  :param transform_id: Identifier for the transform to preview. If you specify
225
236
  this path parameter, you cannot provide transform configuration details in
@@ -247,36 +258,37 @@ class TransformClient(NamespacedClient):
247
258
  __path = f"/_transform/{_quote(transform_id)}/_preview"
248
259
  else:
249
260
  __path = "/_transform/_preview"
250
- __body: t.Dict[str, t.Any] = {}
251
261
  __query: t.Dict[str, t.Any] = {}
252
- if description is not None:
253
- __body["description"] = description
254
- if dest is not None:
255
- __body["dest"] = dest
262
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
256
263
  if error_trace is not None:
257
264
  __query["error_trace"] = error_trace
258
265
  if filter_path is not None:
259
266
  __query["filter_path"] = filter_path
260
- if frequency is not None:
261
- __body["frequency"] = frequency
262
267
  if human is not None:
263
268
  __query["human"] = human
264
- if latest is not None:
265
- __body["latest"] = latest
266
- if pivot is not None:
267
- __body["pivot"] = pivot
268
269
  if pretty is not None:
269
270
  __query["pretty"] = pretty
270
- if retention_policy is not None:
271
- __body["retention_policy"] = retention_policy
272
- if settings is not None:
273
- __body["settings"] = settings
274
- if source is not None:
275
- __body["source"] = source
276
- if sync is not None:
277
- __body["sync"] = sync
278
271
  if timeout is not None:
279
272
  __query["timeout"] = timeout
273
+ if not __body:
274
+ if description is not None:
275
+ __body["description"] = description
276
+ if dest is not None:
277
+ __body["dest"] = dest
278
+ if frequency is not None:
279
+ __body["frequency"] = frequency
280
+ if latest is not None:
281
+ __body["latest"] = latest
282
+ if pivot is not None:
283
+ __body["pivot"] = pivot
284
+ if retention_policy is not None:
285
+ __body["retention_policy"] = retention_policy
286
+ if settings is not None:
287
+ __body["settings"] = settings
288
+ if source is not None:
289
+ __body["source"] = source
290
+ if sync is not None:
291
+ __body["sync"] = sync
280
292
  if not __body:
281
293
  __body = None # type: ignore[assignment]
282
294
  __headers = {"accept": "application/json"}
@@ -287,15 +299,26 @@ class TransformClient(NamespacedClient):
287
299
  )
288
300
 
289
301
  @_rewrite_parameters(
290
- body_fields=True,
302
+ body_fields=(
303
+ "dest",
304
+ "source",
305
+ "description",
306
+ "frequency",
307
+ "latest",
308
+ "meta",
309
+ "pivot",
310
+ "retention_policy",
311
+ "settings",
312
+ "sync",
313
+ ),
291
314
  parameter_aliases={"_meta": "meta"},
292
315
  )
293
316
  async def put_transform(
294
317
  self,
295
318
  *,
296
319
  transform_id: str,
297
- dest: t.Mapping[str, t.Any],
298
- source: t.Mapping[str, t.Any],
320
+ dest: t.Optional[t.Mapping[str, t.Any]] = None,
321
+ source: t.Optional[t.Mapping[str, t.Any]] = None,
299
322
  defer_validation: t.Optional[bool] = None,
300
323
  description: t.Optional[str] = None,
301
324
  error_trace: t.Optional[bool] = None,
@@ -310,11 +333,12 @@ class TransformClient(NamespacedClient):
310
333
  settings: t.Optional[t.Mapping[str, t.Any]] = None,
311
334
  sync: t.Optional[t.Mapping[str, t.Any]] = None,
312
335
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
336
+ body: t.Optional[t.Dict[str, t.Any]] = None,
313
337
  ) -> ObjectApiResponse[t.Any]:
314
338
  """
315
339
  Instantiates a transform.
316
340
 
317
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/put-transform.html>`_
341
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-transform.html>`_
318
342
 
319
343
  :param transform_id: Identifier for the transform. This identifier can contain
320
344
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -348,45 +372,46 @@ class TransformClient(NamespacedClient):
348
372
  """
349
373
  if transform_id in SKIP_IN_PATH:
350
374
  raise ValueError("Empty value passed for parameter 'transform_id'")
351
- if dest is None:
375
+ if dest is None and body is None:
352
376
  raise ValueError("Empty value passed for parameter 'dest'")
353
- if source is None:
377
+ if source is None and body is None:
354
378
  raise ValueError("Empty value passed for parameter 'source'")
355
379
  __path = f"/_transform/{_quote(transform_id)}"
356
- __body: t.Dict[str, t.Any] = {}
357
380
  __query: t.Dict[str, t.Any] = {}
358
- if dest is not None:
359
- __body["dest"] = dest
360
- if source is not None:
361
- __body["source"] = source
381
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
362
382
  if defer_validation is not None:
363
383
  __query["defer_validation"] = defer_validation
364
- if description is not None:
365
- __body["description"] = description
366
384
  if error_trace is not None:
367
385
  __query["error_trace"] = error_trace
368
386
  if filter_path is not None:
369
387
  __query["filter_path"] = filter_path
370
- if frequency is not None:
371
- __body["frequency"] = frequency
372
388
  if human is not None:
373
389
  __query["human"] = human
374
- if latest is not None:
375
- __body["latest"] = latest
376
- if meta is not None:
377
- __body["_meta"] = meta
378
- if pivot is not None:
379
- __body["pivot"] = pivot
380
390
  if pretty is not None:
381
391
  __query["pretty"] = pretty
382
- if retention_policy is not None:
383
- __body["retention_policy"] = retention_policy
384
- if settings is not None:
385
- __body["settings"] = settings
386
- if sync is not None:
387
- __body["sync"] = sync
388
392
  if timeout is not None:
389
393
  __query["timeout"] = timeout
394
+ if not __body:
395
+ if dest is not None:
396
+ __body["dest"] = dest
397
+ if source is not None:
398
+ __body["source"] = source
399
+ if description is not None:
400
+ __body["description"] = description
401
+ if frequency is not None:
402
+ __body["frequency"] = frequency
403
+ if latest is not None:
404
+ __body["latest"] = latest
405
+ if meta is not None:
406
+ __body["_meta"] = meta
407
+ if pivot is not None:
408
+ __body["pivot"] = pivot
409
+ if retention_policy is not None:
410
+ __body["retention_policy"] = retention_policy
411
+ if settings is not None:
412
+ __body["settings"] = settings
413
+ if sync is not None:
414
+ __body["sync"] = sync
390
415
  __headers = {"accept": "application/json", "content-type": "application/json"}
391
416
  return await self.perform_request( # type: ignore[return-value]
392
417
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -406,7 +431,7 @@ class TransformClient(NamespacedClient):
406
431
  """
407
432
  Resets an existing transform.
408
433
 
409
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/reset-transform.html>`_
434
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/reset-transform.html>`_
410
435
 
411
436
  :param transform_id: Identifier for the transform. This identifier can contain
412
437
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -448,7 +473,7 @@ class TransformClient(NamespacedClient):
448
473
  """
449
474
  Schedules now a transform.
450
475
 
451
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/schedule-now-transform.html>`_
476
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/schedule-now-transform.html>`_
452
477
 
453
478
  :param transform_id: Identifier for the transform.
454
479
  :param timeout: Controls the time to wait for the scheduling to take place
@@ -489,7 +514,7 @@ class TransformClient(NamespacedClient):
489
514
  """
490
515
  Starts one or more transforms.
491
516
 
492
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/start-transform.html>`_
517
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/start-transform.html>`_
493
518
 
494
519
  :param transform_id: Identifier for the transform.
495
520
  :param from_: Restricts the set of transformed entities to those changed after
@@ -537,7 +562,7 @@ class TransformClient(NamespacedClient):
537
562
  """
538
563
  Stops one or more transforms.
539
564
 
540
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/stop-transform.html>`_
565
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/stop-transform.html>`_
541
566
 
542
567
  :param transform_id: Identifier for the transform. To stop multiple transforms,
543
568
  use a comma-separated list or a wildcard expression. To stop all transforms,
@@ -589,7 +614,16 @@ class TransformClient(NamespacedClient):
589
614
  )
590
615
 
591
616
  @_rewrite_parameters(
592
- body_fields=True,
617
+ body_fields=(
618
+ "description",
619
+ "dest",
620
+ "frequency",
621
+ "meta",
622
+ "retention_policy",
623
+ "settings",
624
+ "source",
625
+ "sync",
626
+ ),
593
627
  parameter_aliases={"_meta": "meta"},
594
628
  )
595
629
  async def update_transform(
@@ -610,11 +644,12 @@ class TransformClient(NamespacedClient):
610
644
  source: t.Optional[t.Mapping[str, t.Any]] = None,
611
645
  sync: t.Optional[t.Mapping[str, t.Any]] = None,
612
646
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
647
+ body: t.Optional[t.Dict[str, t.Any]] = None,
613
648
  ) -> ObjectApiResponse[t.Any]:
614
649
  """
615
650
  Updates certain properties of a transform.
616
651
 
617
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/update-transform.html>`_
652
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-transform.html>`_
618
653
 
619
654
  :param transform_id: Identifier for the transform.
620
655
  :param defer_validation: When true, deferrable validations are not run. This
@@ -639,35 +674,36 @@ class TransformClient(NamespacedClient):
639
674
  raise ValueError("Empty value passed for parameter 'transform_id'")
640
675
  __path = f"/_transform/{_quote(transform_id)}/_update"
641
676
  __query: t.Dict[str, t.Any] = {}
642
- __body: t.Dict[str, t.Any] = {}
677
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
643
678
  if defer_validation is not None:
644
679
  __query["defer_validation"] = defer_validation
645
- if description is not None:
646
- __body["description"] = description
647
- if dest is not None:
648
- __body["dest"] = dest
649
680
  if error_trace is not None:
650
681
  __query["error_trace"] = error_trace
651
682
  if filter_path is not None:
652
683
  __query["filter_path"] = filter_path
653
- if frequency is not None:
654
- __body["frequency"] = frequency
655
684
  if human is not None:
656
685
  __query["human"] = human
657
- if meta is not None:
658
- __body["_meta"] = meta
659
686
  if pretty is not None:
660
687
  __query["pretty"] = pretty
661
- if retention_policy is not None:
662
- __body["retention_policy"] = retention_policy
663
- if settings is not None:
664
- __body["settings"] = settings
665
- if source is not None:
666
- __body["source"] = source
667
- if sync is not None:
668
- __body["sync"] = sync
669
688
  if timeout is not None:
670
689
  __query["timeout"] = timeout
690
+ if not __body:
691
+ if description is not None:
692
+ __body["description"] = description
693
+ if dest is not None:
694
+ __body["dest"] = dest
695
+ if frequency is not None:
696
+ __body["frequency"] = frequency
697
+ if meta is not None:
698
+ __body["_meta"] = meta
699
+ if retention_policy is not None:
700
+ __body["retention_policy"] = retention_policy
701
+ if settings is not None:
702
+ __body["settings"] = settings
703
+ if source is not None:
704
+ __body["source"] = source
705
+ if sync is not None:
706
+ __body["sync"] = sync
671
707
  __headers = {"accept": "application/json", "content-type": "application/json"}
672
708
  return await self.perform_request( # type: ignore[return-value]
673
709
  "POST", __path, params=__query, headers=__headers, body=__body
@@ -687,7 +723,7 @@ class TransformClient(NamespacedClient):
687
723
  """
688
724
  Upgrades all transforms.
689
725
 
690
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/upgrade-transforms.html>`_
726
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/upgrade-transforms.html>`_
691
727
 
692
728
  :param dry_run: When true, the request checks for updates but does not run them.
693
729
  :param timeout: Period to wait for a response. If no response is received before
@@ -38,7 +38,7 @@ class WatcherClient(NamespacedClient):
38
38
  """
39
39
  Acknowledges a watch, manually throttling the execution of the watch's actions.
40
40
 
41
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-ack-watch.html>`_
41
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-ack-watch.html>`_
42
42
 
43
43
  :param watch_id: Watch ID
44
44
  :param action_id: A comma-separated list of the action ids to be acked
@@ -78,7 +78,7 @@ class WatcherClient(NamespacedClient):
78
78
  """
79
79
  Activates a currently inactive watch.
80
80
 
81
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-activate-watch.html>`_
81
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-activate-watch.html>`_
82
82
 
83
83
  :param watch_id: Watch ID
84
84
  """
@@ -112,7 +112,7 @@ class WatcherClient(NamespacedClient):
112
112
  """
113
113
  Deactivates a currently active watch.
114
114
 
115
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-deactivate-watch.html>`_
115
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-deactivate-watch.html>`_
116
116
 
117
117
  :param watch_id: Watch ID
118
118
  """
@@ -146,7 +146,7 @@ class WatcherClient(NamespacedClient):
146
146
  """
147
147
  Removes a watch from Watcher.
148
148
 
149
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-delete-watch.html>`_
149
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-delete-watch.html>`_
150
150
 
151
151
  :param id: Watch ID
152
152
  """
@@ -168,7 +168,15 @@ class WatcherClient(NamespacedClient):
168
168
  )
169
169
 
170
170
  @_rewrite_parameters(
171
- body_fields=True,
171
+ body_fields=(
172
+ "action_modes",
173
+ "alternative_input",
174
+ "ignore_condition",
175
+ "record_execution",
176
+ "simulated_actions",
177
+ "trigger_data",
178
+ "watch",
179
+ ),
172
180
  )
173
181
  async def execute_watch(
174
182
  self,
@@ -194,11 +202,12 @@ class WatcherClient(NamespacedClient):
194
202
  simulated_actions: t.Optional[t.Mapping[str, t.Any]] = None,
195
203
  trigger_data: t.Optional[t.Mapping[str, t.Any]] = None,
196
204
  watch: t.Optional[t.Mapping[str, t.Any]] = None,
205
+ body: t.Optional[t.Dict[str, t.Any]] = None,
197
206
  ) -> ObjectApiResponse[t.Any]:
198
207
  """
199
208
  Forces the execution of a stored watch.
200
209
 
201
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-execute-watch.html>`_
210
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-execute-watch.html>`_
202
211
 
203
212
  :param id: Identifier for the watch.
204
213
  :param action_modes: Determines how to handle the watch actions as part of the
@@ -223,12 +232,8 @@ class WatcherClient(NamespacedClient):
223
232
  __path = f"/_watcher/watch/{_quote(id)}/_execute"
224
233
  else:
225
234
  __path = "/_watcher/watch/_execute"
226
- __body: t.Dict[str, t.Any] = {}
227
235
  __query: t.Dict[str, t.Any] = {}
228
- if action_modes is not None:
229
- __body["action_modes"] = action_modes
230
- if alternative_input is not None:
231
- __body["alternative_input"] = alternative_input
236
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
232
237
  if debug is not None:
233
238
  __query["debug"] = debug
234
239
  if error_trace is not None:
@@ -237,18 +242,23 @@ class WatcherClient(NamespacedClient):
237
242
  __query["filter_path"] = filter_path
238
243
  if human is not None:
239
244
  __query["human"] = human
240
- if ignore_condition is not None:
241
- __body["ignore_condition"] = ignore_condition
242
245
  if pretty is not None:
243
246
  __query["pretty"] = pretty
244
- if record_execution is not None:
245
- __body["record_execution"] = record_execution
246
- if simulated_actions is not None:
247
- __body["simulated_actions"] = simulated_actions
248
- if trigger_data is not None:
249
- __body["trigger_data"] = trigger_data
250
- if watch is not None:
251
- __body["watch"] = watch
247
+ if not __body:
248
+ if action_modes is not None:
249
+ __body["action_modes"] = action_modes
250
+ if alternative_input is not None:
251
+ __body["alternative_input"] = alternative_input
252
+ if ignore_condition is not None:
253
+ __body["ignore_condition"] = ignore_condition
254
+ if record_execution is not None:
255
+ __body["record_execution"] = record_execution
256
+ if simulated_actions is not None:
257
+ __body["simulated_actions"] = simulated_actions
258
+ if trigger_data is not None:
259
+ __body["trigger_data"] = trigger_data
260
+ if watch is not None:
261
+ __body["watch"] = watch
252
262
  if not __body:
253
263
  __body = None # type: ignore[assignment]
254
264
  __headers = {"accept": "application/json"}
@@ -271,7 +281,7 @@ class WatcherClient(NamespacedClient):
271
281
  """
272
282
  Retrieves a watch by its ID.
273
283
 
274
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-get-watch.html>`_
284
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-get-watch.html>`_
275
285
 
276
286
  :param id: Watch ID
277
287
  """
@@ -293,7 +303,15 @@ class WatcherClient(NamespacedClient):
293
303
  )
294
304
 
295
305
  @_rewrite_parameters(
296
- body_fields=True,
306
+ body_fields=(
307
+ "actions",
308
+ "condition",
309
+ "input",
310
+ "metadata",
311
+ "throttle_period",
312
+ "transform",
313
+ "trigger",
314
+ ),
297
315
  )
298
316
  async def put_watch(
299
317
  self,
@@ -314,11 +332,12 @@ class WatcherClient(NamespacedClient):
314
332
  transform: t.Optional[t.Mapping[str, t.Any]] = None,
315
333
  trigger: t.Optional[t.Mapping[str, t.Any]] = None,
316
334
  version: t.Optional[int] = None,
335
+ body: t.Optional[t.Dict[str, t.Any]] = None,
317
336
  ) -> ObjectApiResponse[t.Any]:
318
337
  """
319
338
  Creates a new watch, or updates an existing one.
320
339
 
321
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-put-watch.html>`_
340
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-put-watch.html>`_
322
341
 
323
342
  :param id: Watch ID
324
343
  :param actions:
@@ -338,14 +357,10 @@ class WatcherClient(NamespacedClient):
338
357
  if id in SKIP_IN_PATH:
339
358
  raise ValueError("Empty value passed for parameter 'id'")
340
359
  __path = f"/_watcher/watch/{_quote(id)}"
341
- __body: t.Dict[str, t.Any] = {}
342
360
  __query: t.Dict[str, t.Any] = {}
343
- if actions is not None:
344
- __body["actions"] = actions
361
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
345
362
  if active is not None:
346
363
  __query["active"] = active
347
- if condition is not None:
348
- __body["condition"] = condition
349
364
  if error_trace is not None:
350
365
  __query["error_trace"] = error_trace
351
366
  if filter_path is not None:
@@ -356,20 +371,25 @@ class WatcherClient(NamespacedClient):
356
371
  __query["if_primary_term"] = if_primary_term
357
372
  if if_seq_no is not None:
358
373
  __query["if_seq_no"] = if_seq_no
359
- if input is not None:
360
- __body["input"] = input
361
- if metadata is not None:
362
- __body["metadata"] = metadata
363
374
  if pretty is not None:
364
375
  __query["pretty"] = pretty
365
- if throttle_period is not None:
366
- __body["throttle_period"] = throttle_period
367
- if transform is not None:
368
- __body["transform"] = transform
369
- if trigger is not None:
370
- __body["trigger"] = trigger
371
376
  if version is not None:
372
377
  __query["version"] = version
378
+ if not __body:
379
+ if actions is not None:
380
+ __body["actions"] = actions
381
+ if condition is not None:
382
+ __body["condition"] = condition
383
+ if input is not None:
384
+ __body["input"] = input
385
+ if metadata is not None:
386
+ __body["metadata"] = metadata
387
+ if throttle_period is not None:
388
+ __body["throttle_period"] = throttle_period
389
+ if transform is not None:
390
+ __body["transform"] = transform
391
+ if trigger is not None:
392
+ __body["trigger"] = trigger
373
393
  if not __body:
374
394
  __body = None # type: ignore[assignment]
375
395
  __headers = {"accept": "application/json"}
@@ -380,7 +400,7 @@ class WatcherClient(NamespacedClient):
380
400
  )
381
401
 
382
402
  @_rewrite_parameters(
383
- body_fields=True,
403
+ body_fields=("from_", "query", "search_after", "size", "sort"),
384
404
  parameter_aliases={"from": "from_"},
385
405
  )
386
406
  async def query_watches(
@@ -402,11 +422,12 @@ class WatcherClient(NamespacedClient):
402
422
  t.Union[str, t.Mapping[str, t.Any]],
403
423
  ]
404
424
  ] = None,
425
+ body: t.Optional[t.Dict[str, t.Any]] = None,
405
426
  ) -> ObjectApiResponse[t.Any]:
406
427
  """
407
428
  Retrieves stored watches.
408
429
 
409
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-query-watches.html>`_
430
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-query-watches.html>`_
410
431
 
411
432
  :param from_: The offset from the first result to fetch. Needs to be non-negative.
412
433
  :param query: Optional, query filter watches to be returned.
@@ -417,7 +438,7 @@ class WatcherClient(NamespacedClient):
417
438
  """
418
439
  __path = "/_watcher/_query/watches"
419
440
  __query: t.Dict[str, t.Any] = {}
420
- __body: t.Dict[str, t.Any] = {}
441
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
421
442
  # The 'sort' parameter with a colon can't be encoded to the body.
422
443
  if sort is not None and (
423
444
  (isinstance(sort, str) and ":" in sort)
@@ -433,20 +454,21 @@ class WatcherClient(NamespacedClient):
433
454
  __query["error_trace"] = error_trace
434
455
  if filter_path is not None:
435
456
  __query["filter_path"] = filter_path
436
- if from_ is not None:
437
- __body["from"] = from_
438
457
  if human is not None:
439
458
  __query["human"] = human
440
459
  if pretty is not None:
441
460
  __query["pretty"] = pretty
442
- if query is not None:
443
- __body["query"] = query
444
- if search_after is not None:
445
- __body["search_after"] = search_after
446
- if size is not None:
447
- __body["size"] = size
448
- if sort is not None:
449
- __body["sort"] = sort
461
+ if not __body:
462
+ if from_ is not None:
463
+ __body["from"] = from_
464
+ if query is not None:
465
+ __body["query"] = query
466
+ if search_after is not None:
467
+ __body["search_after"] = search_after
468
+ if size is not None:
469
+ __body["size"] = size
470
+ if sort is not None:
471
+ __body["sort"] = sort
450
472
  if not __body:
451
473
  __body = None # type: ignore[assignment]
452
474
  __headers = {"accept": "application/json"}
@@ -468,7 +490,7 @@ class WatcherClient(NamespacedClient):
468
490
  """
469
491
  Starts Watcher if it is not already running.
470
492
 
471
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-start.html>`_
493
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-start.html>`_
472
494
  """
473
495
  __path = "/_watcher/_start"
474
496
  __query: t.Dict[str, t.Any] = {}
@@ -512,7 +534,7 @@ class WatcherClient(NamespacedClient):
512
534
  """
513
535
  Retrieves the current Watcher metrics.
514
536
 
515
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-stats.html>`_
537
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-stats.html>`_
516
538
 
517
539
  :param metric: Defines which additional metrics are included in the response.
518
540
  :param emit_stacktraces: Defines whether stack traces are generated for each
@@ -550,7 +572,7 @@ class WatcherClient(NamespacedClient):
550
572
  """
551
573
  Stops Watcher if it is running.
552
574
 
553
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/watcher-api-stop.html>`_
575
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-stop.html>`_
554
576
  """
555
577
  __path = "/_watcher/_stop"
556
578
  __query: t.Dict[str, t.Any] = {}
@@ -43,7 +43,7 @@ class XPackClient(NamespacedClient):
43
43
  """
44
44
  Retrieves information about the installed X-Pack features.
45
45
 
46
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/info-api.html>`_
46
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/info-api.html>`_
47
47
 
48
48
  :param accept_enterprise: If this param is used it must be set to true
49
49
  :param categories: A comma-separated list of the information categories to include
@@ -83,7 +83,7 @@ class XPackClient(NamespacedClient):
83
83
  """
84
84
  Retrieves usage information about the installed X-Pack features.
85
85
 
86
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/usage-api.html>`_
86
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/usage-api.html>`_
87
87
 
88
88
  :param master_timeout: Period to wait for a connection to the master node. If
89
89
  no response is received before the timeout expires, the request fails and