Skip to content

Commit 5672985

Browse files
Auto-generated API code
1 parent f02b7fa commit 5672985

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

+1652
-8568
lines changed

elasticsearch/_async/client/__init__.py

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

elasticsearch/_async/client/async_search.py

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

7063
@_rewrite_parameters()
@@ -106,9 +99,7 @@ async def get(
10699
"""
107100
if id in SKIP_IN_PATH:
108101
raise ValueError("Empty value passed for parameter 'id'")
109-
__path_parts: t.Dict[str, str]
110-
__path_parts = {"id": _quote(id)}
111-
__path = f'/_async_search/{__path_parts["id"]}'
102+
__path = f"/_async_search/{_quote(id)}"
112103
__query: t.Dict[str, t.Any] = {}
113104
if error_trace is not None:
114105
__query["error_trace"] = error_trace
@@ -126,12 +117,7 @@ async def get(
126117
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
127118
__headers = {"accept": "application/json"}
128119
return await self.perform_request( # type: ignore[return-value]
129-
"GET",
130-
__path,
131-
params=__query,
132-
headers=__headers,
133-
endpoint_id="async_search.get",
134-
path_parts=__path_parts,
120+
"GET", __path, params=__query, headers=__headers
135121
)
136122

137123
@_rewrite_parameters()
@@ -154,9 +140,7 @@ async def status(
154140
"""
155141
if id in SKIP_IN_PATH:
156142
raise ValueError("Empty value passed for parameter 'id'")
157-
__path_parts: t.Dict[str, str]
158-
__path_parts = {"id": _quote(id)}
159-
__path = f'/_async_search/status/{__path_parts["id"]}'
143+
__path = f"/_async_search/status/{_quote(id)}"
160144
__query: t.Dict[str, t.Any] = {}
161145
if error_trace is not None:
162146
__query["error_trace"] = error_trace
@@ -168,12 +152,7 @@ async def status(
168152
__query["pretty"] = pretty
169153
__headers = {"accept": "application/json"}
170154
return await self.perform_request( # type: ignore[return-value]
171-
"GET",
172-
__path,
173-
params=__query,
174-
headers=__headers,
175-
endpoint_id="async_search.status",
176-
path_parts=__path_parts,
155+
"GET", __path, params=__query, headers=__headers
177156
)
178157

179158
@_rewrite_parameters(
@@ -449,12 +428,9 @@ async def submit(
449428
up to a certain timeout. When the async search completes within the timeout,
450429
the response won’t include the ID as the results are not stored in the cluster.
451430
"""
452-
__path_parts: t.Dict[str, str]
453431
if index not in SKIP_IN_PATH:
454-
__path_parts = {"index": _quote(index)}
455-
__path = f'/{__path_parts["index"]}/_async_search'
432+
__path = f"/{_quote(index)}/_async_search"
456433
else:
457-
__path_parts = {}
458434
__path = "/_async_search"
459435
__query: t.Dict[str, t.Any] = {}
460436
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -614,11 +590,5 @@ async def submit(
614590
if __body is not None:
615591
__headers["content-type"] = "application/json"
616592
return await self.perform_request( # type: ignore[return-value]
617-
"POST",
618-
__path,
619-
params=__query,
620-
headers=__headers,
621-
body=__body,
622-
endpoint_id="async_search.submit",
623-
path_parts=__path_parts,
593+
"POST", __path, params=__query, headers=__headers, body=__body
624594
)

elasticsearch/_async/client/autoscaling.py

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

7063
@_rewrite_parameters()
@@ -82,8 +75,6 @@ async def get_autoscaling_capacity(
8275
8376
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html>`_
8477
"""
85-
__path_parts: t.Dict[str, str]
86-
__path_parts = {}
8778
__path = "/_autoscaling/capacity"
8879
__query: t.Dict[str, t.Any] = {}
8980
if error_trace is not None:
@@ -96,12 +87,7 @@ async def get_autoscaling_capacity(
9687
__query["pretty"] = pretty
9788
__headers = {"accept": "application/json"}
9889
return await self.perform_request( # type: ignore[return-value]
99-
"GET",
100-
__path,
101-
params=__query,
102-
headers=__headers,
103-
endpoint_id="autoscaling.get_autoscaling_capacity",
104-
path_parts=__path_parts,
90+
"GET", __path, params=__query, headers=__headers
10591
)
10692

10793
@_rewrite_parameters()
@@ -124,9 +110,7 @@ async def get_autoscaling_policy(
124110
"""
125111
if name in SKIP_IN_PATH:
126112
raise ValueError("Empty value passed for parameter 'name'")
127-
__path_parts: t.Dict[str, str]
128-
__path_parts = {"name": _quote(name)}
129-
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
113+
__path = f"/_autoscaling/policy/{_quote(name)}"
130114
__query: t.Dict[str, t.Any] = {}
131115
if error_trace is not None:
132116
__query["error_trace"] = error_trace
@@ -138,12 +122,7 @@ async def get_autoscaling_policy(
138122
__query["pretty"] = pretty
139123
__headers = {"accept": "application/json"}
140124
return await self.perform_request( # type: ignore[return-value]
141-
"GET",
142-
__path,
143-
params=__query,
144-
headers=__headers,
145-
endpoint_id="autoscaling.get_autoscaling_policy",
146-
path_parts=__path_parts,
125+
"GET", __path, params=__query, headers=__headers
147126
)
148127

149128
@_rewrite_parameters(
@@ -177,9 +156,7 @@ async def put_autoscaling_policy(
177156
)
178157
elif policy is not None and body is not None:
179158
raise ValueError("Cannot set both 'policy' and 'body'")
180-
__path_parts: t.Dict[str, str]
181-
__path_parts = {"name": _quote(name)}
182-
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
159+
__path = f"/_autoscaling/policy/{_quote(name)}"
183160
__query: t.Dict[str, t.Any] = {}
184161
if error_trace is not None:
185162
__query["error_trace"] = error_trace
@@ -192,11 +169,5 @@ async def put_autoscaling_policy(
192169
__body = policy if policy is not None else body
193170
__headers = {"accept": "application/json", "content-type": "application/json"}
194171
return await self.perform_request( # type: ignore[return-value]
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,
172+
"PUT", __path, params=__query, headers=__headers, body=__body
202173
)

0 commit comments

Comments
 (0)