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
@@ -52,7 +52,7 @@ class IndicesClient(NamespacedClient):
52
52
  """
53
53
  Adds a block to an index.
54
54
 
55
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/index-modules-blocks.html>`_
55
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/index-modules-blocks.html>`_
56
56
 
57
57
  :param index: A comma separated list of indices to add a block to
58
58
  :param block: The block to add (one of read, write, read_only or metadata)
@@ -96,7 +96,17 @@ class IndicesClient(NamespacedClient):
96
96
  )
97
97
 
98
98
  @_rewrite_parameters(
99
- body_fields=True,
99
+ body_fields=(
100
+ "analyzer",
101
+ "attributes",
102
+ "char_filter",
103
+ "explain",
104
+ "field",
105
+ "filter",
106
+ "normalizer",
107
+ "text",
108
+ "tokenizer",
109
+ ),
100
110
  )
101
111
  async def analyze(
102
112
  self,
@@ -115,12 +125,13 @@ class IndicesClient(NamespacedClient):
115
125
  pretty: t.Optional[bool] = None,
116
126
  text: t.Optional[t.Union[str, t.Sequence[str]]] = None,
117
127
  tokenizer: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None,
128
+ body: t.Optional[t.Dict[str, t.Any]] = None,
118
129
  ) -> ObjectApiResponse[t.Any]:
119
130
  """
120
131
  Performs the analysis process on a text and return the tokens breakdown of the
121
132
  text.
122
133
 
123
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-analyze.html>`_
134
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-analyze.html>`_
124
135
 
125
136
  :param index: Index used to derive the analyzer. If specified, the `analyzer`
126
137
  or field parameter overrides this value. If no index is specified or the
@@ -147,34 +158,35 @@ class IndicesClient(NamespacedClient):
147
158
  __path = f"/{_quote(index)}/_analyze"
148
159
  else:
149
160
  __path = "/_analyze"
150
- __body: t.Dict[str, t.Any] = {}
151
161
  __query: t.Dict[str, t.Any] = {}
152
- if analyzer is not None:
153
- __body["analyzer"] = analyzer
154
- if attributes is not None:
155
- __body["attributes"] = attributes
156
- if char_filter is not None:
157
- __body["char_filter"] = char_filter
162
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
158
163
  if error_trace is not None:
159
164
  __query["error_trace"] = error_trace
160
- if explain is not None:
161
- __body["explain"] = explain
162
- if field is not None:
163
- __body["field"] = field
164
- if filter is not None:
165
- __body["filter"] = filter
166
165
  if filter_path is not None:
167
166
  __query["filter_path"] = filter_path
168
167
  if human is not None:
169
168
  __query["human"] = human
170
- if normalizer is not None:
171
- __body["normalizer"] = normalizer
172
169
  if pretty is not None:
173
170
  __query["pretty"] = pretty
174
- if text is not None:
175
- __body["text"] = text
176
- if tokenizer is not None:
177
- __body["tokenizer"] = tokenizer
171
+ if not __body:
172
+ if analyzer is not None:
173
+ __body["analyzer"] = analyzer
174
+ if attributes is not None:
175
+ __body["attributes"] = attributes
176
+ if char_filter is not None:
177
+ __body["char_filter"] = char_filter
178
+ if explain is not None:
179
+ __body["explain"] = explain
180
+ if field is not None:
181
+ __body["field"] = field
182
+ if filter is not None:
183
+ __body["filter"] = filter
184
+ if normalizer is not None:
185
+ __body["normalizer"] = normalizer
186
+ if text is not None:
187
+ __body["text"] = text
188
+ if tokenizer is not None:
189
+ __body["tokenizer"] = tokenizer
178
190
  if not __body:
179
191
  __body = None # type: ignore[assignment]
180
192
  __headers = {"accept": "application/json"}
@@ -211,7 +223,7 @@ class IndicesClient(NamespacedClient):
211
223
  """
212
224
  Clears all or specific caches for one or more indices.
213
225
 
214
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-clearcache.html>`_
226
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-clearcache.html>`_
215
227
 
216
228
  :param index: Comma-separated list of data streams, indices, and aliases used
217
229
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -265,7 +277,7 @@ class IndicesClient(NamespacedClient):
265
277
  )
266
278
 
267
279
  @_rewrite_parameters(
268
- body_fields=True,
280
+ body_fields=("aliases", "settings"),
269
281
  )
270
282
  async def clone(
271
283
  self,
@@ -285,11 +297,12 @@ class IndicesClient(NamespacedClient):
285
297
  wait_for_active_shards: t.Optional[
286
298
  t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
287
299
  ] = None,
300
+ body: t.Optional[t.Dict[str, t.Any]] = None,
288
301
  ) -> ObjectApiResponse[t.Any]:
289
302
  """
290
303
  Clones an index
291
304
 
292
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-clone-index.html>`_
305
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-clone-index.html>`_
293
306
 
294
307
  :param index: Name of the source index to clone.
295
308
  :param target: Name of the target index to create.
@@ -309,10 +322,8 @@ class IndicesClient(NamespacedClient):
309
322
  if target in SKIP_IN_PATH:
310
323
  raise ValueError("Empty value passed for parameter 'target'")
311
324
  __path = f"/{_quote(index)}/_clone/{_quote(target)}"
312
- __body: t.Dict[str, t.Any] = {}
313
325
  __query: t.Dict[str, t.Any] = {}
314
- if aliases is not None:
315
- __body["aliases"] = aliases
326
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
316
327
  if error_trace is not None:
317
328
  __query["error_trace"] = error_trace
318
329
  if filter_path is not None:
@@ -323,12 +334,15 @@ class IndicesClient(NamespacedClient):
323
334
  __query["master_timeout"] = master_timeout
324
335
  if pretty is not None:
325
336
  __query["pretty"] = pretty
326
- if settings is not None:
327
- __body["settings"] = settings
328
337
  if timeout is not None:
329
338
  __query["timeout"] = timeout
330
339
  if wait_for_active_shards is not None:
331
340
  __query["wait_for_active_shards"] = wait_for_active_shards
341
+ if not __body:
342
+ if aliases is not None:
343
+ __body["aliases"] = aliases
344
+ if settings is not None:
345
+ __body["settings"] = settings
332
346
  if not __body:
333
347
  __body = None # type: ignore[assignment]
334
348
  __headers = {"accept": "application/json"}
@@ -368,7 +382,7 @@ class IndicesClient(NamespacedClient):
368
382
  """
369
383
  Closes an index.
370
384
 
371
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-close.html>`_
385
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-close.html>`_
372
386
 
373
387
  :param index: Comma-separated list or wildcard expression of index names used
374
388
  to limit the request.
@@ -420,7 +434,7 @@ class IndicesClient(NamespacedClient):
420
434
  )
421
435
 
422
436
  @_rewrite_parameters(
423
- body_fields=True,
437
+ body_fields=("aliases", "mappings", "settings"),
424
438
  )
425
439
  async def create(
426
440
  self,
@@ -440,11 +454,12 @@ class IndicesClient(NamespacedClient):
440
454
  wait_for_active_shards: t.Optional[
441
455
  t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
442
456
  ] = None,
457
+ body: t.Optional[t.Dict[str, t.Any]] = None,
443
458
  ) -> ObjectApiResponse[t.Any]:
444
459
  """
445
460
  Creates an index with optional settings and mappings.
446
461
 
447
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-create-index.html>`_
462
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-create-index.html>`_
448
463
 
449
464
  :param index: Name of the index you wish to create.
450
465
  :param aliases: Aliases for the index.
@@ -463,28 +478,29 @@ class IndicesClient(NamespacedClient):
463
478
  if index in SKIP_IN_PATH:
464
479
  raise ValueError("Empty value passed for parameter 'index'")
465
480
  __path = f"/{_quote(index)}"
466
- __body: t.Dict[str, t.Any] = {}
467
481
  __query: t.Dict[str, t.Any] = {}
468
- if aliases is not None:
469
- __body["aliases"] = aliases
482
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
470
483
  if error_trace is not None:
471
484
  __query["error_trace"] = error_trace
472
485
  if filter_path is not None:
473
486
  __query["filter_path"] = filter_path
474
487
  if human is not None:
475
488
  __query["human"] = human
476
- if mappings is not None:
477
- __body["mappings"] = mappings
478
489
  if master_timeout is not None:
479
490
  __query["master_timeout"] = master_timeout
480
491
  if pretty is not None:
481
492
  __query["pretty"] = pretty
482
- if settings is not None:
483
- __body["settings"] = settings
484
493
  if timeout is not None:
485
494
  __query["timeout"] = timeout
486
495
  if wait_for_active_shards is not None:
487
496
  __query["wait_for_active_shards"] = wait_for_active_shards
497
+ if not __body:
498
+ if aliases is not None:
499
+ __body["aliases"] = aliases
500
+ if mappings is not None:
501
+ __body["mappings"] = mappings
502
+ if settings is not None:
503
+ __body["settings"] = settings
488
504
  if not __body:
489
505
  __body = None # type: ignore[assignment]
490
506
  __headers = {"accept": "application/json"}
@@ -507,7 +523,7 @@ class IndicesClient(NamespacedClient):
507
523
  """
508
524
  Creates a data stream
509
525
 
510
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
526
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
511
527
 
512
528
  :param name: Name of the data stream, which must meet the following criteria:
513
529
  Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`,
@@ -553,7 +569,7 @@ class IndicesClient(NamespacedClient):
553
569
  """
554
570
  Provides statistics on operations happening in a data stream.
555
571
 
556
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
572
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
557
573
 
558
574
  :param name: Comma-separated list of data streams used to limit the request.
559
575
  Wildcard expressions (`*`) are supported. To target all data streams in a
@@ -608,7 +624,7 @@ class IndicesClient(NamespacedClient):
608
624
  """
609
625
  Deletes an index.
610
626
 
611
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-delete-index.html>`_
627
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-delete-index.html>`_
612
628
 
613
629
  :param index: Comma-separated list of indices to delete. You cannot specify index
614
630
  aliases. By default, this parameter does not support wildcards (`*`) or `_all`.
@@ -674,7 +690,7 @@ class IndicesClient(NamespacedClient):
674
690
  """
675
691
  Deletes an alias.
676
692
 
677
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-aliases.html>`_
693
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-aliases.html>`_
678
694
 
679
695
  :param index: Comma-separated list of data streams or indices used to limit the
680
696
  request. Supports wildcards (`*`).
@@ -734,7 +750,7 @@ class IndicesClient(NamespacedClient):
734
750
  """
735
751
  Deletes the data stream lifecycle of the selected data streams.
736
752
 
737
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams-delete-lifecycle.html>`_
753
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams-delete-lifecycle.html>`_
738
754
 
739
755
  :param name: A comma-separated list of data streams of which the data stream
740
756
  lifecycle will be deleted; use `*` to get all data streams
@@ -787,7 +803,7 @@ class IndicesClient(NamespacedClient):
787
803
  """
788
804
  Deletes a data stream.
789
805
 
790
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
806
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
791
807
 
792
808
  :param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions
793
809
  are supported.
@@ -830,7 +846,7 @@ class IndicesClient(NamespacedClient):
830
846
  """
831
847
  Deletes an index template.
832
848
 
833
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
849
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-delete-template.html>`_
834
850
 
835
851
  :param name: Comma-separated list of index template names used to limit the request.
836
852
  Wildcard (*) expressions are supported.
@@ -878,7 +894,7 @@ class IndicesClient(NamespacedClient):
878
894
  """
879
895
  Deletes an index template.
880
896
 
881
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
897
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-delete-template-v1.html>`_
882
898
 
883
899
  :param name: The name of the legacy index template to delete. Wildcard (`*`)
884
900
  expressions are supported.
@@ -934,7 +950,7 @@ class IndicesClient(NamespacedClient):
934
950
  """
935
951
  Analyzes the disk usage of each field of an index or data stream
936
952
 
937
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-disk-usage.html>`_
953
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-disk-usage.html>`_
938
954
 
939
955
  :param index: Comma-separated list of data streams, indices, and aliases used
940
956
  to limit the request. It’s recommended to execute this API with a single
@@ -991,7 +1007,8 @@ class IndicesClient(NamespacedClient):
991
1007
  *,
992
1008
  index: str,
993
1009
  target_index: str,
994
- config: t.Mapping[str, t.Any],
1010
+ config: t.Optional[t.Mapping[str, t.Any]] = None,
1011
+ body: t.Optional[t.Mapping[str, t.Any]] = None,
995
1012
  error_trace: t.Optional[bool] = None,
996
1013
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
997
1014
  human: t.Optional[bool] = None,
@@ -1000,7 +1017,7 @@ class IndicesClient(NamespacedClient):
1000
1017
  """
1001
1018
  Downsample an index
1002
1019
 
1003
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-downsample-data-stream.html>`_
1020
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-downsample-data-stream.html>`_
1004
1021
 
1005
1022
  :param index: Name of the time series index to downsample.
1006
1023
  :param target_index: Name of the index to create.
@@ -1010,8 +1027,12 @@ class IndicesClient(NamespacedClient):
1010
1027
  raise ValueError("Empty value passed for parameter 'index'")
1011
1028
  if target_index in SKIP_IN_PATH:
1012
1029
  raise ValueError("Empty value passed for parameter 'target_index'")
1013
- if config is None:
1014
- raise ValueError("Empty value passed for parameter 'config'")
1030
+ if config is None and body is None:
1031
+ raise ValueError(
1032
+ "Empty value passed for parameters 'config' and 'body', one of them should be set."
1033
+ )
1034
+ elif config is not None and body is not None:
1035
+ raise ValueError("Cannot set both 'config' and 'body'")
1015
1036
  __path = f"/{_quote(index)}/_downsample/{_quote(target_index)}"
1016
1037
  __query: t.Dict[str, t.Any] = {}
1017
1038
  if error_trace is not None:
@@ -1022,7 +1043,7 @@ class IndicesClient(NamespacedClient):
1022
1043
  __query["human"] = human
1023
1044
  if pretty is not None:
1024
1045
  __query["pretty"] = pretty
1025
- __body = config
1046
+ __body = config if config is not None else body
1026
1047
  __headers = {"accept": "application/json", "content-type": "application/json"}
1027
1048
  return await self.perform_request( # type: ignore[return-value]
1028
1049
  "POST", __path, params=__query, headers=__headers, body=__body
@@ -1054,7 +1075,7 @@ class IndicesClient(NamespacedClient):
1054
1075
  """
1055
1076
  Returns information about whether a particular index exists.
1056
1077
 
1057
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-exists.html>`_
1078
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-exists.html>`_
1058
1079
 
1059
1080
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1060
1081
  wildcards (`*`).
@@ -1126,7 +1147,7 @@ class IndicesClient(NamespacedClient):
1126
1147
  """
1127
1148
  Returns information about whether a particular alias exists.
1128
1149
 
1129
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-aliases.html>`_
1150
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-aliases.html>`_
1130
1151
 
1131
1152
  :param name: Comma-separated list of aliases to check. Supports wildcards (`*`).
1132
1153
  :param index: Comma-separated list of data streams or indices used to limit the
@@ -1190,7 +1211,7 @@ class IndicesClient(NamespacedClient):
1190
1211
  """
1191
1212
  Returns information about whether a particular index template exists.
1192
1213
 
1193
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
1214
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/index-templates.html>`_
1194
1215
 
1195
1216
  :param name: Comma-separated list of index template names used to limit the request.
1196
1217
  Wildcard (*) expressions are supported.
@@ -1235,7 +1256,7 @@ class IndicesClient(NamespacedClient):
1235
1256
  """
1236
1257
  Returns information about whether a particular index template exists.
1237
1258
 
1238
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
1259
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-template-exists-v1.html>`_
1239
1260
 
1240
1261
  :param name: The comma separated names of the index templates
1241
1262
  :param flat_settings: Return settings in flat format (default: false)
@@ -1284,7 +1305,7 @@ class IndicesClient(NamespacedClient):
1284
1305
  Retrieves information about the index's current data stream lifecycle, such as
1285
1306
  any potential encountered error, time since creation etc.
1286
1307
 
1287
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams-explain-lifecycle.html>`_
1308
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams-explain-lifecycle.html>`_
1288
1309
 
1289
1310
  :param index: The name of the index to explain
1290
1311
  :param include_defaults: indicates if the API should return the default values
@@ -1343,7 +1364,7 @@ class IndicesClient(NamespacedClient):
1343
1364
  """
1344
1365
  Returns the field usage stats for each field of an index
1345
1366
 
1346
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/field-usage-stats.html>`_
1367
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/field-usage-stats.html>`_
1347
1368
 
1348
1369
  :param index: Comma-separated list or wildcard expression of index names used
1349
1370
  to limit the request.
@@ -1425,7 +1446,7 @@ class IndicesClient(NamespacedClient):
1425
1446
  """
1426
1447
  Performs the flush operation on one or more indices.
1427
1448
 
1428
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-flush.html>`_
1449
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-flush.html>`_
1429
1450
 
1430
1451
  :param index: Comma-separated list of data streams, indices, and aliases to flush.
1431
1452
  Supports wildcards (`*`). To flush all data streams and indices, omit this
@@ -1500,7 +1521,7 @@ class IndicesClient(NamespacedClient):
1500
1521
  """
1501
1522
  Performs the force merge operation on one or more indices.
1502
1523
 
1503
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-forcemerge.html>`_
1524
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-forcemerge.html>`_
1504
1525
 
1505
1526
  :param index: A comma-separated list of index names; use `_all` or empty string
1506
1527
  to perform the operation on all indices
@@ -1589,7 +1610,7 @@ class IndicesClient(NamespacedClient):
1589
1610
  """
1590
1611
  Returns information about one or more indices.
1591
1612
 
1592
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-get-index.html>`_
1613
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-get-index.html>`_
1593
1614
 
1594
1615
  :param index: Comma-separated list of data streams, indices, and index aliases
1595
1616
  used to limit the request. Wildcard expressions (*) are supported.
@@ -1672,7 +1693,7 @@ class IndicesClient(NamespacedClient):
1672
1693
  """
1673
1694
  Returns an alias.
1674
1695
 
1675
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-aliases.html>`_
1696
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-aliases.html>`_
1676
1697
 
1677
1698
  :param index: Comma-separated list of data streams or indices used to limit the
1678
1699
  request. Supports wildcards (`*`). To target all data streams and indices,
@@ -1743,7 +1764,7 @@ class IndicesClient(NamespacedClient):
1743
1764
  """
1744
1765
  Returns the data stream lifecycle of the selected data streams.
1745
1766
 
1746
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams-get-lifecycle.html>`_
1767
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams-get-lifecycle.html>`_
1747
1768
 
1748
1769
  :param name: Comma-separated list of data streams to limit the request. Supports
1749
1770
  wildcards (`*`). To target all data streams, omit this parameter or use `*`
@@ -1796,7 +1817,7 @@ class IndicesClient(NamespacedClient):
1796
1817
  """
1797
1818
  Returns data streams.
1798
1819
 
1799
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
1820
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
1800
1821
 
1801
1822
  :param name: Comma-separated list of data stream names used to limit the request.
1802
1823
  Wildcard (`*`) expressions are supported. If omitted, all data streams are
@@ -1854,7 +1875,7 @@ class IndicesClient(NamespacedClient):
1854
1875
  """
1855
1876
  Returns mapping for one or more fields.
1856
1877
 
1857
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-get-field-mapping.html>`_
1878
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-get-field-mapping.html>`_
1858
1879
 
1859
1880
  :param fields: Comma-separated list or wildcard expression of fields used to
1860
1881
  limit returned information.
@@ -1925,7 +1946,7 @@ class IndicesClient(NamespacedClient):
1925
1946
  """
1926
1947
  Returns an index template.
1927
1948
 
1928
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
1949
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-get-template.html>`_
1929
1950
 
1930
1951
  :param name: Comma-separated list of index template names used to limit the request.
1931
1952
  Wildcard (*) expressions are supported.
@@ -1992,7 +2013,7 @@ class IndicesClient(NamespacedClient):
1992
2013
  """
1993
2014
  Returns mappings for one or more indices.
1994
2015
 
1995
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-get-mapping.html>`_
2016
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-get-mapping.html>`_
1996
2017
 
1997
2018
  :param index: Comma-separated list of data streams, indices, and aliases used
1998
2019
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2070,7 +2091,7 @@ class IndicesClient(NamespacedClient):
2070
2091
  """
2071
2092
  Returns settings for one or more indices.
2072
2093
 
2073
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-get-settings.html>`_
2094
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-get-settings.html>`_
2074
2095
 
2075
2096
  :param index: Comma-separated list of data streams, indices, and aliases used
2076
2097
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2149,7 +2170,7 @@ class IndicesClient(NamespacedClient):
2149
2170
  """
2150
2171
  Returns an index template.
2151
2172
 
2152
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
2173
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-get-template-v1.html>`_
2153
2174
 
2154
2175
  :param name: Comma-separated list of index template names used to limit the request.
2155
2176
  Wildcard (`*`) expressions are supported. To return all index templates,
@@ -2198,7 +2219,7 @@ class IndicesClient(NamespacedClient):
2198
2219
  """
2199
2220
  Migrates an alias to a data stream
2200
2221
 
2201
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
2222
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
2202
2223
 
2203
2224
  :param name: Name of the index alias to convert to a data stream.
2204
2225
  """
@@ -2220,31 +2241,30 @@ class IndicesClient(NamespacedClient):
2220
2241
  )
2221
2242
 
2222
2243
  @_rewrite_parameters(
2223
- body_fields=True,
2244
+ body_fields=("actions",),
2224
2245
  )
2225
2246
  async def modify_data_stream(
2226
2247
  self,
2227
2248
  *,
2228
- actions: t.Sequence[t.Mapping[str, t.Any]],
2249
+ actions: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
2229
2250
  error_trace: t.Optional[bool] = None,
2230
2251
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2231
2252
  human: t.Optional[bool] = None,
2232
2253
  pretty: t.Optional[bool] = None,
2254
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2233
2255
  ) -> ObjectApiResponse[t.Any]:
2234
2256
  """
2235
2257
  Modifies a data stream
2236
2258
 
2237
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
2259
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
2238
2260
 
2239
2261
  :param actions: Actions to perform.
2240
2262
  """
2241
- if actions is None:
2263
+ if actions is None and body is None:
2242
2264
  raise ValueError("Empty value passed for parameter 'actions'")
2243
2265
  __path = "/_data_stream/_modify"
2244
- __body: t.Dict[str, t.Any] = {}
2245
2266
  __query: t.Dict[str, t.Any] = {}
2246
- if actions is not None:
2247
- __body["actions"] = actions
2267
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2248
2268
  if error_trace is not None:
2249
2269
  __query["error_trace"] = error_trace
2250
2270
  if filter_path is not None:
@@ -2253,6 +2273,9 @@ class IndicesClient(NamespacedClient):
2253
2273
  __query["human"] = human
2254
2274
  if pretty is not None:
2255
2275
  __query["pretty"] = pretty
2276
+ if not __body:
2277
+ if actions is not None:
2278
+ __body["actions"] = actions
2256
2279
  __headers = {"accept": "application/json", "content-type": "application/json"}
2257
2280
  return await self.perform_request( # type: ignore[return-value]
2258
2281
  "POST", __path, params=__query, headers=__headers, body=__body
@@ -2288,7 +2311,7 @@ class IndicesClient(NamespacedClient):
2288
2311
  """
2289
2312
  Opens an index.
2290
2313
 
2291
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-open-close.html>`_
2314
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-open-close.html>`_
2292
2315
 
2293
2316
  :param index: Comma-separated list of data streams, indices, and aliases used
2294
2317
  to limit the request. Supports wildcards (`*`). By default, you must explicitly
@@ -2357,7 +2380,7 @@ class IndicesClient(NamespacedClient):
2357
2380
  Promotes a data stream from a replicated data stream managed by CCR to a regular
2358
2381
  data stream
2359
2382
 
2360
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams.html>`_
2383
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams.html>`_
2361
2384
 
2362
2385
  :param name: The name of the data stream
2363
2386
  """
@@ -2379,7 +2402,13 @@ class IndicesClient(NamespacedClient):
2379
2402
  )
2380
2403
 
2381
2404
  @_rewrite_parameters(
2382
- body_fields=True,
2405
+ body_fields=(
2406
+ "filter",
2407
+ "index_routing",
2408
+ "is_write_index",
2409
+ "routing",
2410
+ "search_routing",
2411
+ ),
2383
2412
  )
2384
2413
  async def put_alias(
2385
2414
  self,
@@ -2399,11 +2428,12 @@ class IndicesClient(NamespacedClient):
2399
2428
  routing: t.Optional[str] = None,
2400
2429
  search_routing: t.Optional[str] = None,
2401
2430
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2431
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2402
2432
  ) -> ObjectApiResponse[t.Any]:
2403
2433
  """
2404
2434
  Creates or updates an alias.
2405
2435
 
2406
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-aliases.html>`_
2436
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-aliases.html>`_
2407
2437
 
2408
2438
  :param index: Comma-separated list of data streams or indices to add. Supports
2409
2439
  wildcards (`*`). Wildcard patterns that match both data streams and indices
@@ -2437,29 +2467,30 @@ class IndicesClient(NamespacedClient):
2437
2467
  raise ValueError("Empty value passed for parameter 'name'")
2438
2468
  __path = f"/{_quote(index)}/_alias/{_quote(name)}"
2439
2469
  __query: t.Dict[str, t.Any] = {}
2440
- __body: t.Dict[str, t.Any] = {}
2470
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2441
2471
  if error_trace is not None:
2442
2472
  __query["error_trace"] = error_trace
2443
- if filter is not None:
2444
- __body["filter"] = filter
2445
2473
  if filter_path is not None:
2446
2474
  __query["filter_path"] = filter_path
2447
2475
  if human is not None:
2448
2476
  __query["human"] = human
2449
- if index_routing is not None:
2450
- __body["index_routing"] = index_routing
2451
- if is_write_index is not None:
2452
- __body["is_write_index"] = is_write_index
2453
2477
  if master_timeout is not None:
2454
2478
  __query["master_timeout"] = master_timeout
2455
2479
  if pretty is not None:
2456
2480
  __query["pretty"] = pretty
2457
- if routing is not None:
2458
- __body["routing"] = routing
2459
- if search_routing is not None:
2460
- __body["search_routing"] = search_routing
2461
2481
  if timeout is not None:
2462
2482
  __query["timeout"] = timeout
2483
+ if not __body:
2484
+ if filter is not None:
2485
+ __body["filter"] = filter
2486
+ if index_routing is not None:
2487
+ __body["index_routing"] = index_routing
2488
+ if is_write_index is not None:
2489
+ __body["is_write_index"] = is_write_index
2490
+ if routing is not None:
2491
+ __body["routing"] = routing
2492
+ if search_routing is not None:
2493
+ __body["search_routing"] = search_routing
2463
2494
  if not __body:
2464
2495
  __body = None # type: ignore[assignment]
2465
2496
  __headers = {"accept": "application/json"}
@@ -2470,7 +2501,7 @@ class IndicesClient(NamespacedClient):
2470
2501
  )
2471
2502
 
2472
2503
  @_rewrite_parameters(
2473
- body_fields=True,
2504
+ body_fields=("data_retention", "downsampling"),
2474
2505
  )
2475
2506
  async def put_data_lifecycle(
2476
2507
  self,
@@ -2496,11 +2527,12 @@ class IndicesClient(NamespacedClient):
2496
2527
  ] = None,
2497
2528
  pretty: t.Optional[bool] = None,
2498
2529
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2530
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2499
2531
  ) -> ObjectApiResponse[t.Any]:
2500
2532
  """
2501
2533
  Updates the data stream lifecycle of the selected data streams.
2502
2534
 
2503
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/data-streams-put-lifecycle.html>`_
2535
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/data-streams-put-lifecycle.html>`_
2504
2536
 
2505
2537
  :param name: Comma-separated list of data streams used to limit the request.
2506
2538
  Supports wildcards (`*`). To target all data streams use `*` or `_all`.
@@ -2523,12 +2555,8 @@ class IndicesClient(NamespacedClient):
2523
2555
  if name in SKIP_IN_PATH:
2524
2556
  raise ValueError("Empty value passed for parameter 'name'")
2525
2557
  __path = f"/_data_stream/{_quote(name)}/_lifecycle"
2526
- __body: t.Dict[str, t.Any] = {}
2527
2558
  __query: t.Dict[str, t.Any] = {}
2528
- if data_retention is not None:
2529
- __body["data_retention"] = data_retention
2530
- if downsampling is not None:
2531
- __body["downsampling"] = downsampling
2559
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2532
2560
  if error_trace is not None:
2533
2561
  __query["error_trace"] = error_trace
2534
2562
  if expand_wildcards is not None:
@@ -2543,6 +2571,11 @@ class IndicesClient(NamespacedClient):
2543
2571
  __query["pretty"] = pretty
2544
2572
  if timeout is not None:
2545
2573
  __query["timeout"] = timeout
2574
+ if not __body:
2575
+ if data_retention is not None:
2576
+ __body["data_retention"] = data_retention
2577
+ if downsampling is not None:
2578
+ __body["downsampling"] = downsampling
2546
2579
  if not __body:
2547
2580
  __body = None # type: ignore[assignment]
2548
2581
  __headers = {"accept": "application/json"}
@@ -2553,7 +2586,15 @@ class IndicesClient(NamespacedClient):
2553
2586
  )
2554
2587
 
2555
2588
  @_rewrite_parameters(
2556
- body_fields=True,
2589
+ body_fields=(
2590
+ "composed_of",
2591
+ "data_stream",
2592
+ "index_patterns",
2593
+ "meta",
2594
+ "priority",
2595
+ "template",
2596
+ "version",
2597
+ ),
2557
2598
  parameter_aliases={"_meta": "meta"},
2558
2599
  )
2559
2600
  async def put_index_template(
@@ -2572,11 +2613,12 @@ class IndicesClient(NamespacedClient):
2572
2613
  priority: t.Optional[int] = None,
2573
2614
  template: t.Optional[t.Mapping[str, t.Any]] = None,
2574
2615
  version: t.Optional[int] = None,
2616
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2575
2617
  ) -> ObjectApiResponse[t.Any]:
2576
2618
  """
2577
2619
  Creates or updates an index template.
2578
2620
 
2579
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
2621
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-put-template.html>`_
2580
2622
 
2581
2623
  :param name: Index or template name
2582
2624
  :param composed_of: An ordered list of component template names. Component templates
@@ -2603,39 +2645,52 @@ class IndicesClient(NamespacedClient):
2603
2645
  if name in SKIP_IN_PATH:
2604
2646
  raise ValueError("Empty value passed for parameter 'name'")
2605
2647
  __path = f"/_index_template/{_quote(name)}"
2606
- __body: t.Dict[str, t.Any] = {}
2607
2648
  __query: t.Dict[str, t.Any] = {}
2608
- if composed_of is not None:
2609
- __body["composed_of"] = composed_of
2649
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2610
2650
  if create is not None:
2611
2651
  __query["create"] = create
2612
- if data_stream is not None:
2613
- __body["data_stream"] = data_stream
2614
2652
  if error_trace is not None:
2615
2653
  __query["error_trace"] = error_trace
2616
2654
  if filter_path is not None:
2617
2655
  __query["filter_path"] = filter_path
2618
2656
  if human is not None:
2619
2657
  __query["human"] = human
2620
- if index_patterns is not None:
2621
- __body["index_patterns"] = index_patterns
2622
- if meta is not None:
2623
- __body["_meta"] = meta
2624
2658
  if pretty is not None:
2625
2659
  __query["pretty"] = pretty
2626
- if priority is not None:
2627
- __body["priority"] = priority
2628
- if template is not None:
2629
- __body["template"] = template
2630
- if version is not None:
2631
- __body["version"] = version
2660
+ if not __body:
2661
+ if composed_of is not None:
2662
+ __body["composed_of"] = composed_of
2663
+ if data_stream is not None:
2664
+ __body["data_stream"] = data_stream
2665
+ if index_patterns is not None:
2666
+ __body["index_patterns"] = index_patterns
2667
+ if meta is not None:
2668
+ __body["_meta"] = meta
2669
+ if priority is not None:
2670
+ __body["priority"] = priority
2671
+ if template is not None:
2672
+ __body["template"] = template
2673
+ if version is not None:
2674
+ __body["version"] = version
2632
2675
  __headers = {"accept": "application/json", "content-type": "application/json"}
2633
2676
  return await self.perform_request( # type: ignore[return-value]
2634
2677
  "PUT", __path, params=__query, headers=__headers, body=__body
2635
2678
  )
2636
2679
 
2637
2680
  @_rewrite_parameters(
2638
- body_fields=True,
2681
+ body_fields=(
2682
+ "date_detection",
2683
+ "dynamic",
2684
+ "dynamic_date_formats",
2685
+ "dynamic_templates",
2686
+ "field_names",
2687
+ "meta",
2688
+ "numeric_detection",
2689
+ "properties",
2690
+ "routing",
2691
+ "runtime",
2692
+ "source",
2693
+ ),
2639
2694
  parameter_aliases={
2640
2695
  "_field_names": "field_names",
2641
2696
  "_meta": "meta",
@@ -2684,11 +2739,12 @@ class IndicesClient(NamespacedClient):
2684
2739
  source: t.Optional[t.Mapping[str, t.Any]] = None,
2685
2740
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2686
2741
  write_index_only: t.Optional[bool] = None,
2742
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2687
2743
  ) -> ObjectApiResponse[t.Any]:
2688
2744
  """
2689
2745
  Updates the index mappings.
2690
2746
 
2691
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-put-mapping.html>`_
2747
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-put-mapping.html>`_
2692
2748
 
2693
2749
  :param index: A comma-separated list of index names the mapping should be added
2694
2750
  to (supports wildcards); use `_all` or omit to add the mapping on all indices.
@@ -2730,23 +2786,13 @@ class IndicesClient(NamespacedClient):
2730
2786
  raise ValueError("Empty value passed for parameter 'index'")
2731
2787
  __path = f"/{_quote(index)}/_mapping"
2732
2788
  __query: t.Dict[str, t.Any] = {}
2733
- __body: t.Dict[str, t.Any] = {}
2789
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2734
2790
  if allow_no_indices is not None:
2735
2791
  __query["allow_no_indices"] = allow_no_indices
2736
- if date_detection is not None:
2737
- __body["date_detection"] = date_detection
2738
- if dynamic is not None:
2739
- __body["dynamic"] = dynamic
2740
- if dynamic_date_formats is not None:
2741
- __body["dynamic_date_formats"] = dynamic_date_formats
2742
- if dynamic_templates is not None:
2743
- __body["dynamic_templates"] = dynamic_templates
2744
2792
  if error_trace is not None:
2745
2793
  __query["error_trace"] = error_trace
2746
2794
  if expand_wildcards is not None:
2747
2795
  __query["expand_wildcards"] = expand_wildcards
2748
- if field_names is not None:
2749
- __body["_field_names"] = field_names
2750
2796
  if filter_path is not None:
2751
2797
  __query["filter_path"] = filter_path
2752
2798
  if human is not None:
@@ -2755,24 +2801,35 @@ class IndicesClient(NamespacedClient):
2755
2801
  __query["ignore_unavailable"] = ignore_unavailable
2756
2802
  if master_timeout is not None:
2757
2803
  __query["master_timeout"] = master_timeout
2758
- if meta is not None:
2759
- __body["_meta"] = meta
2760
- if numeric_detection is not None:
2761
- __body["numeric_detection"] = numeric_detection
2762
2804
  if pretty is not None:
2763
2805
  __query["pretty"] = pretty
2764
- if properties is not None:
2765
- __body["properties"] = properties
2766
- if routing is not None:
2767
- __body["_routing"] = routing
2768
- if runtime is not None:
2769
- __body["runtime"] = runtime
2770
- if source is not None:
2771
- __body["_source"] = source
2772
2806
  if timeout is not None:
2773
2807
  __query["timeout"] = timeout
2774
2808
  if write_index_only is not None:
2775
2809
  __query["write_index_only"] = write_index_only
2810
+ if not __body:
2811
+ if date_detection is not None:
2812
+ __body["date_detection"] = date_detection
2813
+ if dynamic is not None:
2814
+ __body["dynamic"] = dynamic
2815
+ if dynamic_date_formats is not None:
2816
+ __body["dynamic_date_formats"] = dynamic_date_formats
2817
+ if dynamic_templates is not None:
2818
+ __body["dynamic_templates"] = dynamic_templates
2819
+ if field_names is not None:
2820
+ __body["_field_names"] = field_names
2821
+ if meta is not None:
2822
+ __body["_meta"] = meta
2823
+ if numeric_detection is not None:
2824
+ __body["numeric_detection"] = numeric_detection
2825
+ if properties is not None:
2826
+ __body["properties"] = properties
2827
+ if routing is not None:
2828
+ __body["_routing"] = routing
2829
+ if runtime is not None:
2830
+ __body["runtime"] = runtime
2831
+ if source is not None:
2832
+ __body["_source"] = source
2776
2833
  __headers = {"accept": "application/json", "content-type": "application/json"}
2777
2834
  return await self.perform_request( # type: ignore[return-value]
2778
2835
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -2784,7 +2841,8 @@ class IndicesClient(NamespacedClient):
2784
2841
  async def put_settings(
2785
2842
  self,
2786
2843
  *,
2787
- settings: t.Mapping[str, t.Any],
2844
+ settings: t.Optional[t.Mapping[str, t.Any]] = None,
2845
+ body: t.Optional[t.Mapping[str, t.Any]] = None,
2788
2846
  index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2789
2847
  allow_no_indices: t.Optional[bool] = None,
2790
2848
  error_trace: t.Optional[bool] = None,
@@ -2810,7 +2868,7 @@ class IndicesClient(NamespacedClient):
2810
2868
  """
2811
2869
  Updates the index settings.
2812
2870
 
2813
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-update-settings.html>`_
2871
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-update-settings.html>`_
2814
2872
 
2815
2873
  :param settings:
2816
2874
  :param index: Comma-separated list of data streams, indices, and aliases used
@@ -2834,8 +2892,12 @@ class IndicesClient(NamespacedClient):
2834
2892
  :param timeout: Period to wait for a response. If no response is received before
2835
2893
  the timeout expires, the request fails and returns an error.
2836
2894
  """
2837
- if settings is None:
2838
- raise ValueError("Empty value passed for parameter 'settings'")
2895
+ if settings is None and body is None:
2896
+ raise ValueError(
2897
+ "Empty value passed for parameters 'settings' and 'body', one of them should be set."
2898
+ )
2899
+ elif settings is not None and body is not None:
2900
+ raise ValueError("Cannot set both 'settings' and 'body'")
2839
2901
  if index not in SKIP_IN_PATH:
2840
2902
  __path = f"/{_quote(index)}/_settings"
2841
2903
  else:
@@ -2863,14 +2925,21 @@ class IndicesClient(NamespacedClient):
2863
2925
  __query["pretty"] = pretty
2864
2926
  if timeout is not None:
2865
2927
  __query["timeout"] = timeout
2866
- __body = settings
2928
+ __body = settings if settings is not None else body
2867
2929
  __headers = {"accept": "application/json", "content-type": "application/json"}
2868
2930
  return await self.perform_request( # type: ignore[return-value]
2869
2931
  "PUT", __path, params=__query, headers=__headers, body=__body
2870
2932
  )
2871
2933
 
2872
2934
  @_rewrite_parameters(
2873
- body_fields=True,
2935
+ body_fields=(
2936
+ "aliases",
2937
+ "index_patterns",
2938
+ "mappings",
2939
+ "order",
2940
+ "settings",
2941
+ "version",
2942
+ ),
2874
2943
  )
2875
2944
  async def put_template(
2876
2945
  self,
@@ -2892,11 +2961,12 @@ class IndicesClient(NamespacedClient):
2892
2961
  settings: t.Optional[t.Mapping[str, t.Any]] = None,
2893
2962
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2894
2963
  version: t.Optional[int] = None,
2964
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2895
2965
  ) -> ObjectApiResponse[t.Any]:
2896
2966
  """
2897
2967
  Creates or updates an index template.
2898
2968
 
2899
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
2969
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-templates-v1.html>`_
2900
2970
 
2901
2971
  :param name: The name of the template
2902
2972
  :param aliases: Aliases for the index.
@@ -2922,10 +2992,8 @@ class IndicesClient(NamespacedClient):
2922
2992
  if name in SKIP_IN_PATH:
2923
2993
  raise ValueError("Empty value passed for parameter 'name'")
2924
2994
  __path = f"/_template/{_quote(name)}"
2925
- __body: t.Dict[str, t.Any] = {}
2926
2995
  __query: t.Dict[str, t.Any] = {}
2927
- if aliases is not None:
2928
- __body["aliases"] = aliases
2996
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2929
2997
  if create is not None:
2930
2998
  __query["create"] = create
2931
2999
  if error_trace is not None:
@@ -2936,22 +3004,25 @@ class IndicesClient(NamespacedClient):
2936
3004
  __query["flat_settings"] = flat_settings
2937
3005
  if human is not None:
2938
3006
  __query["human"] = human
2939
- if index_patterns is not None:
2940
- __body["index_patterns"] = index_patterns
2941
- if mappings is not None:
2942
- __body["mappings"] = mappings
2943
3007
  if master_timeout is not None:
2944
3008
  __query["master_timeout"] = master_timeout
2945
- if order is not None:
2946
- __body["order"] = order
2947
3009
  if pretty is not None:
2948
3010
  __query["pretty"] = pretty
2949
- if settings is not None:
2950
- __body["settings"] = settings
2951
3011
  if timeout is not None:
2952
3012
  __query["timeout"] = timeout
2953
- if version is not None:
2954
- __body["version"] = version
3013
+ if not __body:
3014
+ if aliases is not None:
3015
+ __body["aliases"] = aliases
3016
+ if index_patterns is not None:
3017
+ __body["index_patterns"] = index_patterns
3018
+ if mappings is not None:
3019
+ __body["mappings"] = mappings
3020
+ if order is not None:
3021
+ __body["order"] = order
3022
+ if settings is not None:
3023
+ __body["settings"] = settings
3024
+ if version is not None:
3025
+ __body["version"] = version
2955
3026
  __headers = {"accept": "application/json", "content-type": "application/json"}
2956
3027
  return await self.perform_request( # type: ignore[return-value]
2957
3028
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -2972,7 +3043,7 @@ class IndicesClient(NamespacedClient):
2972
3043
  """
2973
3044
  Returns information about ongoing index shard recoveries.
2974
3045
 
2975
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-recovery.html>`_
3046
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-recovery.html>`_
2976
3047
 
2977
3048
  :param index: Comma-separated list of data streams, indices, and aliases used
2978
3049
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -3026,7 +3097,7 @@ class IndicesClient(NamespacedClient):
3026
3097
  """
3027
3098
  Performs the refresh operation in one or more indices.
3028
3099
 
3029
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-refresh.html>`_
3100
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-refresh.html>`_
3030
3101
 
3031
3102
  :param index: Comma-separated list of data streams, indices, and aliases used
3032
3103
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -3088,7 +3159,7 @@ class IndicesClient(NamespacedClient):
3088
3159
  """
3089
3160
  Reloads an index's search analyzers and their resources.
3090
3161
 
3091
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-reload-analyzers.html>`_
3162
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-reload-analyzers.html>`_
3092
3163
 
3093
3164
  :param index: A comma-separated list of index names to reload analyzers for
3094
3165
  :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
@@ -3143,7 +3214,7 @@ class IndicesClient(NamespacedClient):
3143
3214
  """
3144
3215
  Returns information about any matching indices, aliases, and data streams
3145
3216
 
3146
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-resolve-index-api.html>`_
3217
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-resolve-index-api.html>`_
3147
3218
 
3148
3219
  :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
3149
3220
  and data streams to resolve. Resources on remote clusters can be specified
@@ -3173,7 +3244,7 @@ class IndicesClient(NamespacedClient):
3173
3244
  )
3174
3245
 
3175
3246
  @_rewrite_parameters(
3176
- body_fields=True,
3247
+ body_fields=("aliases", "conditions", "mappings", "settings"),
3177
3248
  )
3178
3249
  async def rollover(
3179
3250
  self,
@@ -3196,12 +3267,13 @@ class IndicesClient(NamespacedClient):
3196
3267
  wait_for_active_shards: t.Optional[
3197
3268
  t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
3198
3269
  ] = None,
3270
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3199
3271
  ) -> ObjectApiResponse[t.Any]:
3200
3272
  """
3201
3273
  Updates an alias to point to a new index when the existing index is considered
3202
3274
  to be too large or too old.
3203
3275
 
3204
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-rollover-index.html>`_
3276
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-rollover-index.html>`_
3205
3277
 
3206
3278
  :param alias: Name of the data stream or index alias to roll over.
3207
3279
  :param new_index: Name of the index to create. Supports date math. Data streams
@@ -3237,12 +3309,8 @@ class IndicesClient(NamespacedClient):
3237
3309
  __path = f"/{_quote(alias)}/_rollover"
3238
3310
  else:
3239
3311
  raise ValueError("Couldn't find a path for the given parameters")
3240
- __body: t.Dict[str, t.Any] = {}
3241
3312
  __query: t.Dict[str, t.Any] = {}
3242
- if aliases is not None:
3243
- __body["aliases"] = aliases
3244
- if conditions is not None:
3245
- __body["conditions"] = conditions
3313
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
3246
3314
  if dry_run is not None:
3247
3315
  __query["dry_run"] = dry_run
3248
3316
  if error_trace is not None:
@@ -3251,18 +3319,23 @@ class IndicesClient(NamespacedClient):
3251
3319
  __query["filter_path"] = filter_path
3252
3320
  if human is not None:
3253
3321
  __query["human"] = human
3254
- if mappings is not None:
3255
- __body["mappings"] = mappings
3256
3322
  if master_timeout is not None:
3257
3323
  __query["master_timeout"] = master_timeout
3258
3324
  if pretty is not None:
3259
3325
  __query["pretty"] = pretty
3260
- if settings is not None:
3261
- __body["settings"] = settings
3262
3326
  if timeout is not None:
3263
3327
  __query["timeout"] = timeout
3264
3328
  if wait_for_active_shards is not None:
3265
3329
  __query["wait_for_active_shards"] = wait_for_active_shards
3330
+ if not __body:
3331
+ if aliases is not None:
3332
+ __body["aliases"] = aliases
3333
+ if conditions is not None:
3334
+ __body["conditions"] = conditions
3335
+ if mappings is not None:
3336
+ __body["mappings"] = mappings
3337
+ if settings is not None:
3338
+ __body["settings"] = settings
3266
3339
  if not __body:
3267
3340
  __body = None # type: ignore[assignment]
3268
3341
  __headers = {"accept": "application/json"}
@@ -3296,7 +3369,7 @@ class IndicesClient(NamespacedClient):
3296
3369
  """
3297
3370
  Provides low-level information about segments in a Lucene index.
3298
3371
 
3299
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-segments.html>`_
3372
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-segments.html>`_
3300
3373
 
3301
3374
  :param index: Comma-separated list of data streams, indices, and aliases used
3302
3375
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -3367,7 +3440,7 @@ class IndicesClient(NamespacedClient):
3367
3440
  """
3368
3441
  Provides store information for shard copies of indices.
3369
3442
 
3370
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-shards-stores.html>`_
3443
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-shards-stores.html>`_
3371
3444
 
3372
3445
  :param index: List of data streams, indices, and aliases used to limit the request.
3373
3446
  :param allow_no_indices: If false, the request returns an error if any wildcard
@@ -3407,7 +3480,7 @@ class IndicesClient(NamespacedClient):
3407
3480
  )
3408
3481
 
3409
3482
  @_rewrite_parameters(
3410
- body_fields=True,
3483
+ body_fields=("aliases", "settings"),
3411
3484
  )
3412
3485
  async def shrink(
3413
3486
  self,
@@ -3427,11 +3500,12 @@ class IndicesClient(NamespacedClient):
3427
3500
  wait_for_active_shards: t.Optional[
3428
3501
  t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
3429
3502
  ] = None,
3503
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3430
3504
  ) -> ObjectApiResponse[t.Any]:
3431
3505
  """
3432
3506
  Allow to shrink an existing index into a new index with fewer primary shards.
3433
3507
 
3434
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-shrink-index.html>`_
3508
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-shrink-index.html>`_
3435
3509
 
3436
3510
  :param index: Name of the source index to shrink.
3437
3511
  :param target: Name of the target index to create.
@@ -3451,10 +3525,8 @@ class IndicesClient(NamespacedClient):
3451
3525
  if target in SKIP_IN_PATH:
3452
3526
  raise ValueError("Empty value passed for parameter 'target'")
3453
3527
  __path = f"/{_quote(index)}/_shrink/{_quote(target)}"
3454
- __body: t.Dict[str, t.Any] = {}
3455
3528
  __query: t.Dict[str, t.Any] = {}
3456
- if aliases is not None:
3457
- __body["aliases"] = aliases
3529
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
3458
3530
  if error_trace is not None:
3459
3531
  __query["error_trace"] = error_trace
3460
3532
  if filter_path is not None:
@@ -3465,12 +3537,15 @@ class IndicesClient(NamespacedClient):
3465
3537
  __query["master_timeout"] = master_timeout
3466
3538
  if pretty is not None:
3467
3539
  __query["pretty"] = pretty
3468
- if settings is not None:
3469
- __body["settings"] = settings
3470
3540
  if timeout is not None:
3471
3541
  __query["timeout"] = timeout
3472
3542
  if wait_for_active_shards is not None:
3473
3543
  __query["wait_for_active_shards"] = wait_for_active_shards
3544
+ if not __body:
3545
+ if aliases is not None:
3546
+ __body["aliases"] = aliases
3547
+ if settings is not None:
3548
+ __body["settings"] = settings
3474
3549
  if not __body:
3475
3550
  __body = None # type: ignore[assignment]
3476
3551
  __headers = {"accept": "application/json"}
@@ -3481,7 +3556,16 @@ class IndicesClient(NamespacedClient):
3481
3556
  )
3482
3557
 
3483
3558
  @_rewrite_parameters(
3484
- body_fields=True,
3559
+ body_fields=(
3560
+ "allow_auto_create",
3561
+ "composed_of",
3562
+ "data_stream",
3563
+ "index_patterns",
3564
+ "meta",
3565
+ "priority",
3566
+ "template",
3567
+ "version",
3568
+ ),
3485
3569
  parameter_aliases={"_meta": "meta"},
3486
3570
  )
3487
3571
  async def simulate_index_template(
@@ -3505,11 +3589,12 @@ class IndicesClient(NamespacedClient):
3505
3589
  priority: t.Optional[int] = None,
3506
3590
  template: t.Optional[t.Mapping[str, t.Any]] = None,
3507
3591
  version: t.Optional[int] = None,
3592
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3508
3593
  ) -> ObjectApiResponse[t.Any]:
3509
3594
  """
3510
3595
  Simulate matching the given index name against the index templates in the system
3511
3596
 
3512
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
3597
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-simulate-index.html>`_
3513
3598
 
3514
3599
  :param name: Index or template name to simulate
3515
3600
  :param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
@@ -3550,16 +3635,10 @@ class IndicesClient(NamespacedClient):
3550
3635
  if name in SKIP_IN_PATH:
3551
3636
  raise ValueError("Empty value passed for parameter 'name'")
3552
3637
  __path = f"/_index_template/_simulate_index/{_quote(name)}"
3553
- __body: t.Dict[str, t.Any] = {}
3554
3638
  __query: t.Dict[str, t.Any] = {}
3555
- if allow_auto_create is not None:
3556
- __body["allow_auto_create"] = allow_auto_create
3557
- if composed_of is not None:
3558
- __body["composed_of"] = composed_of
3639
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
3559
3640
  if create is not None:
3560
3641
  __query["create"] = create
3561
- if data_stream is not None:
3562
- __body["data_stream"] = data_stream
3563
3642
  if error_trace is not None:
3564
3643
  __query["error_trace"] = error_trace
3565
3644
  if filter_path is not None:
@@ -3568,20 +3647,27 @@ class IndicesClient(NamespacedClient):
3568
3647
  __query["human"] = human
3569
3648
  if include_defaults is not None:
3570
3649
  __query["include_defaults"] = include_defaults
3571
- if index_patterns is not None:
3572
- __body["index_patterns"] = index_patterns
3573
3650
  if master_timeout is not None:
3574
3651
  __query["master_timeout"] = master_timeout
3575
- if meta is not None:
3576
- __body["_meta"] = meta
3577
3652
  if pretty is not None:
3578
3653
  __query["pretty"] = pretty
3579
- if priority is not None:
3580
- __body["priority"] = priority
3581
- if template is not None:
3582
- __body["template"] = template
3583
- if version is not None:
3584
- __body["version"] = version
3654
+ if not __body:
3655
+ if allow_auto_create is not None:
3656
+ __body["allow_auto_create"] = allow_auto_create
3657
+ if composed_of is not None:
3658
+ __body["composed_of"] = composed_of
3659
+ if data_stream is not None:
3660
+ __body["data_stream"] = data_stream
3661
+ if index_patterns is not None:
3662
+ __body["index_patterns"] = index_patterns
3663
+ if meta is not None:
3664
+ __body["_meta"] = meta
3665
+ if priority is not None:
3666
+ __body["priority"] = priority
3667
+ if template is not None:
3668
+ __body["template"] = template
3669
+ if version is not None:
3670
+ __body["version"] = version
3585
3671
  if not __body:
3586
3672
  __body = None # type: ignore[assignment]
3587
3673
  __headers = {"accept": "application/json"}
@@ -3608,11 +3694,12 @@ class IndicesClient(NamespacedClient):
3608
3694
  ] = None,
3609
3695
  pretty: t.Optional[bool] = None,
3610
3696
  template: t.Optional[t.Mapping[str, t.Any]] = None,
3697
+ body: t.Optional[t.Mapping[str, t.Any]] = None,
3611
3698
  ) -> ObjectApiResponse[t.Any]:
3612
3699
  """
3613
3700
  Simulate resolving the given template name or body
3614
3701
 
3615
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-templates.html>`_
3702
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-simulate-template.html>`_
3616
3703
 
3617
3704
  :param name: Name of the index template to simulate. To test a template configuration
3618
3705
  before you add it to the cluster, omit this parameter and specify the template
@@ -3628,6 +3715,12 @@ class IndicesClient(NamespacedClient):
3628
3715
  returns an error.
3629
3716
  :param template:
3630
3717
  """
3718
+ if template is None and body is None:
3719
+ raise ValueError(
3720
+ "Empty value passed for parameters 'template' and 'body', one of them should be set."
3721
+ )
3722
+ elif template is not None and body is not None:
3723
+ raise ValueError("Cannot set both 'template' and 'body'")
3631
3724
  if name not in SKIP_IN_PATH:
3632
3725
  __path = f"/_index_template/_simulate/{_quote(name)}"
3633
3726
  else:
@@ -3647,7 +3740,7 @@ class IndicesClient(NamespacedClient):
3647
3740
  __query["master_timeout"] = master_timeout
3648
3741
  if pretty is not None:
3649
3742
  __query["pretty"] = pretty
3650
- __body = template
3743
+ __body = template if template is not None else body
3651
3744
  if not __body:
3652
3745
  __body = None
3653
3746
  __headers = {"accept": "application/json"}
@@ -3658,7 +3751,7 @@ class IndicesClient(NamespacedClient):
3658
3751
  )
3659
3752
 
3660
3753
  @_rewrite_parameters(
3661
- body_fields=True,
3754
+ body_fields=("aliases", "settings"),
3662
3755
  )
3663
3756
  async def split(
3664
3757
  self,
@@ -3678,11 +3771,12 @@ class IndicesClient(NamespacedClient):
3678
3771
  wait_for_active_shards: t.Optional[
3679
3772
  t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]]
3680
3773
  ] = None,
3774
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3681
3775
  ) -> ObjectApiResponse[t.Any]:
3682
3776
  """
3683
3777
  Allows you to split an existing index into a new index with more primary shards.
3684
3778
 
3685
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-split-index.html>`_
3779
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-split-index.html>`_
3686
3780
 
3687
3781
  :param index: Name of the source index to split.
3688
3782
  :param target: Name of the target index to create.
@@ -3702,10 +3796,8 @@ class IndicesClient(NamespacedClient):
3702
3796
  if target in SKIP_IN_PATH:
3703
3797
  raise ValueError("Empty value passed for parameter 'target'")
3704
3798
  __path = f"/{_quote(index)}/_split/{_quote(target)}"
3705
- __body: t.Dict[str, t.Any] = {}
3706
3799
  __query: t.Dict[str, t.Any] = {}
3707
- if aliases is not None:
3708
- __body["aliases"] = aliases
3800
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
3709
3801
  if error_trace is not None:
3710
3802
  __query["error_trace"] = error_trace
3711
3803
  if filter_path is not None:
@@ -3716,12 +3808,15 @@ class IndicesClient(NamespacedClient):
3716
3808
  __query["master_timeout"] = master_timeout
3717
3809
  if pretty is not None:
3718
3810
  __query["pretty"] = pretty
3719
- if settings is not None:
3720
- __body["settings"] = settings
3721
3811
  if timeout is not None:
3722
3812
  __query["timeout"] = timeout
3723
3813
  if wait_for_active_shards is not None:
3724
3814
  __query["wait_for_active_shards"] = wait_for_active_shards
3815
+ if not __body:
3816
+ if aliases is not None:
3817
+ __body["aliases"] = aliases
3818
+ if settings is not None:
3819
+ __body["settings"] = settings
3725
3820
  if not __body:
3726
3821
  __body = None # type: ignore[assignment]
3727
3822
  __headers = {"accept": "application/json"}
@@ -3763,7 +3858,7 @@ class IndicesClient(NamespacedClient):
3763
3858
  """
3764
3859
  Provides statistics on operations happening in an index.
3765
3860
 
3766
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-stats.html>`_
3861
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-stats.html>`_
3767
3862
 
3768
3863
  :param index: A comma-separated list of index names; use `_all` or empty string
3769
3864
  to perform the operation on all indices
@@ -3859,7 +3954,7 @@ class IndicesClient(NamespacedClient):
3859
3954
  Unfreezes an index. When a frozen index is unfrozen, the index goes through the
3860
3955
  normal recovery process and becomes writeable again.
3861
3956
 
3862
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/unfreeze-index-api.html>`_
3957
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/unfreeze-index-api.html>`_
3863
3958
 
3864
3959
  :param index: Identifier for the index.
3865
3960
  :param allow_no_indices: If `false`, the request returns an error if any wildcard
@@ -3910,7 +4005,7 @@ class IndicesClient(NamespacedClient):
3910
4005
  )
3911
4006
 
3912
4007
  @_rewrite_parameters(
3913
- body_fields=True,
4008
+ body_fields=("actions",),
3914
4009
  )
3915
4010
  async def update_aliases(
3916
4011
  self,
@@ -3924,11 +4019,12 @@ class IndicesClient(NamespacedClient):
3924
4019
  ] = None,
3925
4020
  pretty: t.Optional[bool] = None,
3926
4021
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
4022
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3927
4023
  ) -> ObjectApiResponse[t.Any]:
3928
4024
  """
3929
4025
  Updates index aliases.
3930
4026
 
3931
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-aliases.html>`_
4027
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-aliases.html>`_
3932
4028
 
3933
4029
  :param actions: Actions to perform.
3934
4030
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -3938,10 +4034,8 @@ class IndicesClient(NamespacedClient):
3938
4034
  the timeout expires, the request fails and returns an error.
3939
4035
  """
3940
4036
  __path = "/_aliases"
3941
- __body: t.Dict[str, t.Any] = {}
3942
4037
  __query: t.Dict[str, t.Any] = {}
3943
- if actions is not None:
3944
- __body["actions"] = actions
4038
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
3945
4039
  if error_trace is not None:
3946
4040
  __query["error_trace"] = error_trace
3947
4041
  if filter_path is not None:
@@ -3954,13 +4048,16 @@ class IndicesClient(NamespacedClient):
3954
4048
  __query["pretty"] = pretty
3955
4049
  if timeout is not None:
3956
4050
  __query["timeout"] = timeout
4051
+ if not __body:
4052
+ if actions is not None:
4053
+ __body["actions"] = actions
3957
4054
  __headers = {"accept": "application/json", "content-type": "application/json"}
3958
4055
  return await self.perform_request( # type: ignore[return-value]
3959
4056
  "POST", __path, params=__query, headers=__headers, body=__body
3960
4057
  )
3961
4058
 
3962
4059
  @_rewrite_parameters(
3963
- body_fields=True,
4060
+ body_fields=("query",),
3964
4061
  )
3965
4062
  async def validate_query(
3966
4063
  self,
@@ -3990,11 +4087,12 @@ class IndicesClient(NamespacedClient):
3990
4087
  q: t.Optional[str] = None,
3991
4088
  query: t.Optional[t.Mapping[str, t.Any]] = None,
3992
4089
  rewrite: t.Optional[bool] = None,
4090
+ body: t.Optional[t.Dict[str, t.Any]] = None,
3993
4091
  ) -> ObjectApiResponse[t.Any]:
3994
4092
  """
3995
4093
  Allows a user to validate a potentially expensive query without executing it.
3996
4094
 
3997
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/search-validate.html>`_
4095
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-validate.html>`_
3998
4096
 
3999
4097
  :param index: Comma-separated list of data streams, indices, and aliases to search.
4000
4098
  Supports wildcards (`*`). To search all data streams or indices, omit this
@@ -4032,7 +4130,7 @@ class IndicesClient(NamespacedClient):
4032
4130
  else:
4033
4131
  __path = "/_validate/query"
4034
4132
  __query: t.Dict[str, t.Any] = {}
4035
- __body: t.Dict[str, t.Any] = {}
4133
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
4036
4134
  if all_shards is not None:
4037
4135
  __query["all_shards"] = all_shards
4038
4136
  if allow_no_indices is not None:
@@ -4063,10 +4161,11 @@ class IndicesClient(NamespacedClient):
4063
4161
  __query["pretty"] = pretty
4064
4162
  if q is not None:
4065
4163
  __query["q"] = q
4066
- if query is not None:
4067
- __body["query"] = query
4068
4164
  if rewrite is not None:
4069
4165
  __query["rewrite"] = rewrite
4166
+ if not __body:
4167
+ if query is not None:
4168
+ __body["query"] = query
4070
4169
  if not __body:
4071
4170
  __body = None # type: ignore[assignment]
4072
4171
  __headers = {"accept": "application/json"}