Skip to content

Commit 53c5ea3

Browse files
Auto-generated API code (#2467)
1 parent f02b7fa commit 53c5ea3

Some content is hidden

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

76 files changed

+798
-1316
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@ async def clear_scroll(
743743
744744
:param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`.
745745
"""
746-
__path_parts: t.Dict[str, str]
747-
__path_parts = {}
746+
__path_parts: t.Dict[str, str] = {}
748747
__path = "/_search/scroll"
749748
__query: t.Dict[str, t.Any] = {}
750749
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -796,8 +795,7 @@ async def close_point_in_time(
796795
"""
797796
if id is None and body is None:
798797
raise ValueError("Empty value passed for parameter 'id'")
799-
__path_parts: t.Dict[str, str]
800-
__path_parts = {}
798+
__path_parts: t.Dict[str, str] = {}
801799
__path = "/_pit"
802800
__query: t.Dict[str, t.Any] = {}
803801
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -1038,8 +1036,7 @@ async def create(
10381036
)
10391037
elif document is not None and body is not None:
10401038
raise ValueError("Cannot set both 'document' and 'body'")
1041-
__path_parts: t.Dict[str, str]
1042-
__path_parts = {"index": _quote(index), "id": _quote(id)}
1039+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
10431040
__path = f'/{__path_parts["index"]}/_create/{__path_parts["id"]}'
10441041
__query: t.Dict[str, t.Any] = {}
10451042
if error_trace is not None:
@@ -1130,8 +1127,7 @@ async def delete(
11301127
raise ValueError("Empty value passed for parameter 'index'")
11311128
if id in SKIP_IN_PATH:
11321129
raise ValueError("Empty value passed for parameter 'id'")
1133-
__path_parts: t.Dict[str, str]
1134-
__path_parts = {"index": _quote(index), "id": _quote(id)}
1130+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
11351131
__path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
11361132
__query: t.Dict[str, t.Any] = {}
11371133
if error_trace is not None:
@@ -1296,8 +1292,7 @@ async def delete_by_query(
12961292
"""
12971293
if index in SKIP_IN_PATH:
12981294
raise ValueError("Empty value passed for parameter 'index'")
1299-
__path_parts: t.Dict[str, str]
1300-
__path_parts = {"index": _quote(index)}
1295+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
13011296
__path = f'/{__path_parts["index"]}/_delete_by_query'
13021297
__query: t.Dict[str, t.Any] = {}
13031298
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -1416,8 +1411,7 @@ async def delete_by_query_rethrottle(
14161411
"""
14171412
if task_id in SKIP_IN_PATH:
14181413
raise ValueError("Empty value passed for parameter 'task_id'")
1419-
__path_parts: t.Dict[str, str]
1420-
__path_parts = {"task_id": _quote(task_id)}
1414+
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
14211415
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
14221416
__query: t.Dict[str, t.Any] = {}
14231417
if error_trace is not None:
@@ -1468,8 +1462,7 @@ async def delete_script(
14681462
"""
14691463
if id in SKIP_IN_PATH:
14701464
raise ValueError("Empty value passed for parameter 'id'")
1471-
__path_parts: t.Dict[str, str]
1472-
__path_parts = {"id": _quote(id)}
1465+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
14731466
__path = f'/_scripts/{__path_parts["id"]}'
14741467
__query: t.Dict[str, t.Any] = {}
14751468
if error_trace is not None:
@@ -1555,8 +1548,7 @@ async def exists(
15551548
raise ValueError("Empty value passed for parameter 'index'")
15561549
if id in SKIP_IN_PATH:
15571550
raise ValueError("Empty value passed for parameter 'id'")
1558-
__path_parts: t.Dict[str, str]
1559-
__path_parts = {"index": _quote(index), "id": _quote(id)}
1551+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
15601552
__path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
15611553
__query: t.Dict[str, t.Any] = {}
15621554
if error_trace is not None:
@@ -1654,8 +1646,7 @@ async def exists_source(
16541646
raise ValueError("Empty value passed for parameter 'index'")
16551647
if id in SKIP_IN_PATH:
16561648
raise ValueError("Empty value passed for parameter 'id'")
1657-
__path_parts: t.Dict[str, str]
1658-
__path_parts = {"index": _quote(index), "id": _quote(id)}
1649+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
16591650
__path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}'
16601651
__query: t.Dict[str, t.Any] = {}
16611652
if error_trace is not None:
@@ -1761,8 +1752,7 @@ async def explain(
17611752
raise ValueError("Empty value passed for parameter 'index'")
17621753
if id in SKIP_IN_PATH:
17631754
raise ValueError("Empty value passed for parameter 'id'")
1764-
__path_parts: t.Dict[str, str]
1765-
__path_parts = {"index": _quote(index), "id": _quote(id)}
1755+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
17661756
__path = f'/{__path_parts["index"]}/_explain/{__path_parts["id"]}'
17671757
__query: t.Dict[str, t.Any] = {}
17681758
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -1992,8 +1982,7 @@ async def get(
19921982
raise ValueError("Empty value passed for parameter 'index'")
19931983
if id in SKIP_IN_PATH:
19941984
raise ValueError("Empty value passed for parameter 'id'")
1995-
__path_parts: t.Dict[str, str]
1996-
__path_parts = {"index": _quote(index), "id": _quote(id)}
1985+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
19971986
__path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}'
19981987
__query: t.Dict[str, t.Any] = {}
19991988
if error_trace is not None:
@@ -2057,8 +2046,7 @@ async def get_script(
20572046
"""
20582047
if id in SKIP_IN_PATH:
20592048
raise ValueError("Empty value passed for parameter 'id'")
2060-
__path_parts: t.Dict[str, str]
2061-
__path_parts = {"id": _quote(id)}
2049+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
20622050
__path = f'/_scripts/{__path_parts["id"]}'
20632051
__query: t.Dict[str, t.Any] = {}
20642052
if error_trace is not None:
@@ -2095,8 +2083,7 @@ async def get_script_context(
20952083
20962084
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html>`_
20972085
"""
2098-
__path_parts: t.Dict[str, str]
2099-
__path_parts = {}
2086+
__path_parts: t.Dict[str, str] = {}
21002087
__path = "/_script_context"
21012088
__query: t.Dict[str, t.Any] = {}
21022089
if error_trace is not None:
@@ -2131,8 +2118,7 @@ async def get_script_languages(
21312118
21322119
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html>`_
21332120
"""
2134-
__path_parts: t.Dict[str, str]
2135-
__path_parts = {}
2121+
__path_parts: t.Dict[str, str] = {}
21362122
__path = "/_script_language"
21372123
__query: t.Dict[str, t.Any] = {}
21382124
if error_trace is not None:
@@ -2211,8 +2197,7 @@ async def get_source(
22112197
raise ValueError("Empty value passed for parameter 'index'")
22122198
if id in SKIP_IN_PATH:
22132199
raise ValueError("Empty value passed for parameter 'id'")
2214-
__path_parts: t.Dict[str, str]
2215-
__path_parts = {"index": _quote(index), "id": _quote(id)}
2200+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
22162201
__path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}'
22172202
__query: t.Dict[str, t.Any] = {}
22182203
if error_trace is not None:
@@ -2455,8 +2440,7 @@ async def info(
24552440
24562441
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html>`_
24572442
"""
2458-
__path_parts: t.Dict[str, str]
2459-
__path_parts = {}
2443+
__path_parts: t.Dict[str, str] = {}
24602444
__path = "/"
24612445
__query: t.Dict[str, t.Any] = {}
24622446
if error_trace is not None:
@@ -2537,8 +2521,7 @@ async def knn_search(
25372521
raise ValueError("Empty value passed for parameter 'index'")
25382522
if knn is None and body is None:
25392523
raise ValueError("Empty value passed for parameter 'knn'")
2540-
__path_parts: t.Dict[str, str]
2541-
__path_parts = {"index": _quote(index)}
2524+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
25422525
__path = f'/{__path_parts["index"]}/_knn_search'
25432526
__query: t.Dict[str, t.Any] = {}
25442527
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3069,8 +3052,7 @@ async def open_point_in_time(
30693052
raise ValueError("Empty value passed for parameter 'index'")
30703053
if keep_alive is None:
30713054
raise ValueError("Empty value passed for parameter 'keep_alive'")
3072-
__path_parts: t.Dict[str, str]
3073-
__path_parts = {"index": _quote(index)}
3055+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
30743056
__path = f'/{__path_parts["index"]}/_pit'
30753057
__query: t.Dict[str, t.Any] = {}
30763058
if keep_alive is not None:
@@ -3335,8 +3317,7 @@ async def reindex(
33353317
raise ValueError("Empty value passed for parameter 'dest'")
33363318
if source is None and body is None:
33373319
raise ValueError("Empty value passed for parameter 'source'")
3338-
__path_parts: t.Dict[str, str]
3339-
__path_parts = {}
3320+
__path_parts: t.Dict[str, str] = {}
33403321
__path = "/_reindex"
33413322
__query: t.Dict[str, t.Any] = {}
33423323
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3410,8 +3391,7 @@ async def reindex_rethrottle(
34103391
"""
34113392
if task_id in SKIP_IN_PATH:
34123393
raise ValueError("Empty value passed for parameter 'task_id'")
3413-
__path_parts: t.Dict[str, str]
3414-
__path_parts = {"task_id": _quote(task_id)}
3394+
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
34153395
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
34163396
__query: t.Dict[str, t.Any] = {}
34173397
if error_trace is not None:
@@ -3528,8 +3508,7 @@ async def scripts_painless_execute(
35283508
:param context_setup: Additional parameters for the `context`.
35293509
:param script: The Painless script to execute.
35303510
"""
3531-
__path_parts: t.Dict[str, str]
3532-
__path_parts = {}
3511+
__path_parts: t.Dict[str, str] = {}
35333512
__path = "/_scripts/painless/_execute"
35343513
__query: t.Dict[str, t.Any] = {}
35353514
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -3591,8 +3570,7 @@ async def scroll(
35913570
"""
35923571
if scroll_id is None and body is None:
35933572
raise ValueError("Empty value passed for parameter 'scroll_id'")
3594-
__path_parts: t.Dict[str, str]
3595-
__path_parts = {}
3573+
__path_parts: t.Dict[str, str] = {}
35963574
__path = "/_search/scroll"
35973575
__query: t.Dict[str, t.Any] = {}
35983576
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -4234,8 +4212,7 @@ async def search_mvt(
42344212
raise ValueError("Empty value passed for parameter 'x'")
42354213
if y in SKIP_IN_PATH:
42364214
raise ValueError("Empty value passed for parameter 'y'")
4237-
__path_parts: t.Dict[str, str]
4238-
__path_parts = {
4215+
__path_parts: t.Dict[str, str] = {
42394216
"index": _quote(index),
42404217
"field": _quote(field),
42414218
"zoom": _quote(zoom),
@@ -4593,8 +4570,7 @@ async def terms_enum(
45934570
raise ValueError("Empty value passed for parameter 'index'")
45944571
if field is None and body is None:
45954572
raise ValueError("Empty value passed for parameter 'field'")
4596-
__path_parts: t.Dict[str, str]
4597-
__path_parts = {"index": _quote(index)}
4573+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
45984574
__path = f'/{__path_parts["index"]}/_terms_enum'
45994575
__query: t.Dict[str, t.Any] = {}
46004576
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -4854,8 +4830,7 @@ async def update(
48544830
raise ValueError("Empty value passed for parameter 'index'")
48554831
if id in SKIP_IN_PATH:
48564832
raise ValueError("Empty value passed for parameter 'id'")
4857-
__path_parts: t.Dict[str, str]
4858-
__path_parts = {"index": _quote(index), "id": _quote(id)}
4833+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)}
48594834
__path = f'/{__path_parts["index"]}/_update/{__path_parts["id"]}'
48604835
__query: t.Dict[str, t.Any] = {}
48614836
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -5054,8 +5029,7 @@ async def update_by_query(
50545029
"""
50555030
if index in SKIP_IN_PATH:
50565031
raise ValueError("Empty value passed for parameter 'index'")
5057-
__path_parts: t.Dict[str, str]
5058-
__path_parts = {"index": _quote(index)}
5032+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
50595033
__path = f'/{__path_parts["index"]}/_update_by_query'
50605034
__query: t.Dict[str, t.Any] = {}
50615035
__body: t.Dict[str, t.Any] = body if body is not None else {}
@@ -5182,8 +5156,7 @@ async def update_by_query_rethrottle(
51825156
"""
51835157
if task_id in SKIP_IN_PATH:
51845158
raise ValueError("Empty value passed for parameter 'task_id'")
5185-
__path_parts: t.Dict[str, str]
5186-
__path_parts = {"task_id": _quote(task_id)}
5159+
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
51875160
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
51885161
__query: t.Dict[str, t.Any] = {}
51895162
if error_trace is not None:

elasticsearch/_async/client/async_search.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +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)}
48+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
5049
__path = f'/_async_search/{__path_parts["id"]}'
5150
__query: t.Dict[str, t.Any] = {}
5251
if error_trace is not None:
@@ -106,8 +105,7 @@ async def get(
106105
"""
107106
if id in SKIP_IN_PATH:
108107
raise ValueError("Empty value passed for parameter 'id'")
109-
__path_parts: t.Dict[str, str]
110-
__path_parts = {"id": _quote(id)}
108+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
111109
__path = f'/_async_search/{__path_parts["id"]}'
112110
__query: t.Dict[str, t.Any] = {}
113111
if error_trace is not None:
@@ -154,8 +152,7 @@ async def status(
154152
"""
155153
if id in SKIP_IN_PATH:
156154
raise ValueError("Empty value passed for parameter 'id'")
157-
__path_parts: t.Dict[str, str]
158-
__path_parts = {"id": _quote(id)}
155+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
159156
__path = f'/_async_search/status/{__path_parts["id"]}'
160157
__query: t.Dict[str, t.Any] = {}
161158
if error_trace is not None:

elasticsearch/_async/client/autoscaling.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +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)}
48+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
5049
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
5150
__query: t.Dict[str, t.Any] = {}
5251
if error_trace is not None:
@@ -82,8 +81,7 @@ async def get_autoscaling_capacity(
8281
8382
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html>`_
8483
"""
85-
__path_parts: t.Dict[str, str]
86-
__path_parts = {}
84+
__path_parts: t.Dict[str, str] = {}
8785
__path = "/_autoscaling/capacity"
8886
__query: t.Dict[str, t.Any] = {}
8987
if error_trace is not None:
@@ -124,8 +122,7 @@ async def get_autoscaling_policy(
124122
"""
125123
if name in SKIP_IN_PATH:
126124
raise ValueError("Empty value passed for parameter 'name'")
127-
__path_parts: t.Dict[str, str]
128-
__path_parts = {"name": _quote(name)}
125+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
129126
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
130127
__query: t.Dict[str, t.Any] = {}
131128
if error_trace is not None:
@@ -177,8 +174,7 @@ async def put_autoscaling_policy(
177174
)
178175
elif policy is not None and body is not None:
179176
raise ValueError("Cannot set both 'policy' and 'body'")
180-
__path_parts: t.Dict[str, str]
181-
__path_parts = {"name": _quote(name)}
177+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
182178
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
183179
__query: t.Dict[str, t.Any] = {}
184180
if error_trace is not None:

0 commit comments

Comments
 (0)