Skip to content

Commit 19ae317

Browse files
Auto-generated API code
1 parent c81b3db commit 19ae317

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+343
-1711
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 19 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,7 @@ async def clear_scroll(
794794
if not __body:
795795
if scroll_id is not None:
796796
__body["scroll_id"] = scroll_id
797-
if not __body:
798-
__body = None # type: ignore[assignment]
799-
__headers = {"accept": "application/json"}
800-
if __body is not None:
801-
__headers["content-type"] = "application/json"
797+
__headers = {"accept": "application/json", "content-type": "application/json"}
802798
return await self.perform_request( # type: ignore[return-value]
803799
"DELETE",
804800
__path,
@@ -853,11 +849,7 @@ async def close_point_in_time(
853849
if not __body:
854850
if id is not None:
855851
__body["id"] = id
856-
if not __body:
857-
__body = None # type: ignore[assignment]
858-
__headers = {"accept": "application/json"}
859-
if __body is not None:
860-
__headers["content-type"] = "application/json"
852+
__headers = {"accept": "application/json", "content-type": "application/json"}
861853
return await self.perform_request( # type: ignore[return-value]
862854
"DELETE",
863855
__path,
@@ -1012,11 +1004,7 @@ async def count(
10121004
if not __body:
10131005
if query is not None:
10141006
__body["query"] = query
1015-
if not __body:
1016-
__body = None # type: ignore[assignment]
1017-
__headers = {"accept": "application/json"}
1018-
if __body is not None:
1019-
__headers["content-type"] = "application/json"
1007+
__headers = {"accept": "application/json", "content-type": "application/json"}
10201008
return await self.perform_request( # type: ignore[return-value]
10211009
"POST",
10221010
__path,
@@ -1627,11 +1615,7 @@ async def delete_by_query(
16271615
__body["slice"] = slice
16281616
if sort is not None:
16291617
__body["sort"] = sort
1630-
if not __body:
1631-
__body = None # type: ignore[assignment]
1632-
__headers = {"accept": "application/json"}
1633-
if __body is not None:
1634-
__headers["content-type"] = "application/json"
1618+
__headers = {"accept": "application/json", "content-type": "application/json"}
16351619
return await self.perform_request( # type: ignore[return-value]
16361620
"POST",
16371621
__path,
@@ -2106,11 +2090,7 @@ async def explain(
21062090
if not __body:
21072091
if query is not None:
21082092
__body["query"] = query
2109-
if not __body:
2110-
__body = None # type: ignore[assignment]
2111-
__headers = {"accept": "application/json"}
2112-
if __body is not None:
2113-
__headers["content-type"] = "application/json"
2093+
__headers = {"accept": "application/json", "content-type": "application/json"}
21142094
return await self.perform_request( # type: ignore[return-value]
21152095
"POST",
21162096
__path,
@@ -2236,11 +2216,7 @@ async def field_caps(
22362216
__body["index_filter"] = index_filter
22372217
if runtime_mappings is not None:
22382218
__body["runtime_mappings"] = runtime_mappings
2239-
if not __body:
2240-
__body = None # type: ignore[assignment]
2241-
__headers = {"accept": "application/json"}
2242-
if __body is not None:
2243-
__headers["content-type"] = "application/json"
2219+
__headers = {"accept": "application/json", "content-type": "application/json"}
22442220
return await self.perform_request( # type: ignore[return-value]
22452221
"POST",
22462222
__path,
@@ -3118,11 +3094,7 @@ async def mget(
31183094
__body["docs"] = docs
31193095
if ids is not None:
31203096
__body["ids"] = ids
3121-
if not __body:
3122-
__body = None # type: ignore[assignment]
3123-
__headers = {"accept": "application/json"}
3124-
if __body is not None:
3125-
__headers["content-type"] = "application/json"
3097+
__headers = {"accept": "application/json", "content-type": "application/json"}
31263098
return await self.perform_request( # type: ignore[return-value]
31273099
"POST",
31283100
__path,
@@ -3637,11 +3609,7 @@ async def open_point_in_time(
36373609
if not __body:
36383610
if index_filter is not None:
36393611
__body["index_filter"] = index_filter
3640-
if not __body:
3641-
__body = None # type: ignore[assignment]
3642-
__headers = {"accept": "application/json"}
3643-
if __body is not None:
3644-
__headers["content-type"] = "application/json"
3612+
__headers = {"accept": "application/json", "content-type": "application/json"}
36453613
return await self.perform_request( # type: ignore[return-value]
36463614
"POST",
36473615
__path,
@@ -3722,11 +3690,7 @@ async def put_script(
37223690
if not __body:
37233691
if script is not None:
37243692
__body["script"] = script
3725-
if not __body:
3726-
__body = None # type: ignore[assignment]
3727-
__headers = {"accept": "application/json"}
3728-
if __body is not None:
3729-
__headers["content-type"] = "application/json"
3693+
__headers = {"accept": "application/json", "content-type": "application/json"}
37303694
return await self.perform_request( # type: ignore[return-value]
37313695
"PUT",
37323696
__path,
@@ -3822,11 +3786,7 @@ async def rank_eval(
38223786
__body["requests"] = requests
38233787
if metric is not None:
38243788
__body["metric"] = metric
3825-
if not __body:
3826-
__body = None # type: ignore[assignment]
3827-
__headers = {"accept": "application/json"}
3828-
if __body is not None:
3829-
__headers["content-type"] = "application/json"
3789+
__headers = {"accept": "application/json", "content-type": "application/json"}
38303790
return await self.perform_request( # type: ignore[return-value]
38313791
"POST",
38323792
__path,
@@ -3999,11 +3959,7 @@ async def reindex(
39993959
__body["script"] = script
40003960
if size is not None:
40013961
__body["size"] = size
4002-
if not __body:
4003-
__body = None # type: ignore[assignment]
4004-
__headers = {"accept": "application/json"}
4005-
if __body is not None:
4006-
__headers["content-type"] = "application/json"
3962+
__headers = {"accept": "application/json", "content-type": "application/json"}
40073963
return await self.perform_request( # type: ignore[return-value]
40083964
"POST",
40093965
__path,
@@ -4131,11 +4087,7 @@ async def render_search_template(
41314087
__body["params"] = params
41324088
if source is not None:
41334089
__body["source"] = source
4134-
if not __body:
4135-
__body = None # type: ignore[assignment]
4136-
__headers = {"accept": "application/json"}
4137-
if __body is not None:
4138-
__headers["content-type"] = "application/json"
4090+
__headers = {"accept": "application/json", "content-type": "application/json"}
41394091
return await self.perform_request( # type: ignore[return-value]
41404092
"POST",
41414093
__path,
@@ -4218,11 +4170,7 @@ async def scripts_painless_execute(
42184170
__body["context_setup"] = context_setup
42194171
if script is not None:
42204172
__body["script"] = script
4221-
if not __body:
4222-
__body = None # type: ignore[assignment]
4223-
__headers = {"accept": "application/json"}
4224-
if __body is not None:
4225-
__headers["content-type"] = "application/json"
4173+
__headers = {"accept": "application/json", "content-type": "application/json"}
42264174
return await self.perform_request( # type: ignore[return-value]
42274175
"POST",
42284176
__path,
@@ -4292,11 +4240,7 @@ async def scroll(
42924240
__body["scroll_id"] = scroll_id
42934241
if scroll is not None:
42944242
__body["scroll"] = scroll
4295-
if not __body:
4296-
__body = None # type: ignore[assignment]
4297-
__headers = {"accept": "application/json"}
4298-
if __body is not None:
4299-
__headers["content-type"] = "application/json"
4243+
__headers = {"accept": "application/json", "content-type": "application/json"}
43004244
return await self.perform_request( # type: ignore[return-value]
43014245
"POST",
43024246
__path,
@@ -4833,11 +4777,7 @@ async def search(
48334777
__body["track_total_hits"] = track_total_hits
48344778
if version is not None:
48354779
__body["version"] = version
4836-
if not __body:
4837-
__body = None # type: ignore[assignment]
4838-
__headers = {"accept": "application/json"}
4839-
if __body is not None:
4840-
__headers["content-type"] = "application/json"
4780+
__headers = {"accept": "application/json", "content-type": "application/json"}
48414781
return await self.perform_request( # type: ignore[return-value]
48424782
"POST",
48434783
__path,
@@ -5556,11 +5496,7 @@ async def search_template(
55565496
__body["profile"] = profile
55575497
if source is not None:
55585498
__body["source"] = source
5559-
if not __body:
5560-
__body = None # type: ignore[assignment]
5561-
__headers = {"accept": "application/json"}
5562-
if __body is not None:
5563-
__headers["content-type"] = "application/json"
5499+
__headers = {"accept": "application/json", "content-type": "application/json"}
55645500
return await self.perform_request( # type: ignore[return-value]
55655501
"POST",
55665502
__path,
@@ -5665,11 +5601,7 @@ async def terms_enum(
56655601
__body["string"] = string
56665602
if timeout is not None:
56675603
__body["timeout"] = timeout
5668-
if not __body:
5669-
__body = None # type: ignore[assignment]
5670-
__headers = {"accept": "application/json"}
5671-
if __body is not None:
5672-
__headers["content-type"] = "application/json"
5604+
__headers = {"accept": "application/json", "content-type": "application/json"}
56735605
return await self.perform_request( # type: ignore[return-value]
56745606
"POST",
56755607
__path,
@@ -6031,11 +5963,7 @@ async def update(
60315963
__body["_source"] = source
60325964
if upsert is not None:
60335965
__body["upsert"] = upsert
6034-
if not __body:
6035-
__body = None # type: ignore[assignment]
6036-
__headers = {"accept": "application/json"}
6037-
if __body is not None:
6038-
__headers["content-type"] = "application/json"
5966+
__headers = {"accept": "application/json", "content-type": "application/json"}
60395967
return await self.perform_request( # type: ignore[return-value]
60405968
"POST",
60415969
__path,
@@ -6368,11 +6296,7 @@ async def update_by_query(
63686296
__body["script"] = script
63696297
if slice is not None:
63706298
__body["slice"] = slice
6371-
if not __body:
6372-
__body = None # type: ignore[assignment]
6373-
__headers = {"accept": "application/json"}
6374-
if __body is not None:
6375-
__headers["content-type"] = "application/json"
6299+
__headers = {"accept": "application/json", "content-type": "application/json"}
63766300
return await self.perform_request( # type: ignore[return-value]
63776301
"POST",
63786302
__path,

elasticsearch/_async/client/ccr.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ async def follow(
229229
__body["read_poll_timeout"] = read_poll_timeout
230230
if settings is not None:
231231
__body["settings"] = settings
232-
if not __body:
233-
__body = None # type: ignore[assignment]
234-
__headers = {"accept": "application/json"}
235-
if __body is not None:
236-
__headers["content-type"] = "application/json"
232+
__headers = {"accept": "application/json", "content-type": "application/json"}
237233
return await self.perform_request( # type: ignore[return-value]
238234
"PUT",
239235
__path,
@@ -420,11 +416,7 @@ async def forget_follower(
420416
__body["follower_index_uuid"] = follower_index_uuid
421417
if leader_remote_cluster is not None:
422418
__body["leader_remote_cluster"] = leader_remote_cluster
423-
if not __body:
424-
__body = None # type: ignore[assignment]
425-
__headers = {"accept": "application/json"}
426-
if __body is not None:
427-
__headers["content-type"] = "application/json"
419+
__headers = {"accept": "application/json", "content-type": "application/json"}
428420
return await self.perform_request( # type: ignore[return-value]
429421
"POST",
430422
__path,
@@ -759,11 +751,7 @@ async def put_auto_follow_pattern(
759751
__body["read_poll_timeout"] = read_poll_timeout
760752
if settings is not None:
761753
__body["settings"] = settings
762-
if not __body:
763-
__body = None # type: ignore[assignment]
764-
__headers = {"accept": "application/json"}
765-
if __body is not None:
766-
__headers["content-type"] = "application/json"
754+
__headers = {"accept": "application/json", "content-type": "application/json"}
767755
return await self.perform_request( # type: ignore[return-value]
768756
"PUT",
769757
__path,

elasticsearch/_async/client/cluster.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,7 @@ async def allocation_explain(
9797
__body["primary"] = primary
9898
if shard is not None:
9999
__body["shard"] = shard
100-
if not __body:
101-
__body = None # type: ignore[assignment]
102-
__headers = {"accept": "application/json"}
103-
if __body is not None:
104-
__headers["content-type"] = "application/json"
100+
__headers = {"accept": "application/json", "content-type": "application/json"}
105101
return await self.perform_request( # type: ignore[return-value]
106102
"POST",
107103
__path,
@@ -834,11 +830,7 @@ async def put_component_template(
834830
__body["_meta"] = meta
835831
if version is not None:
836832
__body["version"] = version
837-
if not __body:
838-
__body = None # type: ignore[assignment]
839-
__headers = {"accept": "application/json"}
840-
if __body is not None:
841-
__headers["content-type"] = "application/json"
833+
__headers = {"accept": "application/json", "content-type": "application/json"}
842834
return await self.perform_request( # type: ignore[return-value]
843835
"PUT",
844836
__path,
@@ -916,11 +908,7 @@ async def put_settings(
916908
__body["persistent"] = persistent
917909
if transient is not None:
918910
__body["transient"] = transient
919-
if not __body:
920-
__body = None # type: ignore[assignment]
921-
__headers = {"accept": "application/json"}
922-
if __body is not None:
923-
__headers["content-type"] = "application/json"
911+
__headers = {"accept": "application/json", "content-type": "application/json"}
924912
return await self.perform_request( # type: ignore[return-value]
925913
"PUT",
926914
__path,
@@ -1057,11 +1045,7 @@ async def reroute(
10571045
if not __body:
10581046
if commands is not None:
10591047
__body["commands"] = commands
1060-
if not __body:
1061-
__body = None # type: ignore[assignment]
1062-
__headers = {"accept": "application/json"}
1063-
if __body is not None:
1064-
__headers["content-type"] = "application/json"
1048+
__headers = {"accept": "application/json", "content-type": "application/json"}
10651049
return await self.perform_request( # type: ignore[return-value]
10661050
"POST",
10671051
__path,

0 commit comments

Comments
 (0)