@@ -759,7 +759,7 @@ async def clear_scroll(
759
759
async def close_point_in_time (
760
760
self ,
761
761
* ,
762
- id : str ,
762
+ id : t . Optional [ str ] = None ,
763
763
error_trace : t .Optional [bool ] = None ,
764
764
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
765
765
human : t .Optional [bool ] = None ,
@@ -773,7 +773,7 @@ async def close_point_in_time(
773
773
774
774
:param id: The ID of the point-in-time.
775
775
"""
776
- if id is None :
776
+ if id is None and body is None :
777
777
raise ValueError ("Empty value passed for parameter 'id'" )
778
778
__path = "/_pit"
779
779
__query : t .Dict [str , t .Any ] = {}
@@ -1122,7 +1122,7 @@ async def delete(
1122
1122
async def delete_by_query (
1123
1123
self ,
1124
1124
* ,
1125
- index : t .Union [str , t .Sequence [str ]],
1125
+ index : t .Optional [ t . Union [str , t .Sequence [str ]]] = None ,
1126
1126
allow_no_indices : t .Optional [bool ] = None ,
1127
1127
analyze_wildcard : t .Optional [bool ] = None ,
1128
1128
analyzer : t .Optional [str ] = None ,
@@ -1616,8 +1616,8 @@ async def exists_source(
1616
1616
async def explain (
1617
1617
self ,
1618
1618
* ,
1619
- index : str ,
1620
- id : str ,
1619
+ index : t . Optional [ str ] = None ,
1620
+ id : t . Optional [ str ] = None ,
1621
1621
analyze_wildcard : t .Optional [bool ] = None ,
1622
1622
analyzer : t .Optional [str ] = None ,
1623
1623
default_operator : t .Optional [t .Union ["t.Literal['and', 'or']" , str ]] = None ,
@@ -2322,8 +2322,8 @@ async def info(
2322
2322
async def knn_search (
2323
2323
self ,
2324
2324
* ,
2325
- index : t .Union [str , t .Sequence [str ]],
2326
- knn : t .Mapping [str , t .Any ],
2325
+ index : t .Optional [ t . Union [str , t .Sequence [str ]]] = None ,
2326
+ knn : t .Optional [ t . Mapping [str , t .Any ]] = None ,
2327
2327
docvalue_fields : t .Optional [t .Sequence [t .Mapping [str , t .Any ]]] = None ,
2328
2328
error_trace : t .Optional [bool ] = None ,
2329
2329
fields : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
@@ -2366,7 +2366,7 @@ async def knn_search(
2366
2366
"""
2367
2367
if index in SKIP_IN_PATH :
2368
2368
raise ValueError ("Empty value passed for parameter 'index'" )
2369
- if knn is None :
2369
+ if knn is None and body is None :
2370
2370
raise ValueError ("Empty value passed for parameter 'knn'" )
2371
2371
__path = f"/{ _quote (index )} /_knn_search"
2372
2372
__query : t .Dict [str , t .Any ] = {}
@@ -2887,8 +2887,8 @@ async def open_point_in_time(
2887
2887
async def put_script (
2888
2888
self ,
2889
2889
* ,
2890
- id : str ,
2891
- script : t .Mapping [str , t .Any ],
2890
+ id : t . Optional [ str ] = None ,
2891
+ script : t .Optional [ t . Mapping [str , t .Any ]] = None ,
2892
2892
context : t .Optional [str ] = None ,
2893
2893
error_trace : t .Optional [bool ] = None ,
2894
2894
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
@@ -2920,7 +2920,7 @@ async def put_script(
2920
2920
"""
2921
2921
if id in SKIP_IN_PATH :
2922
2922
raise ValueError ("Empty value passed for parameter 'id'" )
2923
- if script is None :
2923
+ if script is None and body is None :
2924
2924
raise ValueError ("Empty value passed for parameter 'script'" )
2925
2925
if id not in SKIP_IN_PATH and context not in SKIP_IN_PATH :
2926
2926
__path = f"/_scripts/{ _quote (id )} /{ _quote (context )} "
@@ -2956,7 +2956,7 @@ async def put_script(
2956
2956
async def rank_eval (
2957
2957
self ,
2958
2958
* ,
2959
- requests : t .Sequence [t .Mapping [str , t .Any ]],
2959
+ requests : t .Optional [ t . Sequence [t .Mapping [str , t .Any ]]] = None ,
2960
2960
index : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2961
2961
allow_no_indices : t .Optional [bool ] = None ,
2962
2962
error_trace : t .Optional [bool ] = None ,
@@ -3000,7 +3000,7 @@ async def rank_eval(
3000
3000
:param metric: Definition of the evaluation metric to calculate.
3001
3001
:param search_type: Search operation type
3002
3002
"""
3003
- if requests is None :
3003
+ if requests is None and body is None :
3004
3004
raise ValueError ("Empty value passed for parameter 'requests'" )
3005
3005
if index not in SKIP_IN_PATH :
3006
3006
__path = f"/{ _quote (index )} /_rank_eval"
@@ -3040,8 +3040,8 @@ async def rank_eval(
3040
3040
async def reindex (
3041
3041
self ,
3042
3042
* ,
3043
- dest : t .Mapping [str , t .Any ],
3044
- source : t .Mapping [str , t .Any ],
3043
+ dest : t .Optional [ t . Mapping [str , t .Any ]] = None ,
3044
+ source : t .Optional [ t . Mapping [str , t .Any ]] = None ,
3045
3045
conflicts : t .Optional [t .Union ["t.Literal['abort', 'proceed']" , str ]] = None ,
3046
3046
error_trace : t .Optional [bool ] = None ,
3047
3047
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
@@ -3093,9 +3093,9 @@ async def reindex(
3093
3093
:param wait_for_completion: If `true`, the request blocks until the operation
3094
3094
is complete.
3095
3095
"""
3096
- if dest is None :
3096
+ if dest is None and body is None :
3097
3097
raise ValueError ("Empty value passed for parameter 'dest'" )
3098
- if source is None :
3098
+ if source is None and body is None :
3099
3099
raise ValueError ("Empty value passed for parameter 'source'" )
3100
3100
__path = "/_reindex"
3101
3101
__query : t .Dict [str , t .Any ] = {}
@@ -3299,7 +3299,7 @@ async def scripts_painless_execute(
3299
3299
async def scroll (
3300
3300
self ,
3301
3301
* ,
3302
- scroll_id : str ,
3302
+ scroll_id : t . Optional [ str ] = None ,
3303
3303
error_trace : t .Optional [bool ] = None ,
3304
3304
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
3305
3305
human : t .Optional [bool ] = None ,
@@ -3319,7 +3319,7 @@ async def scroll(
3319
3319
is returned as an object.
3320
3320
:param scroll: Period to retain the search context for scrolling.
3321
3321
"""
3322
- if scroll_id is None :
3322
+ if scroll_id is None and body is None :
3323
3323
raise ValueError ("Empty value passed for parameter 'scroll_id'" )
3324
3324
__path = "/_search/scroll"
3325
3325
__query : t .Dict [str , t .Any ] = {}
@@ -3856,11 +3856,11 @@ async def search(
3856
3856
async def search_mvt (
3857
3857
self ,
3858
3858
* ,
3859
- index : t .Union [str , t .Sequence [str ]],
3860
- field : str ,
3861
- zoom : int ,
3862
- x : int ,
3863
- y : int ,
3859
+ index : t .Optional [ t . Union [str , t .Sequence [str ]]] = None ,
3860
+ field : t . Optional [ str ] = None ,
3861
+ zoom : t . Optional [ int ] = None ,
3862
+ x : t . Optional [ int ] = None ,
3863
+ y : t . Optional [ int ] = None ,
3864
3864
aggs : t .Optional [t .Mapping [str , t .Mapping [str , t .Any ]]] = None ,
3865
3865
buffer : t .Optional [int ] = None ,
3866
3866
error_trace : t .Optional [bool ] = None ,
@@ -4233,8 +4233,8 @@ async def search_template(
4233
4233
async def terms_enum (
4234
4234
self ,
4235
4235
* ,
4236
- index : str ,
4237
- field : str ,
4236
+ index : t . Optional [ str ] = None ,
4237
+ field : t . Optional [ str ] = None ,
4238
4238
case_insensitive : t .Optional [bool ] = None ,
4239
4239
error_trace : t .Optional [bool ] = None ,
4240
4240
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
@@ -4273,7 +4273,7 @@ async def terms_enum(
4273
4273
"""
4274
4274
if index in SKIP_IN_PATH :
4275
4275
raise ValueError ("Empty value passed for parameter 'index'" )
4276
- if field is None :
4276
+ if field is None and body is None :
4277
4277
raise ValueError ("Empty value passed for parameter 'field'" )
4278
4278
__path = f"/{ _quote (index )} /_terms_enum"
4279
4279
__query : t .Dict [str , t .Any ] = {}
@@ -4316,7 +4316,7 @@ async def terms_enum(
4316
4316
async def termvectors (
4317
4317
self ,
4318
4318
* ,
4319
- index : str ,
4319
+ index : t . Optional [ str ] = None ,
4320
4320
id : t .Optional [str ] = None ,
4321
4321
doc : t .Optional [t .Mapping [str , t .Any ]] = None ,
4322
4322
error_trace : t .Optional [bool ] = None ,
@@ -4444,8 +4444,8 @@ async def termvectors(
4444
4444
async def update (
4445
4445
self ,
4446
4446
* ,
4447
- index : str ,
4448
- id : str ,
4447
+ index : t . Optional [ str ] = None ,
4448
+ id : t . Optional [ str ] = None ,
4449
4449
detect_noop : t .Optional [bool ] = None ,
4450
4450
doc : t .Optional [t .Mapping [str , t .Any ]] = None ,
4451
4451
doc_as_upsert : t .Optional [bool ] = None ,
@@ -4579,7 +4579,7 @@ async def update(
4579
4579
async def update_by_query (
4580
4580
self ,
4581
4581
* ,
4582
- index : t .Union [str , t .Sequence [str ]],
4582
+ index : t .Optional [ t . Union [str , t .Sequence [str ]]] = None ,
4583
4583
allow_no_indices : t .Optional [bool ] = None ,
4584
4584
analyze_wildcard : t .Optional [bool ] = None ,
4585
4585
analyzer : t .Optional [str ] = None ,
0 commit comments