Skip to content

Commit 693feb0

Browse files
Auto-generated API code
1 parent c81b3db commit 693feb0

Some content is hidden

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

55 files changed

+291
-1451
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 11 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -853,11 +853,7 @@ async def close_point_in_time(
853853
if not __body:
854854
if id is not None:
855855
__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"
856+
__headers = {"accept": "application/json", "content-type": "application/json"}
861857
return await self.perform_request( # type: ignore[return-value]
862858
"DELETE",
863859
__path,
@@ -1627,11 +1623,7 @@ async def delete_by_query(
16271623
__body["slice"] = slice
16281624
if sort is not None:
16291625
__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"
1626+
__headers = {"accept": "application/json", "content-type": "application/json"}
16351627
return await self.perform_request( # type: ignore[return-value]
16361628
"POST",
16371629
__path,
@@ -3118,11 +3110,7 @@ async def mget(
31183110
__body["docs"] = docs
31193111
if ids is not None:
31203112
__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"
3113+
__headers = {"accept": "application/json", "content-type": "application/json"}
31263114
return await self.perform_request( # type: ignore[return-value]
31273115
"POST",
31283116
__path,
@@ -3722,11 +3710,7 @@ async def put_script(
37223710
if not __body:
37233711
if script is not None:
37243712
__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"
3713+
__headers = {"accept": "application/json", "content-type": "application/json"}
37303714
return await self.perform_request( # type: ignore[return-value]
37313715
"PUT",
37323716
__path,
@@ -3822,11 +3806,7 @@ async def rank_eval(
38223806
__body["requests"] = requests
38233807
if metric is not None:
38243808
__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"
3809+
__headers = {"accept": "application/json", "content-type": "application/json"}
38303810
return await self.perform_request( # type: ignore[return-value]
38313811
"POST",
38323812
__path,
@@ -3999,11 +3979,7 @@ async def reindex(
39993979
__body["script"] = script
40003980
if size is not None:
40013981
__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"
3982+
__headers = {"accept": "application/json", "content-type": "application/json"}
40073983
return await self.perform_request( # type: ignore[return-value]
40083984
"POST",
40093985
__path,
@@ -4131,11 +4107,7 @@ async def render_search_template(
41314107
__body["params"] = params
41324108
if source is not None:
41334109
__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"
4110+
__headers = {"accept": "application/json", "content-type": "application/json"}
41394111
return await self.perform_request( # type: ignore[return-value]
41404112
"POST",
41414113
__path,
@@ -4218,11 +4190,7 @@ async def scripts_painless_execute(
42184190
__body["context_setup"] = context_setup
42194191
if script is not None:
42204192
__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"
4193+
__headers = {"accept": "application/json", "content-type": "application/json"}
42264194
return await self.perform_request( # type: ignore[return-value]
42274195
"POST",
42284196
__path,
@@ -5556,11 +5524,7 @@ async def search_template(
55565524
__body["profile"] = profile
55575525
if source is not None:
55585526
__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"
5527+
__headers = {"accept": "application/json", "content-type": "application/json"}
55645528
return await self.perform_request( # type: ignore[return-value]
55655529
"POST",
55665530
__path,
@@ -5665,11 +5629,7 @@ async def terms_enum(
56655629
__body["string"] = string
56665630
if timeout is not None:
56675631
__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"
5632+
__headers = {"accept": "application/json", "content-type": "application/json"}
56735633
return await self.perform_request( # type: ignore[return-value]
56745634
"POST",
56755635
__path,
@@ -6031,11 +5991,7 @@ async def update(
60315991
__body["_source"] = source
60325992
if upsert is not None:
60335993
__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"
5994+
__headers = {"accept": "application/json", "content-type": "application/json"}
60395995
return await self.perform_request( # type: ignore[return-value]
60405996
"POST",
60415997
__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: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -834,11 +834,7 @@ async def put_component_template(
834834
__body["_meta"] = meta
835835
if version is not None:
836836
__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"
837+
__headers = {"accept": "application/json", "content-type": "application/json"}
842838
return await self.perform_request( # type: ignore[return-value]
843839
"PUT",
844840
__path,
@@ -916,11 +912,7 @@ async def put_settings(
916912
__body["persistent"] = persistent
917913
if transient is not None:
918914
__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"
915+
__headers = {"accept": "application/json", "content-type": "application/json"}
924916
return await self.perform_request( # type: ignore[return-value]
925917
"PUT",
926918
__path,

0 commit comments

Comments
 (0)