@@ -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 ,
0 commit comments