Skip to content

Commit 2ce3c32

Browse files
committed
Run code generation
1 parent 5ff3169 commit 2ce3c32

Some content is hidden

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

78 files changed

+8530
-1632
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 431 additions & 81 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/async_search.py

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async def delete(
4545
"""
4646
if id in SKIP_IN_PATH:
4747
raise ValueError("Empty value passed for parameter 'id'")
48-
__path = f"/_async_search/{_quote(id)}"
48+
__path_parts: t.Dict[str, str]
49+
__path_parts = {"id": _quote(id)}
50+
__path = f'/_async_search/{__path_parts["id"]}'
4951
__query: t.Dict[str, t.Any] = {}
5052
if error_trace is not None:
5153
__query["error_trace"] = error_trace
@@ -57,7 +59,12 @@ async def delete(
5759
__query["pretty"] = pretty
5860
__headers = {"accept": "application/json"}
5961
return await self.perform_request( # type: ignore[return-value]
60-
"DELETE", __path, params=__query, headers=__headers
62+
"DELETE",
63+
__path,
64+
params=__query,
65+
headers=__headers,
66+
endpoint_id="async_search.delete",
67+
path_parts=__path_parts,
6168
)
6269

6370
@_rewrite_parameters()
@@ -99,7 +106,9 @@ async def get(
99106
"""
100107
if id in SKIP_IN_PATH:
101108
raise ValueError("Empty value passed for parameter 'id'")
102-
__path = f"/_async_search/{_quote(id)}"
109+
__path_parts: t.Dict[str, str]
110+
__path_parts = {"id": _quote(id)}
111+
__path = f'/_async_search/{__path_parts["id"]}'
103112
__query: t.Dict[str, t.Any] = {}
104113
if error_trace is not None:
105114
__query["error_trace"] = error_trace
@@ -117,7 +126,12 @@ async def get(
117126
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
118127
__headers = {"accept": "application/json"}
119128
return await self.perform_request( # type: ignore[return-value]
120-
"GET", __path, params=__query, headers=__headers
129+
"GET",
130+
__path,
131+
params=__query,
132+
headers=__headers,
133+
endpoint_id="async_search.get",
134+
path_parts=__path_parts,
121135
)
122136

123137
@_rewrite_parameters()
@@ -140,7 +154,9 @@ async def status(
140154
"""
141155
if id in SKIP_IN_PATH:
142156
raise ValueError("Empty value passed for parameter 'id'")
143-
__path = f"/_async_search/status/{_quote(id)}"
157+
__path_parts: t.Dict[str, str]
158+
__path_parts = {"id": _quote(id)}
159+
__path = f'/_async_search/status/{__path_parts["id"]}'
144160
__query: t.Dict[str, t.Any] = {}
145161
if error_trace is not None:
146162
__query["error_trace"] = error_trace
@@ -152,7 +168,12 @@ async def status(
152168
__query["pretty"] = pretty
153169
__headers = {"accept": "application/json"}
154170
return await self.perform_request( # type: ignore[return-value]
155-
"GET", __path, params=__query, headers=__headers
171+
"GET",
172+
__path,
173+
params=__query,
174+
headers=__headers,
175+
endpoint_id="async_search.status",
176+
path_parts=__path_parts,
156177
)
157178

158179
@_rewrite_parameters(
@@ -428,9 +449,12 @@ async def submit(
428449
up to a certain timeout. When the async search completes within the timeout,
429450
the response won’t include the ID as the results are not stored in the cluster.
430451
"""
452+
__path_parts: t.Dict[str, str]
431453
if index not in SKIP_IN_PATH:
432-
__path = f"/{_quote(index)}/_async_search"
454+
__path_parts = {"index": _quote(index)}
455+
__path = f'/{__path_parts["index"]}/_async_search'
433456
else:
457+
__path_parts = {}
434458
__path = "/_async_search"
435459
__query: t.Dict[str, t.Any] = {}
436460
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -590,5 +614,11 @@ async def submit(
590614
if __body is not None:
591615
__headers["content-type"] = "application/json"
592616
return await self.perform_request( # type: ignore[return-value]
593-
"POST", __path, params=__query, headers=__headers, body=__body
617+
"POST",
618+
__path,
619+
params=__query,
620+
headers=__headers,
621+
body=__body,
622+
endpoint_id="async_search.submit",
623+
path_parts=__path_parts,
594624
)

elasticsearch/_async/client/autoscaling.py

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async def delete_autoscaling_policy(
4545
"""
4646
if name in SKIP_IN_PATH:
4747
raise ValueError("Empty value passed for parameter 'name'")
48-
__path = f"/_autoscaling/policy/{_quote(name)}"
48+
__path_parts: t.Dict[str, str]
49+
__path_parts = {"name": _quote(name)}
50+
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
4951
__query: t.Dict[str, t.Any] = {}
5052
if error_trace is not None:
5153
__query["error_trace"] = error_trace
@@ -57,7 +59,12 @@ async def delete_autoscaling_policy(
5759
__query["pretty"] = pretty
5860
__headers = {"accept": "application/json"}
5961
return await self.perform_request( # type: ignore[return-value]
60-
"DELETE", __path, params=__query, headers=__headers
62+
"DELETE",
63+
__path,
64+
params=__query,
65+
headers=__headers,
66+
endpoint_id="autoscaling.delete_autoscaling_policy",
67+
path_parts=__path_parts,
6168
)
6269

6370
@_rewrite_parameters()
@@ -75,6 +82,8 @@ async def get_autoscaling_capacity(
7582
7683
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html>`_
7784
"""
85+
__path_parts: t.Dict[str, str]
86+
__path_parts = {}
7887
__path = "/_autoscaling/capacity"
7988
__query: t.Dict[str, t.Any] = {}
8089
if error_trace is not None:
@@ -87,7 +96,12 @@ async def get_autoscaling_capacity(
8796
__query["pretty"] = pretty
8897
__headers = {"accept": "application/json"}
8998
return await self.perform_request( # type: ignore[return-value]
90-
"GET", __path, params=__query, headers=__headers
99+
"GET",
100+
__path,
101+
params=__query,
102+
headers=__headers,
103+
endpoint_id="autoscaling.get_autoscaling_capacity",
104+
path_parts=__path_parts,
91105
)
92106

93107
@_rewrite_parameters()
@@ -110,7 +124,9 @@ async def get_autoscaling_policy(
110124
"""
111125
if name in SKIP_IN_PATH:
112126
raise ValueError("Empty value passed for parameter 'name'")
113-
__path = f"/_autoscaling/policy/{_quote(name)}"
127+
__path_parts: t.Dict[str, str]
128+
__path_parts = {"name": _quote(name)}
129+
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
114130
__query: t.Dict[str, t.Any] = {}
115131
if error_trace is not None:
116132
__query["error_trace"] = error_trace
@@ -122,7 +138,12 @@ async def get_autoscaling_policy(
122138
__query["pretty"] = pretty
123139
__headers = {"accept": "application/json"}
124140
return await self.perform_request( # type: ignore[return-value]
125-
"GET", __path, params=__query, headers=__headers
141+
"GET",
142+
__path,
143+
params=__query,
144+
headers=__headers,
145+
endpoint_id="autoscaling.get_autoscaling_policy",
146+
path_parts=__path_parts,
126147
)
127148

128149
@_rewrite_parameters(
@@ -156,7 +177,9 @@ async def put_autoscaling_policy(
156177
)
157178
elif policy is not None and body is not None:
158179
raise ValueError("Cannot set both 'policy' and 'body'")
159-
__path = f"/_autoscaling/policy/{_quote(name)}"
180+
__path_parts: t.Dict[str, str]
181+
__path_parts = {"name": _quote(name)}
182+
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
160183
__query: t.Dict[str, t.Any] = {}
161184
if error_trace is not None:
162185
__query["error_trace"] = error_trace
@@ -169,5 +192,11 @@ async def put_autoscaling_policy(
169192
__body = policy if policy is not None else body
170193
__headers = {"accept": "application/json", "content-type": "application/json"}
171194
return await self.perform_request( # type: ignore[return-value]
172-
"PUT", __path, params=__query, headers=__headers, body=__body
195+
"PUT",
196+
__path,
197+
params=__query,
198+
headers=__headers,
199+
body=__body,
200+
endpoint_id="autoscaling.put_autoscaling_policy",
201+
path_parts=__path_parts,
173202
)

0 commit comments

Comments
 (0)