From f3522cf2ac6184594529e213f95be42b6b2e8cc7 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Sun, 10 Mar 2024 06:05:54 +0000 Subject: [PATCH] Auto-generated API code --- elasticsearch/_async/client/__init__.py | 81 +++----- elasticsearch/_async/client/async_search.py | 9 +- elasticsearch/_async/client/autoscaling.py | 12 +- elasticsearch/_async/client/cat.py | 27 +-- elasticsearch/_async/client/ccr.py | 36 ++-- elasticsearch/_async/client/cluster.py | 36 ++-- .../_async/client/dangling_indices.py | 9 +- elasticsearch/_async/client/enrich.py | 12 +- elasticsearch/_async/client/eql.py | 12 +- elasticsearch/_async/client/esql.py | 3 +- elasticsearch/_async/client/features.py | 6 +- elasticsearch/_async/client/fleet.py | 6 +- elasticsearch/_async/client/graph.py | 3 +- elasticsearch/_async/client/ilm.py | 30 +-- elasticsearch/_async/client/indices.py | 126 +++++------- elasticsearch/_async/client/ingest.py | 12 +- elasticsearch/_async/client/license.py | 21 +- elasticsearch/_async/client/logstash.py | 6 +- elasticsearch/_async/client/migration.py | 6 +- elasticsearch/_async/client/ml.py | 183 ++++++++---------- elasticsearch/_async/client/monitoring.py | 3 +- elasticsearch/_async/client/nodes.py | 6 +- elasticsearch/_async/client/query_ruleset.py | 12 +- elasticsearch/_async/client/rollup.py | 18 +- .../_async/client/search_application.py | 21 +- .../_async/client/searchable_snapshots.py | 6 +- elasticsearch/_async/client/security.py | 135 +++++-------- elasticsearch/_async/client/shutdown.py | 6 +- elasticsearch/_async/client/slm.py | 24 +-- elasticsearch/_async/client/snapshot.py | 70 +++---- elasticsearch/_async/client/sql.py | 18 +- elasticsearch/_async/client/ssl.py | 3 +- elasticsearch/_async/client/synonyms.py | 30 +-- elasticsearch/_async/client/tasks.py | 6 +- elasticsearch/_async/client/text_structure.py | 6 +- elasticsearch/_async/client/transform.py | 27 +-- elasticsearch/_async/client/watcher.py | 24 +-- elasticsearch/_async/client/xpack.py | 6 +- elasticsearch/_sync/client/__init__.py | 81 +++----- elasticsearch/_sync/client/async_search.py | 9 +- elasticsearch/_sync/client/autoscaling.py | 12 +- elasticsearch/_sync/client/cat.py | 27 +-- elasticsearch/_sync/client/ccr.py | 36 ++-- elasticsearch/_sync/client/cluster.py | 36 ++-- .../_sync/client/dangling_indices.py | 9 +- elasticsearch/_sync/client/enrich.py | 12 +- elasticsearch/_sync/client/eql.py | 12 +- elasticsearch/_sync/client/esql.py | 3 +- elasticsearch/_sync/client/features.py | 6 +- elasticsearch/_sync/client/fleet.py | 6 +- elasticsearch/_sync/client/graph.py | 3 +- elasticsearch/_sync/client/ilm.py | 30 +-- elasticsearch/_sync/client/indices.py | 126 +++++------- elasticsearch/_sync/client/ingest.py | 12 +- elasticsearch/_sync/client/license.py | 21 +- elasticsearch/_sync/client/logstash.py | 6 +- elasticsearch/_sync/client/migration.py | 6 +- elasticsearch/_sync/client/ml.py | 183 ++++++++---------- elasticsearch/_sync/client/monitoring.py | 3 +- elasticsearch/_sync/client/nodes.py | 6 +- elasticsearch/_sync/client/query_ruleset.py | 12 +- elasticsearch/_sync/client/rollup.py | 18 +- .../_sync/client/search_application.py | 21 +- .../_sync/client/searchable_snapshots.py | 6 +- elasticsearch/_sync/client/security.py | 135 +++++-------- elasticsearch/_sync/client/shutdown.py | 6 +- elasticsearch/_sync/client/slm.py | 24 +-- elasticsearch/_sync/client/snapshot.py | 70 +++---- elasticsearch/_sync/client/sql.py | 18 +- elasticsearch/_sync/client/ssl.py | 3 +- elasticsearch/_sync/client/synonyms.py | 30 +-- elasticsearch/_sync/client/tasks.py | 6 +- elasticsearch/_sync/client/text_structure.py | 6 +- elasticsearch/_sync/client/transform.py | 27 +-- elasticsearch/_sync/client/watcher.py | 24 +-- elasticsearch/_sync/client/xpack.py | 6 +- 76 files changed, 798 insertions(+), 1316 deletions(-) diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 7aabf2fcf..88648343d 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -743,8 +743,7 @@ async def clear_scroll( :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_search/scroll" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -796,8 +795,7 @@ async def close_point_in_time( """ if id is None and body is None: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_pit" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1038,8 +1036,7 @@ async def create( ) elif document is not None and body is not None: raise ValueError("Cannot set both 'document' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_create/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1130,8 +1127,7 @@ async def delete( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1296,8 +1292,7 @@ async def delete_by_query( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_delete_by_query' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1416,8 +1411,7 @@ async def delete_by_query_rethrottle( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1468,8 +1462,7 @@ async def delete_script( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_scripts/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1555,8 +1548,7 @@ async def exists( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1654,8 +1646,7 @@ async def exists_source( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1761,8 +1752,7 @@ async def explain( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_explain/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1992,8 +1982,7 @@ async def get( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2057,8 +2046,7 @@ async def get_script( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_scripts/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2095,8 +2083,7 @@ async def get_script_context( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_script_context" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2131,8 +2118,7 @@ async def get_script_languages( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_script_language" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2211,8 +2197,7 @@ async def get_source( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2455,8 +2440,7 @@ async def info( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2537,8 +2521,7 @@ async def knn_search( raise ValueError("Empty value passed for parameter 'index'") if knn is None and body is None: raise ValueError("Empty value passed for parameter 'knn'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_knn_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3069,8 +3052,7 @@ async def open_point_in_time( raise ValueError("Empty value passed for parameter 'index'") if keep_alive is None: raise ValueError("Empty value passed for parameter 'keep_alive'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_pit' __query: t.Dict[str, t.Any] = {} if keep_alive is not None: @@ -3335,8 +3317,7 @@ async def reindex( raise ValueError("Empty value passed for parameter 'dest'") if source is None and body is None: raise ValueError("Empty value passed for parameter 'source'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_reindex" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3410,8 +3391,7 @@ async def reindex_rethrottle( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -3528,8 +3508,7 @@ async def scripts_painless_execute( :param context_setup: Additional parameters for the `context`. :param script: The Painless script to execute. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_scripts/painless/_execute" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3591,8 +3570,7 @@ async def scroll( """ if scroll_id is None and body is None: raise ValueError("Empty value passed for parameter 'scroll_id'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_search/scroll" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4234,8 +4212,7 @@ async def search_mvt( raise ValueError("Empty value passed for parameter 'x'") if y in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'y'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "index": _quote(index), "field": _quote(field), "zoom": _quote(zoom), @@ -4593,8 +4570,7 @@ async def terms_enum( raise ValueError("Empty value passed for parameter 'index'") if field is None and body is None: raise ValueError("Empty value passed for parameter 'field'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_terms_enum' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4854,8 +4830,7 @@ async def update( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_update/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5054,8 +5029,7 @@ async def update_by_query( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_update_by_query' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5182,8 +5156,7 @@ async def update_by_query_rethrottle( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py index d3a841d60..d0f1affd6 100644 --- a/elasticsearch/_async/client/async_search.py +++ b/elasticsearch/_async/client/async_search.py @@ -45,8 +45,7 @@ async def delete( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_async_search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -106,8 +105,7 @@ async def get( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_async_search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -154,8 +152,7 @@ async def status( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_async_search/status/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/autoscaling.py b/elasticsearch/_async/client/autoscaling.py index 9626acb55..b558e94a5 100644 --- a/elasticsearch/_async/client/autoscaling.py +++ b/elasticsearch/_async/client/autoscaling.py @@ -45,8 +45,7 @@ async def delete_autoscaling_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_autoscaling/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -82,8 +81,7 @@ async def get_autoscaling_capacity( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_autoscaling/capacity" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -124,8 +122,7 @@ async def get_autoscaling_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_autoscaling/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -177,8 +174,7 @@ async def put_autoscaling_policy( ) elif policy is not None and body is not None: raise ValueError("Cannot set both 'policy' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_autoscaling/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index 63c884f7f..96922f928 100644 --- a/elasticsearch/_async/client/cat.py +++ b/elasticsearch/_async/client/cat.py @@ -503,8 +503,7 @@ async def health( :param ts: If true, returns `HH:MM:SS` and Unix epoch timestamps. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/health" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -581,8 +580,7 @@ async def help( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -775,8 +773,7 @@ async def master( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/master" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1349,8 +1346,7 @@ async def nodeattrs( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/nodeattrs" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1433,8 +1429,7 @@ async def nodes( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/nodes" __query: t.Dict[str, t.Any] = {} if bytes is not None: @@ -1513,8 +1508,7 @@ async def pending_tasks( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/pending_tasks" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1587,8 +1581,7 @@ async def plugins( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/plugins" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1758,8 +1751,7 @@ async def repositories( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/repositories" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2106,8 +2098,7 @@ async def tasks( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/tasks" __query: t.Dict[str, t.Any] = {} if actions is not None: diff --git a/elasticsearch/_async/client/ccr.py b/elasticsearch/_async/client/ccr.py index feae853c9..dea683da1 100644 --- a/elasticsearch/_async/client/ccr.py +++ b/elasticsearch/_async/client/ccr.py @@ -44,8 +44,7 @@ async def delete_auto_follow_pattern( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -136,8 +135,7 @@ async def follow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/follow' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -214,8 +212,7 @@ async def follow_info( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/info' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -257,8 +254,7 @@ async def follow_stats( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/stats' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -315,8 +311,7 @@ async def forget_follower( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/forget_follower' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -413,8 +408,7 @@ async def pause_auto_follow_pattern( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}/pause' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -456,8 +450,7 @@ async def pause_follow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/pause_follow' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -580,8 +573,7 @@ async def put_auto_follow_pattern( raise ValueError("Empty value passed for parameter 'name'") if remote_cluster is None and body is None: raise ValueError("Empty value passed for parameter 'remote_cluster'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -663,8 +655,7 @@ async def resume_auto_follow_pattern( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}/resume' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -742,8 +733,7 @@ async def resume_follow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/resume_follow' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -811,8 +801,7 @@ async def stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ccr/stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -854,8 +843,7 @@ async def unfollow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/unfollow' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index ac2455f0c..db807d710 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -60,8 +60,7 @@ async def allocation_explain( :param shard: Specifies the ID of the shard that you would like an explanation for. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/allocation/explain" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -130,8 +129,7 @@ async def delete_component_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -178,8 +176,7 @@ async def delete_voting_config_exclusions( configuration exclusions list is cleared even if some excluded nodes are still in the cluster. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/voting_config_exclusions" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -232,8 +229,7 @@ async def exists_component_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -353,8 +349,7 @@ async def get_settings( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/settings" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -540,8 +535,7 @@ async def info( """ if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"target": _quote(target)} + __path_parts: t.Dict[str, str] = {"target": _quote(target)} __path = f'/_info/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -587,8 +581,7 @@ async def pending_tasks( no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/pending_tasks" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -640,8 +633,7 @@ async def post_voting_config_exclusions( If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/voting_config_exclusions" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -728,8 +720,7 @@ async def put_component_template( raise ValueError("Empty value passed for parameter 'name'") if template is None and body is None: raise ValueError("Empty value passed for parameter 'template'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -795,8 +786,7 @@ async def put_settings( :param timeout: Explicit operation timeout :param transient: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/settings" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -844,8 +834,7 @@ async def remote_info( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_remote/info" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -906,8 +895,7 @@ async def reroute( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/reroute" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/dangling_indices.py b/elasticsearch/_async/client/dangling_indices.py index 448d8afff..ee33a148f 100644 --- a/elasticsearch/_async/client/dangling_indices.py +++ b/elasticsearch/_async/client/dangling_indices.py @@ -55,8 +55,7 @@ async def delete_dangling_index( raise ValueError("Empty value passed for parameter 'index_uuid'") if accept_data_loss is None: raise ValueError("Empty value passed for parameter 'accept_data_loss'") - __path_parts: t.Dict[str, str] - __path_parts = {"index_uuid": _quote(index_uuid)} + __path_parts: t.Dict[str, str] = {"index_uuid": _quote(index_uuid)} __path = f'/_dangling/{__path_parts["index_uuid"]}' __query: t.Dict[str, t.Any] = {} if accept_data_loss is not None: @@ -113,8 +112,7 @@ async def import_dangling_index( raise ValueError("Empty value passed for parameter 'index_uuid'") if accept_data_loss is None: raise ValueError("Empty value passed for parameter 'accept_data_loss'") - __path_parts: t.Dict[str, str] - __path_parts = {"index_uuid": _quote(index_uuid)} + __path_parts: t.Dict[str, str] = {"index_uuid": _quote(index_uuid)} __path = f'/_dangling/{__path_parts["index_uuid"]}' __query: t.Dict[str, t.Any] = {} if accept_data_loss is not None: @@ -155,8 +153,7 @@ async def list_dangling_indices( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_dangling" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/enrich.py b/elasticsearch/_async/client/enrich.py index d7215b6ef..ad2020353 100644 --- a/elasticsearch/_async/client/enrich.py +++ b/elasticsearch/_async/client/enrich.py @@ -44,8 +44,7 @@ async def delete_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_enrich/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -88,8 +87,7 @@ async def execute_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_enrich/policy/{__path_parts["name"]}/_execute' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -186,8 +184,7 @@ async def put_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_enrich/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -232,8 +229,7 @@ async def stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_enrich/_stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/eql.py b/elasticsearch/_async/client/eql.py index 40395eb28..f02811fa7 100644 --- a/elasticsearch/_async/client/eql.py +++ b/elasticsearch/_async/client/eql.py @@ -47,8 +47,7 @@ async def delete( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_eql/search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -98,8 +97,7 @@ async def get( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_eql/search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -144,8 +142,7 @@ async def get_status( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_eql/search/status/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -259,8 +256,7 @@ async def search( raise ValueError("Empty value passed for parameter 'index'") if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_eql/search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/esql.py b/elasticsearch/_async/client/esql.py index 62efce6a5..d39a86f28 100644 --- a/elasticsearch/_async/client/esql.py +++ b/elasticsearch/_async/client/esql.py @@ -68,8 +68,7 @@ async def query( """ if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_query" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/features.py b/elasticsearch/_async/client/features.py index 06b6dd34b..a6fbf4d14 100644 --- a/elasticsearch/_async/client/features.py +++ b/elasticsearch/_async/client/features.py @@ -40,8 +40,7 @@ async def get_features( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_features" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -76,8 +75,7 @@ async def reset_features( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_features/_reset" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/fleet.py b/elasticsearch/_async/client/fleet.py index 21365e584..85e6834d4 100644 --- a/elasticsearch/_async/client/fleet.py +++ b/elasticsearch/_async/client/fleet.py @@ -59,8 +59,7 @@ async def global_checkpoints( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_fleet/global_checkpoints' __query: t.Dict[str, t.Any] = {} if checkpoints is not None: @@ -476,8 +475,7 @@ async def search( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_fleet/_fleet_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/graph.py b/elasticsearch/_async/client/graph.py index 95b56c5a9..ce85020c5 100644 --- a/elasticsearch/_async/client/graph.py +++ b/elasticsearch/_async/client/graph.py @@ -65,8 +65,7 @@ async def explore( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_graph/explore' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/ilm.py b/elasticsearch/_async/client/ilm.py index 774f37496..f1c383ef0 100644 --- a/elasticsearch/_async/client/ilm.py +++ b/elasticsearch/_async/client/ilm.py @@ -54,8 +54,7 @@ async def delete_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy": _quote(name)} + __path_parts: t.Dict[str, str] = {"policy": _quote(name)} __path = f'/_ilm/policy/{__path_parts["policy"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -118,8 +117,7 @@ async def explain_lifecycle( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ilm/explain' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -219,8 +217,7 @@ async def get_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -268,8 +265,7 @@ async def migrate_to_data_tiers( :param legacy_template_to_delete: :param node_attribute: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/migrate_to_data_tiers" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -329,8 +325,7 @@ async def move_to_step( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/_ilm/move/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -395,8 +390,7 @@ async def put_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy": _quote(name)} + __path_parts: t.Dict[str, str] = {"policy": _quote(name)} __path = f'/_ilm/policy/{__path_parts["policy"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -449,8 +443,7 @@ async def remove_policy( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ilm/remove' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -491,8 +484,7 @@ async def retry( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ilm/retry' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -534,8 +526,7 @@ async def start( :param master_timeout: :param timeout: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/start" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -582,8 +573,7 @@ async def stop( :param master_timeout: :param timeout: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/stop" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index 52c45a390..31ffc82f6 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -71,8 +71,10 @@ async def add_block( raise ValueError("Empty value passed for parameter 'index'") if block in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'block'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "block": _quote(block)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "block": _quote(block), + } __path = f'/{__path_parts["index"]}/_block/{__path_parts["block"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -346,8 +348,10 @@ async def clone( raise ValueError("Empty value passed for parameter 'index'") if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target": _quote(target)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target": _quote(target), + } __path = f'/{__path_parts["index"]}/_clone/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -439,8 +443,7 @@ async def close( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_close' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -517,8 +520,7 @@ async def create( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -581,8 +583,7 @@ async def create_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -710,8 +711,7 @@ async def delete( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -776,8 +776,7 @@ async def delete_alias( raise ValueError("Empty value passed for parameter 'index'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "name": _quote(name)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "name": _quote(name)} __path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -838,8 +837,7 @@ async def delete_data_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}/_lifecycle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -896,8 +894,7 @@ async def delete_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -949,8 +946,7 @@ async def delete_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1004,8 +1000,7 @@ async def delete_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1079,8 +1074,7 @@ async def disk_usage( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_disk_usage' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1145,8 +1139,10 @@ async def downsample( ) elif config is not None and body is not None: raise ValueError("Cannot set both 'config' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target_index": _quote(target_index)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target_index": _quote(target_index), + } __path = f'/{__path_parts["index"]}/_downsample/{__path_parts["target_index"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1215,8 +1211,7 @@ async def exists( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1356,8 +1351,7 @@ async def exists_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1408,8 +1402,7 @@ async def exists_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1463,8 +1456,7 @@ async def explain_data_lifecycle( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_lifecycle/explain' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1548,8 +1540,7 @@ async def field_usage_stats( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_field_usage_stats' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1816,8 +1807,7 @@ async def get( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1972,8 +1962,7 @@ async def get_data_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}/_lifecycle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2478,8 +2467,7 @@ async def migrate_to_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/_migrate/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2522,8 +2510,7 @@ async def modify_data_stream( """ if actions is None and body is None: raise ValueError("Empty value passed for parameter 'actions'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_data_stream/_modify" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2607,8 +2594,7 @@ async def open( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_open' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -2661,8 +2647,7 @@ async def promote_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/_promote/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2747,8 +2732,7 @@ async def put_alias( raise ValueError("Empty value passed for parameter 'index'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "name": _quote(name)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "name": _quote(name)} __path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2844,8 +2828,7 @@ async def put_data_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}/_lifecycle' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2942,8 +2925,7 @@ async def put_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3090,8 +3072,7 @@ async def put_mapping( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_mapping' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3314,8 +3295,7 @@ async def put_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3519,8 +3499,7 @@ async def reload_search_analyzers( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_reload_search_analyzers' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -3593,8 +3572,7 @@ async def resolve_cluster( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_resolve/cluster/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -3656,8 +3634,7 @@ async def resolve_index( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_resolve/index/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -3986,8 +3963,10 @@ async def shrink( raise ValueError("Empty value passed for parameter 'index'") if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target": _quote(target)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target": _quote(target), + } __path = f'/{__path_parts["index"]}/_shrink/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4104,8 +4083,7 @@ async def simulate_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/_simulate_index/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4282,8 +4260,10 @@ async def split( raise ValueError("Empty value passed for parameter 'index'") if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target": _quote(target)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target": _quote(target), + } __path = f'/{__path_parts["index"]}/_split/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4482,8 +4462,7 @@ async def unfreeze( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_unfreeze' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -4545,8 +4524,7 @@ async def update_aliases( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_aliases" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/ingest.py b/elasticsearch/_async/client/ingest.py index 33a56070b..57af35b2c 100644 --- a/elasticsearch/_async/client/ingest.py +++ b/elasticsearch/_async/client/ingest.py @@ -54,8 +54,7 @@ async def delete_pipeline( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ingest/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -94,8 +93,7 @@ async def geo_ip_stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ingest/geoip/stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -186,8 +184,7 @@ async def processor_grok( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ingest/processor/grok" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -262,8 +259,7 @@ async def put_pipeline( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ingest/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/license.py b/elasticsearch/_async/client/license.py index d511f5f00..576aadefe 100644 --- a/elasticsearch/_async/client/license.py +++ b/elasticsearch/_async/client/license.py @@ -39,8 +39,7 @@ async def delete( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -84,8 +83,7 @@ async def get( :param local: Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license" __query: t.Dict[str, t.Any] = {} if accept_enterprise is not None: @@ -124,8 +122,7 @@ async def get_basic_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/basic_status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -160,8 +157,7 @@ async def get_trial_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/trial_status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -207,8 +203,7 @@ async def post( :param licenses: A sequence of one or more JSON documents containing the license information. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -260,8 +255,7 @@ async def post_start_basic( :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/start_basic" __query: t.Dict[str, t.Any] = {} if acknowledge is not None: @@ -304,8 +298,7 @@ async def post_start_trial( false) :param type_query_string: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/start_trial" __query: t.Dict[str, t.Any] = {} if acknowledge is not None: diff --git a/elasticsearch/_async/client/logstash.py b/elasticsearch/_async/client/logstash.py index 575b81e86..63a9c37b2 100644 --- a/elasticsearch/_async/client/logstash.py +++ b/elasticsearch/_async/client/logstash.py @@ -44,8 +44,7 @@ async def delete_pipeline( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_logstash/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -139,8 +138,7 @@ async def put_pipeline( ) elif pipeline is not None and body is not None: raise ValueError("Cannot set both 'pipeline' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_logstash/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/migration.py b/elasticsearch/_async/client/migration.py index 3b38fb3ac..cbfc2c7d2 100644 --- a/elasticsearch/_async/client/migration.py +++ b/elasticsearch/_async/client/migration.py @@ -85,8 +85,7 @@ async def get_feature_upgrade_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -121,8 +120,7 @@ async def post_feature_upgrade( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 63ed20e2e..d277c78d0 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -44,8 +44,7 @@ async def clear_trained_model_deployment_cache( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = ( f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/cache/_clear' ) @@ -102,8 +101,7 @@ async def close_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_close' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -156,8 +154,7 @@ async def delete_calendar( """ if calendar_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'calendar_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -202,8 +199,7 @@ async def delete_calendar_event( raise ValueError("Empty value passed for parameter 'calendar_id'") if event_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'event_id'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "calendar_id": _quote(calendar_id), "event_id": _quote(event_id), } @@ -251,8 +247,10 @@ async def delete_calendar_job( raise ValueError("Empty value passed for parameter 'calendar_id'") if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id), "job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = { + "calendar_id": _quote(calendar_id), + "job_id": _quote(job_id), + } __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/jobs/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -297,8 +295,7 @@ async def delete_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -348,8 +345,7 @@ async def delete_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -455,8 +451,7 @@ async def delete_filter( """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'filter_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"filter_id": _quote(filter_id)} + __path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)} __path = f'/_ml/filters/{__path_parts["filter_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -573,8 +568,7 @@ async def delete_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} if delete_user_annotations is not None: @@ -624,8 +618,10 @@ async def delete_model_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -669,8 +665,7 @@ async def delete_trained_model( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -716,8 +711,7 @@ async def delete_trained_model_alias( raise ValueError("Empty value passed for parameter 'model_id'") if model_alias in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_alias'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "model_id": _quote(model_id), "model_alias": _quote(model_alias), } @@ -780,8 +774,7 @@ async def estimate_model_memory( from the request if no detectors have a `by_field_name`, `over_field_name` or `partition_field_name`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/anomaly_detectors/_estimate_model_memory" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -840,8 +833,7 @@ async def evaluate_data_frame( raise ValueError("Empty value passed for parameter 'evaluation'") if index is None and body is None: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/data_frame/_evaluate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1015,8 +1007,7 @@ async def flush_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_flush' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1084,8 +1075,7 @@ async def forecast( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_forecast' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1266,8 +1256,7 @@ async def get_calendar_events( """ if calendar_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'calendar_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events' __query: t.Dict[str, t.Any] = {} if end is not None: @@ -1812,8 +1801,7 @@ async def get_influencers( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/influencers' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2068,8 +2056,10 @@ async def get_model_snapshot_upgrade_stats( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_upgrade/_stats' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -2238,8 +2228,7 @@ async def get_overall_buckets( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = ( f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/overall_buckets' ) @@ -2333,8 +2322,7 @@ async def get_records( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/records' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2565,8 +2553,7 @@ async def infer_trained_model( raise ValueError("Empty value passed for parameter 'model_id'") if docs is None and body is None: raise ValueError("Empty value passed for parameter 'docs'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/_infer' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2610,8 +2597,7 @@ async def info( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/info" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2656,8 +2642,7 @@ async def open_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_open' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2715,8 +2700,7 @@ async def post_calendar_events( raise ValueError("Empty value passed for parameter 'calendar_id'") if events is None and body is None: raise ValueError("Empty value passed for parameter 'events'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2777,8 +2761,7 @@ async def post_data( ) elif data is not None and body is not None: raise ValueError("Cannot set both 'data' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_data' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2971,8 +2954,7 @@ async def put_calendar( """ if calendar_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'calendar_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3028,8 +3010,10 @@ async def put_calendar_job( raise ValueError("Empty value passed for parameter 'calendar_id'") if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id), "job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = { + "calendar_id": _quote(calendar_id), + "job_id": _quote(job_id), + } __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/jobs/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -3153,8 +3137,7 @@ async def put_data_frame_analytics( raise ValueError("Empty value passed for parameter 'dest'") if source is None and body is None: raise ValueError("Empty value passed for parameter 'source'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3330,8 +3313,7 @@ async def put_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3420,8 +3402,7 @@ async def put_filter( """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'filter_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"filter_id": _quote(filter_id)} + __path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)} __path = f'/_ml/filters/{__path_parts["filter_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3579,8 +3560,7 @@ async def put_job( raise ValueError("Empty value passed for parameter 'analysis_config'") if data_description is None and body is None: raise ValueError("Empty value passed for parameter 'data_description'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3710,8 +3690,7 @@ async def put_trained_model( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3785,8 +3764,7 @@ async def put_trained_model_alias( raise ValueError("Empty value passed for parameter 'model_id'") if model_alias in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_alias'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "model_id": _quote(model_id), "model_alias": _quote(model_alias), } @@ -3857,8 +3835,10 @@ async def put_trained_model_definition_part( ) if total_parts is None and body is None: raise ValueError("Empty value passed for parameter 'total_parts'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id), "part": _quote(part)} + __path_parts: t.Dict[str, str] = { + "model_id": _quote(model_id), + "part": _quote(part), + } __path = f'/_ml/trained_models/{__path_parts["model_id"]}/definition/{__path_parts["part"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3918,8 +3898,7 @@ async def put_trained_model_vocabulary( raise ValueError("Empty value passed for parameter 'model_id'") if vocabulary is None and body is None: raise ValueError("Empty value passed for parameter 'vocabulary'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/vocabulary' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3975,8 +3954,7 @@ async def reset_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_reset' __query: t.Dict[str, t.Any] = {} if delete_user_annotations is not None: @@ -4032,8 +4010,10 @@ async def revert_model_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_revert' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4085,8 +4065,7 @@ async def set_upgrade_mode( starting. :param timeout: The time to wait for the request to be completed. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/set_upgrade_mode" __query: t.Dict[str, t.Any] = {} if enabled is not None: @@ -4135,8 +4114,7 @@ async def start_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_start' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -4190,8 +4168,7 @@ async def start_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_start' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4278,8 +4255,7 @@ async def start_trained_model_deployment( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_start' __query: t.Dict[str, t.Any] = {} if cache_size is not None: @@ -4351,8 +4327,7 @@ async def stop_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_stop' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -4411,8 +4386,7 @@ async def stop_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_stop' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4476,8 +4450,7 @@ async def stop_trained_model_deployment( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_stop' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -4547,8 +4520,7 @@ async def update_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4720,8 +4692,7 @@ async def update_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4809,8 +4780,7 @@ async def update_filter( """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'filter_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"filter_id": _quote(filter_id)} + __path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)} __path = f'/_ml/filters/{__path_parts["filter_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4944,8 +4914,7 @@ async def update_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5033,8 +5002,10 @@ async def update_model_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5092,8 +5063,10 @@ async def upgrade_job_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_upgrade' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -5164,8 +5137,7 @@ async def validate( :param model_snapshot_retention_days: :param results_index_name: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/anomaly_detectors/_validate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5233,8 +5205,7 @@ async def validate_detector( ) elif detector is not None and body is not None: raise ValueError("Cannot set both 'detector' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/anomaly_detectors/_validate/detector" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/monitoring.py b/elasticsearch/_async/client/monitoring.py index 5a675449e..f9df4013a 100644 --- a/elasticsearch/_async/client/monitoring.py +++ b/elasticsearch/_async/client/monitoring.py @@ -63,8 +63,7 @@ async def bulk( raise ValueError("Empty value passed for parameter 'system_api_version'") if system_id is None: raise ValueError("Empty value passed for parameter 'system_id'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_monitoring/bulk" __query: t.Dict[str, t.Any] = {} if interval is not None: diff --git a/elasticsearch/_async/client/nodes.py b/elasticsearch/_async/client/nodes.py index d6e4be42f..3ec6ebd32 100644 --- a/elasticsearch/_async/client/nodes.py +++ b/elasticsearch/_async/client/nodes.py @@ -50,8 +50,7 @@ async def clear_repositories_metering_archive( raise ValueError("Empty value passed for parameter 'node_id'") if max_archive_version in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'max_archive_version'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "node_id": _quote(node_id), "max_archive_version": _quote(max_archive_version), } @@ -95,8 +94,7 @@ async def get_repositories_metering_info( """ if node_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'node_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"node_id": _quote(node_id)} + __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)} __path = f'/_nodes/{__path_parts["node_id"]}/_repositories_metering' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/query_ruleset.py b/elasticsearch/_async/client/query_ruleset.py index 1951d7f54..497f1bcbf 100644 --- a/elasticsearch/_async/client/query_ruleset.py +++ b/elasticsearch/_async/client/query_ruleset.py @@ -44,8 +44,7 @@ async def delete( """ if ruleset_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ruleset_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"ruleset_id": _quote(ruleset_id)} + __path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)} __path = f'/_query_rules/{__path_parts["ruleset_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -85,8 +84,7 @@ async def get( """ if ruleset_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ruleset_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"ruleset_id": _quote(ruleset_id)} + __path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)} __path = f'/_query_rules/{__path_parts["ruleset_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -128,8 +126,7 @@ async def list( :param from_: Starting offset (default: 0) :param size: specifies a max number of results to get """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_query_rules" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -181,8 +178,7 @@ async def put( raise ValueError("Empty value passed for parameter 'ruleset_id'") if rules is None and body is None: raise ValueError("Empty value passed for parameter 'rules'") - __path_parts: t.Dict[str, str] - __path_parts = {"ruleset_id": _quote(ruleset_id)} + __path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)} __path = f'/_query_rules/{__path_parts["ruleset_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/rollup.py b/elasticsearch/_async/client/rollup.py index 527fa732b..6421a083d 100644 --- a/elasticsearch/_async/client/rollup.py +++ b/elasticsearch/_async/client/rollup.py @@ -44,8 +44,7 @@ async def delete_job( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -176,8 +175,7 @@ async def get_rollup_index_caps( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_rollup/data' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -286,8 +284,7 @@ async def put_job( raise ValueError("Empty value passed for parameter 'page_size'") if rollup_index is None and body is None: raise ValueError("Empty value passed for parameter 'rollup_index'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -363,8 +360,7 @@ async def rollup_search( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_rollup_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -419,8 +415,7 @@ async def start_job( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}/_start' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -468,8 +463,7 @@ async def stop_job( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}/_stop' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/search_application.py b/elasticsearch/_async/client/search_application.py index 182b4e9cb..d596e8feb 100644 --- a/elasticsearch/_async/client/search_application.py +++ b/elasticsearch/_async/client/search_application.py @@ -44,8 +44,7 @@ async def delete( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -85,8 +84,7 @@ async def delete_behavioral_analytics( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/analytics/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -126,8 +124,7 @@ async def get( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -214,8 +211,7 @@ async def list( :param q: Query in the Lucene query string syntax. :param size: Specifies a max number of results to get. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_application/search_application" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -275,8 +271,7 @@ async def put( ) elif search_application is not None and body is not None: raise ValueError("Cannot set both 'search_application' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if create is not None: @@ -320,8 +315,7 @@ async def put_behavioral_analytics( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/analytics/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -368,8 +362,7 @@ async def search( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}/_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/searchable_snapshots.py b/elasticsearch/_async/client/searchable_snapshots.py index 3d6deec9e..5aac3e3a0 100644 --- a/elasticsearch/_async/client/searchable_snapshots.py +++ b/elasticsearch/_async/client/searchable_snapshots.py @@ -194,8 +194,10 @@ async def mount( raise ValueError("Empty value passed for parameter 'snapshot'") if index is None and body is None: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = ( f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_mount' ) diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index 4afa4911e..523ed0d89 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -55,8 +55,7 @@ async def activate_user_profile( """ if grant_type is None and body is None: raise ValueError("Empty value passed for parameter 'grant_type'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/profile/_activate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -103,8 +102,7 @@ async def authenticate( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/_authenticate" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -215,8 +213,7 @@ async def clear_api_key_cache( """ if ids in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ids'") - __path_parts: t.Dict[str, str] - __path_parts = {"ids": _quote(ids)} + __path_parts: t.Dict[str, str] = {"ids": _quote(ids)} __path = f'/_security/api_key/{__path_parts["ids"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -256,8 +253,7 @@ async def clear_cached_privileges( """ if application in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'application'") - __path_parts: t.Dict[str, str] - __path_parts = {"application": _quote(application)} + __path_parts: t.Dict[str, str] = {"application": _quote(application)} __path = f'/_security/privilege/{__path_parts["application"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -300,8 +296,7 @@ async def clear_cached_realms( """ if realms in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'realms'") - __path_parts: t.Dict[str, str] - __path_parts = {"realms": _quote(realms)} + __path_parts: t.Dict[str, str] = {"realms": _quote(realms)} __path = f'/_security/realm/{__path_parts["realms"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -343,8 +338,7 @@ async def clear_cached_roles( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role/{__path_parts["name"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -392,8 +386,7 @@ async def clear_cached_service_tokens( raise ValueError("Empty value passed for parameter 'service'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "namespace": _quote(namespace), "service": _quote(service), "name": _quote(name), @@ -460,8 +453,7 @@ async def create_api_key( is the same as the request for create role API. For more details, see create or update roles API. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -595,8 +587,10 @@ async def delete_privileges( raise ValueError("Empty value passed for parameter 'application'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"application": _quote(application), "name": _quote(name)} + __path_parts: t.Dict[str, str] = { + "application": _quote(application), + "name": _quote(name), + } __path = ( f'/_security/privilege/{__path_parts["application"]}/{__path_parts["name"]}' ) @@ -646,8 +640,7 @@ async def delete_role( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -695,8 +688,7 @@ async def delete_role_mapping( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role_mapping/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -752,8 +744,7 @@ async def delete_service_token( raise ValueError("Empty value passed for parameter 'service'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "namespace": _quote(namespace), "service": _quote(service), "name": _quote(name), @@ -805,8 +796,7 @@ async def delete_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -854,8 +844,7 @@ async def disable_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}/_disable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -903,8 +892,7 @@ async def disable_user_profile( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}/_disable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -952,8 +940,7 @@ async def enable_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}/_enable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1001,8 +988,7 @@ async def enable_user_profile( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}/_enable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1040,8 +1026,7 @@ async def enroll_kibana( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/enroll/kibana" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1076,8 +1061,7 @@ async def enroll_node( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/enroll/node" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1140,8 +1124,7 @@ async def get_api_key( associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} if active_only is not None: @@ -1191,8 +1174,7 @@ async def get_builtin_privileges( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/privilege/_builtin" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1427,8 +1409,10 @@ async def get_service_credentials( raise ValueError("Empty value passed for parameter 'namespace'") if service in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'service'") - __path_parts: t.Dict[str, str] - __path_parts = {"namespace": _quote(namespace), "service": _quote(service)} + __path_parts: t.Dict[str, str] = { + "namespace": _quote(namespace), + "service": _quote(service), + } __path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1491,8 +1475,7 @@ async def get_token( :param scope: :param username: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/oauth2/token" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1602,8 +1585,7 @@ async def get_user_privileges( the API returns information about all privileges for the requested application. :param username: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/user/_privileges" __query: t.Dict[str, t.Any] = {} if application is not None: @@ -1654,8 +1636,7 @@ async def get_user_profile( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}' __query: t.Dict[str, t.Any] = {} if data is not None: @@ -1728,8 +1709,7 @@ async def grant_api_key( raise ValueError("Empty value passed for parameter 'api_key'") if grant_type is None and body is None: raise ValueError("Empty value passed for parameter 'grant_type'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key/grant" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1861,8 +1841,7 @@ async def has_privileges_user_profile( raise ValueError("Empty value passed for parameter 'privileges'") if uids is None and body is None: raise ValueError("Empty value passed for parameter 'uids'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/profile/_has_privileges" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1927,8 +1906,7 @@ async def invalidate_api_key( :param username: The username of a user. This parameter cannot be used with either `ids` or `name`, or when `owner` flag is set to `true`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1990,8 +1968,7 @@ async def invalidate_token( :param token: :param username: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/oauth2/token" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2057,8 +2034,7 @@ async def put_privileges( ) elif privileges is not None and body is not None: raise ValueError("Cannot set both 'privileges' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/privilege" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2150,8 +2126,7 @@ async def put_role( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2238,8 +2213,7 @@ async def put_role_mapping( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role_mapping/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2328,8 +2302,7 @@ async def put_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2418,8 +2391,7 @@ async def query_api_keys( associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/_query/api_key" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2502,8 +2474,7 @@ async def saml_authenticate( raise ValueError("Empty value passed for parameter 'content'") if ids is None and body is None: raise ValueError("Empty value passed for parameter 'ids'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/authenticate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2568,8 +2539,7 @@ async def saml_complete_logout( raise ValueError("Empty value passed for parameter 'ids'") if realm is None and body is None: raise ValueError("Empty value passed for parameter 'realm'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/complete_logout" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2639,8 +2609,7 @@ async def saml_invalidate( """ if query_string is None and body is None: raise ValueError("Empty value passed for parameter 'query_string'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/invalidate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2699,8 +2668,7 @@ async def saml_logout( """ if token is None and body is None: raise ValueError("Empty value passed for parameter 'token'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/logout" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2758,8 +2726,7 @@ async def saml_prepare_authentication( API returns as the RelayState query parameter. If the Authentication Request is signed, this value is used as part of the signature computation. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/prepare" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2808,8 +2775,7 @@ async def saml_service_provider_metadata( """ if realm_name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'realm_name'") - __path_parts: t.Dict[str, str] - __path_parts = {"realm_name": _quote(realm_name)} + __path_parts: t.Dict[str, str] = {"realm_name": _quote(realm_name)} __path = f'/_security/saml/metadata/{__path_parts["realm_name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2863,8 +2829,7 @@ async def suggest_user_profiles( Name-related fields are the user's `username`, `full_name`, and `email`. :param size: Number of profiles to return. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/profile/_suggest" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2937,8 +2902,7 @@ async def update_api_key( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_security/api_key/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3012,8 +2976,7 @@ async def update_user_profile_data( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}/_data' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/shutdown.py b/elasticsearch/_async/client/shutdown.py index b1d6e9605..0b0c46391 100644 --- a/elasticsearch/_async/client/shutdown.py +++ b/elasticsearch/_async/client/shutdown.py @@ -56,8 +56,7 @@ async def delete_node( """ if node_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'node_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"node_id": _quote(node_id)} + __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)} __path = f'/_nodes/{__path_parts["node_id"]}/shutdown' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -211,8 +210,7 @@ async def put_node( raise ValueError("Empty value passed for parameter 'reason'") if type is None and body is None: raise ValueError("Empty value passed for parameter 'type'") - __path_parts: t.Dict[str, str] - __path_parts = {"node_id": _quote(node_id)} + __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)} __path = f'/_nodes/{__path_parts["node_id"]}/shutdown' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/slm.py b/elasticsearch/_async/client/slm.py index 50059b7d6..de8db0291 100644 --- a/elasticsearch/_async/client/slm.py +++ b/elasticsearch/_async/client/slm.py @@ -44,8 +44,7 @@ async def delete_lifecycle( """ if policy_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'policy_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy_id": _quote(policy_id)} + __path_parts: t.Dict[str, str] = {"policy_id": _quote(policy_id)} __path = f'/_slm/policy/{__path_parts["policy_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -86,8 +85,7 @@ async def execute_lifecycle( """ if policy_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'policy_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy_id": _quote(policy_id)} + __path_parts: t.Dict[str, str] = {"policy_id": _quote(policy_id)} __path = f'/_slm/policy/{__path_parts["policy_id"]}/_execute' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -122,8 +120,7 @@ async def execute_retention( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/_execute_retention" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -203,8 +200,7 @@ async def get_stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -239,8 +235,7 @@ async def get_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -309,8 +304,7 @@ async def put_lifecycle( """ if policy_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'policy_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy_id": _quote(policy_id)} + __path_parts: t.Dict[str, str] = {"policy_id": _quote(policy_id)} __path = f'/_slm/policy/{__path_parts["policy_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -366,8 +360,7 @@ async def start( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/start" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -402,8 +395,7 @@ async def stop( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/stop" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 8e1996fcd..b0d2f9374 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -50,8 +50,7 @@ async def cleanup_repository( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}/_cleanup' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -116,8 +115,7 @@ async def clone( raise ValueError("Empty value passed for parameter 'target_snapshot'") if indices is None and body is None: raise ValueError("Empty value passed for parameter 'indices'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "repository": _quote(repository), "snapshot": _quote(snapshot), "target_snapshot": _quote(target_snapshot), @@ -222,8 +220,10 @@ async def create( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -268,14 +268,14 @@ async def create( ) @_rewrite_parameters( - body_fields=("settings", "type", "repository"), + body_name="repository", ) async def create_repository( self, *, name: str, - settings: t.Optional[t.Mapping[str, t.Any]] = None, - type: t.Optional[str] = None, + repository: t.Optional[t.Mapping[str, t.Any]] = None, + body: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -283,10 +283,8 @@ async def create_repository( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - repository: t.Optional[t.Mapping[str, t.Any]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, verify: t.Optional[bool] = None, - body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a repository. @@ -294,24 +292,22 @@ async def create_repository( ``_ :param name: A repository name - :param settings: - :param type: - :param master_timeout: Explicit operation timeout for connection to master node :param repository: + :param master_timeout: Explicit operation timeout for connection to master node :param timeout: Explicit operation timeout :param verify: Whether to verify the repository after creation """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - if settings is None and body is None: - raise ValueError("Empty value passed for parameter 'settings'") - if type is None and body is None: - raise ValueError("Empty value passed for parameter 'type'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + if repository is None and body is None: + raise ValueError( + "Empty value passed for parameters 'repository' and 'body', one of them should be set." + ) + elif repository is not None and body is not None: + raise ValueError("Cannot set both 'repository' and 'body'") + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}' __query: t.Dict[str, t.Any] = {} - __body: t.Dict[str, t.Any] = body if body is not None else {} if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -326,13 +322,7 @@ async def create_repository( __query["timeout"] = timeout if verify is not None: __query["verify"] = verify - if not __body: - if settings is not None: - __body["settings"] = settings - if type is not None: - __body["type"] = type - if repository is not None: - __body["repository"] = repository + __body = repository if repository is not None else body __headers = {"accept": "application/json", "content-type": "application/json"} return await self.perform_request( # type: ignore[return-value] "PUT", @@ -371,8 +361,10 @@ async def delete( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -421,8 +413,7 @@ async def delete_repository( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -528,8 +519,10 @@ async def get( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}' __query: t.Dict[str, t.Any] = {} if after is not None: @@ -694,8 +687,10 @@ async def restore( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_restore' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -834,8 +829,7 @@ async def verify_repository( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}/_verify' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/sql.py b/elasticsearch/_async/client/sql.py index 48d4ac641..9dc219c4c 100644 --- a/elasticsearch/_async/client/sql.py +++ b/elasticsearch/_async/client/sql.py @@ -47,8 +47,7 @@ async def clear_cursor( """ if cursor is None and body is None: raise ValueError("Empty value passed for parameter 'cursor'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_sql/close" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -94,8 +93,7 @@ async def delete_async( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_sql/async/delete/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -151,8 +149,7 @@ async def get_async( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_sql/async/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if delimiter is not None: @@ -201,8 +198,7 @@ async def get_async_status( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_sql/async/status/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -310,8 +306,7 @@ async def query( to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_sql" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -397,8 +392,7 @@ async def translate( """ if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_sql/translate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/ssl.py b/elasticsearch/_async/client/ssl.py index 814854ae4..5b9397893 100644 --- a/elasticsearch/_async/client/ssl.py +++ b/elasticsearch/_async/client/ssl.py @@ -40,8 +40,7 @@ async def certificates( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ssl/certificates" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/synonyms.py b/elasticsearch/_async/client/synonyms.py index f9e88b95f..84b0baa3e 100644 --- a/elasticsearch/_async/client/synonyms.py +++ b/elasticsearch/_async/client/synonyms.py @@ -44,8 +44,7 @@ async def delete_synonym( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_synonyms/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -89,8 +88,10 @@ async def delete_synonym_rule( raise ValueError("Empty value passed for parameter 'set_id'") if rule_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'rule_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"set_id": _quote(set_id), "rule_id": _quote(rule_id)} + __path_parts: t.Dict[str, str] = { + "set_id": _quote(set_id), + "rule_id": _quote(rule_id), + } __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -136,8 +137,7 @@ async def get_synonym( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_synonyms/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -185,8 +185,10 @@ async def get_synonym_rule( raise ValueError("Empty value passed for parameter 'set_id'") if rule_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'rule_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"set_id": _quote(set_id), "rule_id": _quote(rule_id)} + __path_parts: t.Dict[str, str] = { + "set_id": _quote(set_id), + "rule_id": _quote(rule_id), + } __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -228,8 +230,7 @@ async def get_synonyms_sets( :param from_: Starting offset :param size: specifies a max number of results to get """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_synonyms" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -280,8 +281,7 @@ async def put_synonym( raise ValueError("Empty value passed for parameter 'id'") if synonyms_set is None and body is None: raise ValueError("Empty value passed for parameter 'synonyms_set'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_synonyms/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -337,8 +337,10 @@ async def put_synonym_rule( raise ValueError("Empty value passed for parameter 'rule_id'") if synonyms is None and body is None: raise ValueError("Empty value passed for parameter 'synonyms'") - __path_parts: t.Dict[str, str] - __path_parts = {"set_id": _quote(set_id), "rule_id": _quote(rule_id)} + __path_parts: t.Dict[str, str] = { + "set_id": _quote(set_id), + "rule_id": _quote(rule_id), + } __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/tasks.py b/elasticsearch/_async/client/tasks.py index aaf3d9b16..9744a8e32 100644 --- a/elasticsearch/_async/client/tasks.py +++ b/elasticsearch/_async/client/tasks.py @@ -111,8 +111,7 @@ async def get( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_tasks/{__path_parts["task_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -180,8 +179,7 @@ async def list( :param wait_for_completion: If `true`, the request blocks until the operation is complete. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_tasks" __query: t.Dict[str, t.Any] = {} if actions is not None: diff --git a/elasticsearch/_async/client/text_structure.py b/elasticsearch/_async/client/text_structure.py index 14e1eb170..fdb018247 100644 --- a/elasticsearch/_async/client/text_structure.py +++ b/elasticsearch/_async/client/text_structure.py @@ -127,8 +127,7 @@ async def find_structure( ) elif text_files is not None and body is not None: raise ValueError("Cannot set both 'text_files' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_text_structure/find_structure" __query: t.Dict[str, t.Any] = {} if charset is not None: @@ -205,8 +204,7 @@ async def test_grok_pattern( raise ValueError("Empty value passed for parameter 'grok_pattern'") if text is None and body is None: raise ValueError("Empty value passed for parameter 'text'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_text_structure/test_grok_pattern" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_async/client/transform.py b/elasticsearch/_async/client/transform.py index e374f072c..5966c14ac 100644 --- a/elasticsearch/_async/client/transform.py +++ b/elasticsearch/_async/client/transform.py @@ -55,8 +55,7 @@ async def delete_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}' __query: t.Dict[str, t.Any] = {} if delete_dest_index is not None: @@ -187,8 +186,7 @@ async def get_transform_stats( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_stats' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -408,8 +406,7 @@ async def put_transform( raise ValueError("Empty value passed for parameter 'dest'") if source is None and body is None: raise ValueError("Empty value passed for parameter 'source'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -482,8 +479,7 @@ async def reset_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_reset' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -527,8 +523,7 @@ async def schedule_now_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_schedule_now' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -579,8 +574,7 @@ async def start_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_start' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -649,8 +643,7 @@ async def stop_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_stop' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -740,8 +733,7 @@ async def update_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -805,8 +797,7 @@ async def upgrade_transforms( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_transform/_upgrade" __query: t.Dict[str, t.Any] = {} if dry_run is not None: diff --git a/elasticsearch/_async/client/watcher.py b/elasticsearch/_async/client/watcher.py index a44856643..40fdc4e76 100644 --- a/elasticsearch/_async/client/watcher.py +++ b/elasticsearch/_async/client/watcher.py @@ -96,8 +96,7 @@ async def activate_watch( """ if watch_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'watch_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"watch_id": _quote(watch_id)} + __path_parts: t.Dict[str, str] = {"watch_id": _quote(watch_id)} __path = f'/_watcher/watch/{__path_parts["watch_id"]}/_activate' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -137,8 +136,7 @@ async def deactivate_watch( """ if watch_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'watch_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"watch_id": _quote(watch_id)} + __path_parts: t.Dict[str, str] = {"watch_id": _quote(watch_id)} __path = f'/_watcher/watch/{__path_parts["watch_id"]}/_deactivate' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -178,8 +176,7 @@ async def delete_watch( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_watcher/watch/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -329,8 +326,7 @@ async def get_watch( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_watcher/watch/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -405,8 +401,7 @@ async def put_watch( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_watcher/watch/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -493,8 +488,7 @@ async def query_watches( :param size: The number of hits to return. Needs to be non-negative. :param sort: Optional sort definition. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_watcher/_query/watches" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -557,8 +551,7 @@ async def start( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_watcher/_start" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -654,8 +647,7 @@ async def stop( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_watcher/_stop" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_async/client/xpack.py b/elasticsearch/_async/client/xpack.py index d69f6a1a9..4db677e0b 100644 --- a/elasticsearch/_async/client/xpack.py +++ b/elasticsearch/_async/client/xpack.py @@ -49,8 +49,7 @@ async def info( :param categories: A comma-separated list of the information categories to include in the response. For example, `build,license,features`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_xpack" __query: t.Dict[str, t.Any] = {} if accept_enterprise is not None: @@ -96,8 +95,7 @@ async def usage( no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_xpack/usage" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/__init__.py b/elasticsearch/_sync/client/__init__.py index 44f45c4d1..d0b710367 100644 --- a/elasticsearch/_sync/client/__init__.py +++ b/elasticsearch/_sync/client/__init__.py @@ -741,8 +741,7 @@ def clear_scroll( :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_search/scroll" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -794,8 +793,7 @@ def close_point_in_time( """ if id is None and body is None: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_pit" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1036,8 +1034,7 @@ def create( ) elif document is not None and body is not None: raise ValueError("Cannot set both 'document' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_create/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1128,8 +1125,7 @@ def delete( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1294,8 +1290,7 @@ def delete_by_query( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_delete_by_query' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1414,8 +1409,7 @@ def delete_by_query_rethrottle( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1466,8 +1460,7 @@ def delete_script( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_scripts/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1553,8 +1546,7 @@ def exists( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1652,8 +1644,7 @@ def exists_source( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1759,8 +1750,7 @@ def explain( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_explain/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1990,8 +1980,7 @@ def get( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_doc/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2055,8 +2044,7 @@ def get_script( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_scripts/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2093,8 +2081,7 @@ def get_script_context( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_script_context" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2129,8 +2116,7 @@ def get_script_languages( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_script_language" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2209,8 +2195,7 @@ def get_source( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_source/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2453,8 +2438,7 @@ def info( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2535,8 +2519,7 @@ def knn_search( raise ValueError("Empty value passed for parameter 'index'") if knn is None and body is None: raise ValueError("Empty value passed for parameter 'knn'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_knn_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3067,8 +3050,7 @@ def open_point_in_time( raise ValueError("Empty value passed for parameter 'index'") if keep_alive is None: raise ValueError("Empty value passed for parameter 'keep_alive'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_pit' __query: t.Dict[str, t.Any] = {} if keep_alive is not None: @@ -3333,8 +3315,7 @@ def reindex( raise ValueError("Empty value passed for parameter 'dest'") if source is None and body is None: raise ValueError("Empty value passed for parameter 'source'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_reindex" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3408,8 +3389,7 @@ def reindex_rethrottle( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -3526,8 +3506,7 @@ def scripts_painless_execute( :param context_setup: Additional parameters for the `context`. :param script: The Painless script to execute. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_scripts/painless/_execute" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3589,8 +3568,7 @@ def scroll( """ if scroll_id is None and body is None: raise ValueError("Empty value passed for parameter 'scroll_id'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_search/scroll" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4232,8 +4210,7 @@ def search_mvt( raise ValueError("Empty value passed for parameter 'x'") if y in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'y'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "index": _quote(index), "field": _quote(field), "zoom": _quote(zoom), @@ -4591,8 +4568,7 @@ def terms_enum( raise ValueError("Empty value passed for parameter 'index'") if field is None and body is None: raise ValueError("Empty value passed for parameter 'field'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_terms_enum' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4852,8 +4828,7 @@ def update( raise ValueError("Empty value passed for parameter 'index'") if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "id": _quote(id)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "id": _quote(id)} __path = f'/{__path_parts["index"]}/_update/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5052,8 +5027,7 @@ def update_by_query( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_update_by_query' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5180,8 +5154,7 @@ def update_by_query_rethrottle( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/async_search.py b/elasticsearch/_sync/client/async_search.py index 2b57ea5b3..542d3dff2 100644 --- a/elasticsearch/_sync/client/async_search.py +++ b/elasticsearch/_sync/client/async_search.py @@ -45,8 +45,7 @@ def delete( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_async_search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -106,8 +105,7 @@ def get( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_async_search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -154,8 +152,7 @@ def status( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_async_search/status/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/autoscaling.py b/elasticsearch/_sync/client/autoscaling.py index f5c0d04f4..2b2a23fc2 100644 --- a/elasticsearch/_sync/client/autoscaling.py +++ b/elasticsearch/_sync/client/autoscaling.py @@ -45,8 +45,7 @@ def delete_autoscaling_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_autoscaling/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -82,8 +81,7 @@ def get_autoscaling_capacity( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_autoscaling/capacity" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -124,8 +122,7 @@ def get_autoscaling_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_autoscaling/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -177,8 +174,7 @@ def put_autoscaling_policy( ) elif policy is not None and body is not None: raise ValueError("Cannot set both 'policy' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_autoscaling/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/cat.py b/elasticsearch/_sync/client/cat.py index e177aa5bf..5165d8b53 100644 --- a/elasticsearch/_sync/client/cat.py +++ b/elasticsearch/_sync/client/cat.py @@ -503,8 +503,7 @@ def health( :param ts: If true, returns `HH:MM:SS` and Unix epoch timestamps. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/health" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -581,8 +580,7 @@ def help( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -775,8 +773,7 @@ def master( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/master" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1349,8 +1346,7 @@ def nodeattrs( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/nodeattrs" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1433,8 +1429,7 @@ def nodes( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/nodes" __query: t.Dict[str, t.Any] = {} if bytes is not None: @@ -1513,8 +1508,7 @@ def pending_tasks( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/pending_tasks" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1587,8 +1581,7 @@ def plugins( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/plugins" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1758,8 +1751,7 @@ def repositories( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/repositories" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2106,8 +2098,7 @@ def tasks( a suffix to the column name. :param v: When set to `true` will enable verbose output. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cat/tasks" __query: t.Dict[str, t.Any] = {} if actions is not None: diff --git a/elasticsearch/_sync/client/ccr.py b/elasticsearch/_sync/client/ccr.py index 4c2e25489..69d74827c 100644 --- a/elasticsearch/_sync/client/ccr.py +++ b/elasticsearch/_sync/client/ccr.py @@ -44,8 +44,7 @@ def delete_auto_follow_pattern( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -136,8 +135,7 @@ def follow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/follow' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -214,8 +212,7 @@ def follow_info( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/info' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -257,8 +254,7 @@ def follow_stats( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/stats' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -315,8 +311,7 @@ def forget_follower( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/forget_follower' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -413,8 +408,7 @@ def pause_auto_follow_pattern( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}/pause' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -456,8 +450,7 @@ def pause_follow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/pause_follow' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -580,8 +573,7 @@ def put_auto_follow_pattern( raise ValueError("Empty value passed for parameter 'name'") if remote_cluster is None and body is None: raise ValueError("Empty value passed for parameter 'remote_cluster'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -663,8 +655,7 @@ def resume_auto_follow_pattern( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_ccr/auto_follow/{__path_parts["name"]}/resume' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -742,8 +733,7 @@ def resume_follow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/resume_follow' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -811,8 +801,7 @@ def stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ccr/stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -854,8 +843,7 @@ def unfollow( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ccr/unfollow' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index 9a51ea441..722e4eac7 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -60,8 +60,7 @@ def allocation_explain( :param shard: Specifies the ID of the shard that you would like an explanation for. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/allocation/explain" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -130,8 +129,7 @@ def delete_component_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -178,8 +176,7 @@ def delete_voting_config_exclusions( configuration exclusions list is cleared even if some excluded nodes are still in the cluster. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/voting_config_exclusions" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -232,8 +229,7 @@ def exists_component_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -353,8 +349,7 @@ def get_settings( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/settings" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -540,8 +535,7 @@ def info( """ if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"target": _quote(target)} + __path_parts: t.Dict[str, str] = {"target": _quote(target)} __path = f'/_info/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -587,8 +581,7 @@ def pending_tasks( no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/pending_tasks" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -640,8 +633,7 @@ def post_voting_config_exclusions( If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/voting_config_exclusions" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -728,8 +720,7 @@ def put_component_template( raise ValueError("Empty value passed for parameter 'name'") if template is None and body is None: raise ValueError("Empty value passed for parameter 'template'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_component_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -795,8 +786,7 @@ def put_settings( :param timeout: Explicit operation timeout :param transient: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/settings" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -844,8 +834,7 @@ def remote_info( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_remote/info" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -906,8 +895,7 @@ def reroute( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_cluster/reroute" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/dangling_indices.py b/elasticsearch/_sync/client/dangling_indices.py index beac1e4b8..b384e48e5 100644 --- a/elasticsearch/_sync/client/dangling_indices.py +++ b/elasticsearch/_sync/client/dangling_indices.py @@ -55,8 +55,7 @@ def delete_dangling_index( raise ValueError("Empty value passed for parameter 'index_uuid'") if accept_data_loss is None: raise ValueError("Empty value passed for parameter 'accept_data_loss'") - __path_parts: t.Dict[str, str] - __path_parts = {"index_uuid": _quote(index_uuid)} + __path_parts: t.Dict[str, str] = {"index_uuid": _quote(index_uuid)} __path = f'/_dangling/{__path_parts["index_uuid"]}' __query: t.Dict[str, t.Any] = {} if accept_data_loss is not None: @@ -113,8 +112,7 @@ def import_dangling_index( raise ValueError("Empty value passed for parameter 'index_uuid'") if accept_data_loss is None: raise ValueError("Empty value passed for parameter 'accept_data_loss'") - __path_parts: t.Dict[str, str] - __path_parts = {"index_uuid": _quote(index_uuid)} + __path_parts: t.Dict[str, str] = {"index_uuid": _quote(index_uuid)} __path = f'/_dangling/{__path_parts["index_uuid"]}' __query: t.Dict[str, t.Any] = {} if accept_data_loss is not None: @@ -155,8 +153,7 @@ def list_dangling_indices( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_dangling" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/enrich.py b/elasticsearch/_sync/client/enrich.py index 74062f2fd..3596cb243 100644 --- a/elasticsearch/_sync/client/enrich.py +++ b/elasticsearch/_sync/client/enrich.py @@ -44,8 +44,7 @@ def delete_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_enrich/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -88,8 +87,7 @@ def execute_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_enrich/policy/{__path_parts["name"]}/_execute' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -186,8 +184,7 @@ def put_policy( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_enrich/policy/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -232,8 +229,7 @@ def stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_enrich/_stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/eql.py b/elasticsearch/_sync/client/eql.py index 85ac23611..713e143f1 100644 --- a/elasticsearch/_sync/client/eql.py +++ b/elasticsearch/_sync/client/eql.py @@ -47,8 +47,7 @@ def delete( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_eql/search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -98,8 +97,7 @@ def get( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_eql/search/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -144,8 +142,7 @@ def get_status( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_eql/search/status/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -259,8 +256,7 @@ def search( raise ValueError("Empty value passed for parameter 'index'") if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_eql/search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/esql.py b/elasticsearch/_sync/client/esql.py index 771a1abec..1dee2e934 100644 --- a/elasticsearch/_sync/client/esql.py +++ b/elasticsearch/_sync/client/esql.py @@ -68,8 +68,7 @@ def query( """ if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_query" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/features.py b/elasticsearch/_sync/client/features.py index 30540d527..5d95b3440 100644 --- a/elasticsearch/_sync/client/features.py +++ b/elasticsearch/_sync/client/features.py @@ -40,8 +40,7 @@ def get_features( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_features" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -76,8 +75,7 @@ def reset_features( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_features/_reset" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/fleet.py b/elasticsearch/_sync/client/fleet.py index b80c6f472..10d3d8166 100644 --- a/elasticsearch/_sync/client/fleet.py +++ b/elasticsearch/_sync/client/fleet.py @@ -59,8 +59,7 @@ def global_checkpoints( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_fleet/global_checkpoints' __query: t.Dict[str, t.Any] = {} if checkpoints is not None: @@ -476,8 +475,7 @@ def search( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_fleet/_fleet_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/graph.py b/elasticsearch/_sync/client/graph.py index c4a368526..aba6718c4 100644 --- a/elasticsearch/_sync/client/graph.py +++ b/elasticsearch/_sync/client/graph.py @@ -65,8 +65,7 @@ def explore( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_graph/explore' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/ilm.py b/elasticsearch/_sync/client/ilm.py index 4dd6ac39e..f3f16aac4 100644 --- a/elasticsearch/_sync/client/ilm.py +++ b/elasticsearch/_sync/client/ilm.py @@ -54,8 +54,7 @@ def delete_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy": _quote(name)} + __path_parts: t.Dict[str, str] = {"policy": _quote(name)} __path = f'/_ilm/policy/{__path_parts["policy"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -118,8 +117,7 @@ def explain_lifecycle( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ilm/explain' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -219,8 +217,7 @@ def get_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -268,8 +265,7 @@ def migrate_to_data_tiers( :param legacy_template_to_delete: :param node_attribute: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/migrate_to_data_tiers" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -329,8 +325,7 @@ def move_to_step( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/_ilm/move/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -395,8 +390,7 @@ def put_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy": _quote(name)} + __path_parts: t.Dict[str, str] = {"policy": _quote(name)} __path = f'/_ilm/policy/{__path_parts["policy"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -449,8 +443,7 @@ def remove_policy( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ilm/remove' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -491,8 +484,7 @@ def retry( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_ilm/retry' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -534,8 +526,7 @@ def start( :param master_timeout: :param timeout: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/start" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -582,8 +573,7 @@ def stop( :param master_timeout: :param timeout: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ilm/stop" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/indices.py b/elasticsearch/_sync/client/indices.py index abf491d92..773e27322 100644 --- a/elasticsearch/_sync/client/indices.py +++ b/elasticsearch/_sync/client/indices.py @@ -71,8 +71,10 @@ def add_block( raise ValueError("Empty value passed for parameter 'index'") if block in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'block'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "block": _quote(block)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "block": _quote(block), + } __path = f'/{__path_parts["index"]}/_block/{__path_parts["block"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -346,8 +348,10 @@ def clone( raise ValueError("Empty value passed for parameter 'index'") if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target": _quote(target)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target": _quote(target), + } __path = f'/{__path_parts["index"]}/_clone/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -439,8 +443,7 @@ def close( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_close' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -517,8 +520,7 @@ def create( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -581,8 +583,7 @@ def create_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -710,8 +711,7 @@ def delete( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -776,8 +776,7 @@ def delete_alias( raise ValueError("Empty value passed for parameter 'index'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "name": _quote(name)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "name": _quote(name)} __path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -838,8 +837,7 @@ def delete_data_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}/_lifecycle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -896,8 +894,7 @@ def delete_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -949,8 +946,7 @@ def delete_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1004,8 +1000,7 @@ def delete_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1079,8 +1074,7 @@ def disk_usage( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_disk_usage' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1145,8 +1139,10 @@ def downsample( ) elif config is not None and body is not None: raise ValueError("Cannot set both 'config' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target_index": _quote(target_index)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target_index": _quote(target_index), + } __path = f'/{__path_parts["index"]}/_downsample/{__path_parts["target_index"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1215,8 +1211,7 @@ def exists( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1356,8 +1351,7 @@ def exists_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1408,8 +1402,7 @@ def exists_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1463,8 +1456,7 @@ def explain_data_lifecycle( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_lifecycle/explain' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1548,8 +1540,7 @@ def field_usage_stats( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_field_usage_stats' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1816,8 +1807,7 @@ def get( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -1972,8 +1962,7 @@ def get_data_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}/_lifecycle' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2478,8 +2467,7 @@ def migrate_to_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/_migrate/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2522,8 +2510,7 @@ def modify_data_stream( """ if actions is None and body is None: raise ValueError("Empty value passed for parameter 'actions'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_data_stream/_modify" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2607,8 +2594,7 @@ def open( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_open' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -2661,8 +2647,7 @@ def promote_data_stream( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/_promote/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2747,8 +2732,7 @@ def put_alias( raise ValueError("Empty value passed for parameter 'index'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "name": _quote(name)} + __path_parts: t.Dict[str, str] = {"index": _quote(index), "name": _quote(name)} __path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2844,8 +2828,7 @@ def put_data_lifecycle( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_data_stream/{__path_parts["name"]}/_lifecycle' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2942,8 +2925,7 @@ def put_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3090,8 +3072,7 @@ def put_mapping( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_mapping' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3314,8 +3295,7 @@ def put_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_template/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3519,8 +3499,7 @@ def reload_search_analyzers( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_reload_search_analyzers' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -3593,8 +3572,7 @@ def resolve_cluster( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_resolve/cluster/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -3656,8 +3634,7 @@ def resolve_index( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_resolve/index/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -3986,8 +3963,10 @@ def shrink( raise ValueError("Empty value passed for parameter 'index'") if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target": _quote(target)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target": _quote(target), + } __path = f'/{__path_parts["index"]}/_shrink/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4104,8 +4083,7 @@ def simulate_index_template( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_index_template/_simulate_index/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4282,8 +4260,10 @@ def split( raise ValueError("Empty value passed for parameter 'index'") if target in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'target'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index), "target": _quote(target)} + __path_parts: t.Dict[str, str] = { + "index": _quote(index), + "target": _quote(target), + } __path = f'/{__path_parts["index"]}/_split/{__path_parts["target"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4482,8 +4462,7 @@ def unfreeze( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_unfreeze' __query: t.Dict[str, t.Any] = {} if allow_no_indices is not None: @@ -4545,8 +4524,7 @@ def update_aliases( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_aliases" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/ingest.py b/elasticsearch/_sync/client/ingest.py index de86630c9..a286a8e1d 100644 --- a/elasticsearch/_sync/client/ingest.py +++ b/elasticsearch/_sync/client/ingest.py @@ -54,8 +54,7 @@ def delete_pipeline( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ingest/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -94,8 +93,7 @@ def geo_ip_stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ingest/geoip/stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -186,8 +184,7 @@ def processor_grok( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ingest/processor/grok" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -262,8 +259,7 @@ def put_pipeline( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ingest/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/license.py b/elasticsearch/_sync/client/license.py index 061287c2f..19885503a 100644 --- a/elasticsearch/_sync/client/license.py +++ b/elasticsearch/_sync/client/license.py @@ -39,8 +39,7 @@ def delete( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -84,8 +83,7 @@ def get( :param local: Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license" __query: t.Dict[str, t.Any] = {} if accept_enterprise is not None: @@ -124,8 +122,7 @@ def get_basic_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/basic_status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -160,8 +157,7 @@ def get_trial_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/trial_status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -207,8 +203,7 @@ def post( :param licenses: A sequence of one or more JSON documents containing the license information. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -260,8 +255,7 @@ def post_start_basic( :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/start_basic" __query: t.Dict[str, t.Any] = {} if acknowledge is not None: @@ -304,8 +298,7 @@ def post_start_trial( false) :param type_query_string: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_license/start_trial" __query: t.Dict[str, t.Any] = {} if acknowledge is not None: diff --git a/elasticsearch/_sync/client/logstash.py b/elasticsearch/_sync/client/logstash.py index 293997393..323a43f35 100644 --- a/elasticsearch/_sync/client/logstash.py +++ b/elasticsearch/_sync/client/logstash.py @@ -44,8 +44,7 @@ def delete_pipeline( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_logstash/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -139,8 +138,7 @@ def put_pipeline( ) elif pipeline is not None and body is not None: raise ValueError("Cannot set both 'pipeline' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_logstash/pipeline/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/migration.py b/elasticsearch/_sync/client/migration.py index 7379e3e81..b0bfb2f01 100644 --- a/elasticsearch/_sync/client/migration.py +++ b/elasticsearch/_sync/client/migration.py @@ -85,8 +85,7 @@ def get_feature_upgrade_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -121,8 +120,7 @@ def post_feature_upgrade( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/ml.py b/elasticsearch/_sync/client/ml.py index ba2fab1dc..b5f611f11 100644 --- a/elasticsearch/_sync/client/ml.py +++ b/elasticsearch/_sync/client/ml.py @@ -44,8 +44,7 @@ def clear_trained_model_deployment_cache( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = ( f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/cache/_clear' ) @@ -102,8 +101,7 @@ def close_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_close' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -156,8 +154,7 @@ def delete_calendar( """ if calendar_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'calendar_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -202,8 +199,7 @@ def delete_calendar_event( raise ValueError("Empty value passed for parameter 'calendar_id'") if event_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'event_id'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "calendar_id": _quote(calendar_id), "event_id": _quote(event_id), } @@ -251,8 +247,10 @@ def delete_calendar_job( raise ValueError("Empty value passed for parameter 'calendar_id'") if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id), "job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = { + "calendar_id": _quote(calendar_id), + "job_id": _quote(job_id), + } __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/jobs/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -297,8 +295,7 @@ def delete_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -348,8 +345,7 @@ def delete_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -455,8 +451,7 @@ def delete_filter( """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'filter_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"filter_id": _quote(filter_id)} + __path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)} __path = f'/_ml/filters/{__path_parts["filter_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -573,8 +568,7 @@ def delete_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} if delete_user_annotations is not None: @@ -624,8 +618,10 @@ def delete_model_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -669,8 +665,7 @@ def delete_trained_model( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -716,8 +711,7 @@ def delete_trained_model_alias( raise ValueError("Empty value passed for parameter 'model_id'") if model_alias in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_alias'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "model_id": _quote(model_id), "model_alias": _quote(model_alias), } @@ -780,8 +774,7 @@ def estimate_model_memory( from the request if no detectors have a `by_field_name`, `over_field_name` or `partition_field_name`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/anomaly_detectors/_estimate_model_memory" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -840,8 +833,7 @@ def evaluate_data_frame( raise ValueError("Empty value passed for parameter 'evaluation'") if index is None and body is None: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/data_frame/_evaluate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1015,8 +1007,7 @@ def flush_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_flush' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1084,8 +1075,7 @@ def forecast( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_forecast' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1266,8 +1256,7 @@ def get_calendar_events( """ if calendar_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'calendar_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events' __query: t.Dict[str, t.Any] = {} if end is not None: @@ -1812,8 +1801,7 @@ def get_influencers( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/influencers' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2068,8 +2056,10 @@ def get_model_snapshot_upgrade_stats( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_upgrade/_stats' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -2238,8 +2228,7 @@ def get_overall_buckets( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = ( f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/overall_buckets' ) @@ -2333,8 +2322,7 @@ def get_records( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/records' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2565,8 +2553,7 @@ def infer_trained_model( raise ValueError("Empty value passed for parameter 'model_id'") if docs is None and body is None: raise ValueError("Empty value passed for parameter 'docs'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/_infer' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2610,8 +2597,7 @@ def info( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/info" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2656,8 +2642,7 @@ def open_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_open' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2715,8 +2700,7 @@ def post_calendar_events( raise ValueError("Empty value passed for parameter 'calendar_id'") if events is None and body is None: raise ValueError("Empty value passed for parameter 'events'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2777,8 +2761,7 @@ def post_data( ) elif data is not None and body is not None: raise ValueError("Cannot set both 'data' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_data' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2971,8 +2954,7 @@ def put_calendar( """ if calendar_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'calendar_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id)} + __path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)} __path = f'/_ml/calendars/{__path_parts["calendar_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3028,8 +3010,10 @@ def put_calendar_job( raise ValueError("Empty value passed for parameter 'calendar_id'") if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"calendar_id": _quote(calendar_id), "job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = { + "calendar_id": _quote(calendar_id), + "job_id": _quote(job_id), + } __path = f'/_ml/calendars/{__path_parts["calendar_id"]}/jobs/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -3153,8 +3137,7 @@ def put_data_frame_analytics( raise ValueError("Empty value passed for parameter 'dest'") if source is None and body is None: raise ValueError("Empty value passed for parameter 'source'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3330,8 +3313,7 @@ def put_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3420,8 +3402,7 @@ def put_filter( """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'filter_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"filter_id": _quote(filter_id)} + __path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)} __path = f'/_ml/filters/{__path_parts["filter_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3579,8 +3560,7 @@ def put_job( raise ValueError("Empty value passed for parameter 'analysis_config'") if data_description is None and body is None: raise ValueError("Empty value passed for parameter 'data_description'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3710,8 +3690,7 @@ def put_trained_model( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3785,8 +3764,7 @@ def put_trained_model_alias( raise ValueError("Empty value passed for parameter 'model_id'") if model_alias in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_alias'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "model_id": _quote(model_id), "model_alias": _quote(model_alias), } @@ -3857,8 +3835,10 @@ def put_trained_model_definition_part( ) if total_parts is None and body is None: raise ValueError("Empty value passed for parameter 'total_parts'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id), "part": _quote(part)} + __path_parts: t.Dict[str, str] = { + "model_id": _quote(model_id), + "part": _quote(part), + } __path = f'/_ml/trained_models/{__path_parts["model_id"]}/definition/{__path_parts["part"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3918,8 +3898,7 @@ def put_trained_model_vocabulary( raise ValueError("Empty value passed for parameter 'model_id'") if vocabulary is None and body is None: raise ValueError("Empty value passed for parameter 'vocabulary'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/vocabulary' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3975,8 +3954,7 @@ def reset_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_reset' __query: t.Dict[str, t.Any] = {} if delete_user_annotations is not None: @@ -4032,8 +4010,10 @@ def revert_model_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_revert' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4085,8 +4065,7 @@ def set_upgrade_mode( starting. :param timeout: The time to wait for the request to be completed. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/set_upgrade_mode" __query: t.Dict[str, t.Any] = {} if enabled is not None: @@ -4135,8 +4114,7 @@ def start_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_start' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -4190,8 +4168,7 @@ def start_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_start' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4278,8 +4255,7 @@ def start_trained_model_deployment( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_start' __query: t.Dict[str, t.Any] = {} if cache_size is not None: @@ -4351,8 +4327,7 @@ def stop_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_stop' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -4411,8 +4386,7 @@ def stop_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_stop' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4476,8 +4450,7 @@ def stop_trained_model_deployment( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"model_id": _quote(model_id)} + __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)} __path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_stop' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -4547,8 +4520,7 @@ def update_data_frame_analytics( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4720,8 +4692,7 @@ def update_datafeed( """ if datafeed_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'datafeed_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"datafeed_id": _quote(datafeed_id)} + __path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)} __path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4809,8 +4780,7 @@ def update_filter( """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'filter_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"filter_id": _quote(filter_id)} + __path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)} __path = f'/_ml/filters/{__path_parts["filter_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -4944,8 +4914,7 @@ def update_job( """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'job_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id)} + __path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)} __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5033,8 +5002,10 @@ def update_model_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5092,8 +5063,10 @@ def upgrade_job_snapshot( raise ValueError("Empty value passed for parameter 'job_id'") if snapshot_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"job_id": _quote(job_id), "snapshot_id": _quote(snapshot_id)} + __path_parts: t.Dict[str, str] = { + "job_id": _quote(job_id), + "snapshot_id": _quote(snapshot_id), + } __path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_upgrade' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -5164,8 +5137,7 @@ def validate( :param model_snapshot_retention_days: :param results_index_name: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/anomaly_detectors/_validate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -5233,8 +5205,7 @@ def validate_detector( ) elif detector is not None and body is not None: raise ValueError("Cannot set both 'detector' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ml/anomaly_detectors/_validate/detector" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/monitoring.py b/elasticsearch/_sync/client/monitoring.py index 6ca90b395..1fb769658 100644 --- a/elasticsearch/_sync/client/monitoring.py +++ b/elasticsearch/_sync/client/monitoring.py @@ -63,8 +63,7 @@ def bulk( raise ValueError("Empty value passed for parameter 'system_api_version'") if system_id is None: raise ValueError("Empty value passed for parameter 'system_id'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_monitoring/bulk" __query: t.Dict[str, t.Any] = {} if interval is not None: diff --git a/elasticsearch/_sync/client/nodes.py b/elasticsearch/_sync/client/nodes.py index a3e745a71..56ae5a34a 100644 --- a/elasticsearch/_sync/client/nodes.py +++ b/elasticsearch/_sync/client/nodes.py @@ -50,8 +50,7 @@ def clear_repositories_metering_archive( raise ValueError("Empty value passed for parameter 'node_id'") if max_archive_version in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'max_archive_version'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "node_id": _quote(node_id), "max_archive_version": _quote(max_archive_version), } @@ -95,8 +94,7 @@ def get_repositories_metering_info( """ if node_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'node_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"node_id": _quote(node_id)} + __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)} __path = f'/_nodes/{__path_parts["node_id"]}/_repositories_metering' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/query_ruleset.py b/elasticsearch/_sync/client/query_ruleset.py index 7c42e0041..d2923992b 100644 --- a/elasticsearch/_sync/client/query_ruleset.py +++ b/elasticsearch/_sync/client/query_ruleset.py @@ -44,8 +44,7 @@ def delete( """ if ruleset_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ruleset_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"ruleset_id": _quote(ruleset_id)} + __path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)} __path = f'/_query_rules/{__path_parts["ruleset_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -85,8 +84,7 @@ def get( """ if ruleset_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ruleset_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"ruleset_id": _quote(ruleset_id)} + __path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)} __path = f'/_query_rules/{__path_parts["ruleset_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -128,8 +126,7 @@ def list( :param from_: Starting offset (default: 0) :param size: specifies a max number of results to get """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_query_rules" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -181,8 +178,7 @@ def put( raise ValueError("Empty value passed for parameter 'ruleset_id'") if rules is None and body is None: raise ValueError("Empty value passed for parameter 'rules'") - __path_parts: t.Dict[str, str] - __path_parts = {"ruleset_id": _quote(ruleset_id)} + __path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)} __path = f'/_query_rules/{__path_parts["ruleset_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/rollup.py b/elasticsearch/_sync/client/rollup.py index 0ee53c0f7..850228997 100644 --- a/elasticsearch/_sync/client/rollup.py +++ b/elasticsearch/_sync/client/rollup.py @@ -44,8 +44,7 @@ def delete_job( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -176,8 +175,7 @@ def get_rollup_index_caps( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_rollup/data' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -286,8 +284,7 @@ def put_job( raise ValueError("Empty value passed for parameter 'page_size'") if rollup_index is None and body is None: raise ValueError("Empty value passed for parameter 'rollup_index'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -363,8 +360,7 @@ def rollup_search( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"index": _quote(index)} + __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/{__path_parts["index"]}/_rollup_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -419,8 +415,7 @@ def start_job( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}/_start' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -468,8 +463,7 @@ def stop_job( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_rollup/job/{__path_parts["id"]}/_stop' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/search_application.py b/elasticsearch/_sync/client/search_application.py index 36932b865..a34e722ef 100644 --- a/elasticsearch/_sync/client/search_application.py +++ b/elasticsearch/_sync/client/search_application.py @@ -44,8 +44,7 @@ def delete( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -85,8 +84,7 @@ def delete_behavioral_analytics( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/analytics/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -126,8 +124,7 @@ def get( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -214,8 +211,7 @@ def list( :param q: Query in the Lucene query string syntax. :param size: Specifies a max number of results to get. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_application/search_application" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -275,8 +271,7 @@ def put( ) elif search_application is not None and body is not None: raise ValueError("Cannot set both 'search_application' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if create is not None: @@ -320,8 +315,7 @@ def put_behavioral_analytics( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/analytics/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -368,8 +362,7 @@ def search( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_application/search_application/{__path_parts["name"]}/_search' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/searchable_snapshots.py b/elasticsearch/_sync/client/searchable_snapshots.py index 8611bcb4d..eefed01da 100644 --- a/elasticsearch/_sync/client/searchable_snapshots.py +++ b/elasticsearch/_sync/client/searchable_snapshots.py @@ -194,8 +194,10 @@ def mount( raise ValueError("Empty value passed for parameter 'snapshot'") if index is None and body is None: raise ValueError("Empty value passed for parameter 'index'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = ( f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_mount' ) diff --git a/elasticsearch/_sync/client/security.py b/elasticsearch/_sync/client/security.py index b0e3ed9f2..6d744981f 100644 --- a/elasticsearch/_sync/client/security.py +++ b/elasticsearch/_sync/client/security.py @@ -55,8 +55,7 @@ def activate_user_profile( """ if grant_type is None and body is None: raise ValueError("Empty value passed for parameter 'grant_type'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/profile/_activate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -103,8 +102,7 @@ def authenticate( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/_authenticate" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -215,8 +213,7 @@ def clear_api_key_cache( """ if ids in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ids'") - __path_parts: t.Dict[str, str] - __path_parts = {"ids": _quote(ids)} + __path_parts: t.Dict[str, str] = {"ids": _quote(ids)} __path = f'/_security/api_key/{__path_parts["ids"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -256,8 +253,7 @@ def clear_cached_privileges( """ if application in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'application'") - __path_parts: t.Dict[str, str] - __path_parts = {"application": _quote(application)} + __path_parts: t.Dict[str, str] = {"application": _quote(application)} __path = f'/_security/privilege/{__path_parts["application"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -300,8 +296,7 @@ def clear_cached_realms( """ if realms in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'realms'") - __path_parts: t.Dict[str, str] - __path_parts = {"realms": _quote(realms)} + __path_parts: t.Dict[str, str] = {"realms": _quote(realms)} __path = f'/_security/realm/{__path_parts["realms"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -343,8 +338,7 @@ def clear_cached_roles( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role/{__path_parts["name"]}/_clear_cache' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -392,8 +386,7 @@ def clear_cached_service_tokens( raise ValueError("Empty value passed for parameter 'service'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "namespace": _quote(namespace), "service": _quote(service), "name": _quote(name), @@ -460,8 +453,7 @@ def create_api_key( is the same as the request for create role API. For more details, see create or update roles API. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -595,8 +587,10 @@ def delete_privileges( raise ValueError("Empty value passed for parameter 'application'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"application": _quote(application), "name": _quote(name)} + __path_parts: t.Dict[str, str] = { + "application": _quote(application), + "name": _quote(name), + } __path = ( f'/_security/privilege/{__path_parts["application"]}/{__path_parts["name"]}' ) @@ -646,8 +640,7 @@ def delete_role( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -695,8 +688,7 @@ def delete_role_mapping( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role_mapping/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -752,8 +744,7 @@ def delete_service_token( raise ValueError("Empty value passed for parameter 'service'") if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "namespace": _quote(namespace), "service": _quote(service), "name": _quote(name), @@ -805,8 +796,7 @@ def delete_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -854,8 +844,7 @@ def disable_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}/_disable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -903,8 +892,7 @@ def disable_user_profile( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}/_disable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -952,8 +940,7 @@ def enable_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}/_enable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1001,8 +988,7 @@ def enable_user_profile( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}/_enable' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1040,8 +1026,7 @@ def enroll_kibana( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/enroll/kibana" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1076,8 +1061,7 @@ def enroll_node( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/enroll/node" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1140,8 +1124,7 @@ def get_api_key( associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} if active_only is not None: @@ -1191,8 +1174,7 @@ def get_builtin_privileges( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/privilege/_builtin" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1427,8 +1409,10 @@ def get_service_credentials( raise ValueError("Empty value passed for parameter 'namespace'") if service in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'service'") - __path_parts: t.Dict[str, str] - __path_parts = {"namespace": _quote(namespace), "service": _quote(service)} + __path_parts: t.Dict[str, str] = { + "namespace": _quote(namespace), + "service": _quote(service), + } __path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -1491,8 +1475,7 @@ def get_token( :param scope: :param username: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/oauth2/token" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1602,8 +1585,7 @@ def get_user_privileges( the API returns information about all privileges for the requested application. :param username: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/user/_privileges" __query: t.Dict[str, t.Any] = {} if application is not None: @@ -1654,8 +1636,7 @@ def get_user_profile( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}' __query: t.Dict[str, t.Any] = {} if data is not None: @@ -1728,8 +1709,7 @@ def grant_api_key( raise ValueError("Empty value passed for parameter 'api_key'") if grant_type is None and body is None: raise ValueError("Empty value passed for parameter 'grant_type'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key/grant" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1861,8 +1841,7 @@ def has_privileges_user_profile( raise ValueError("Empty value passed for parameter 'privileges'") if uids is None and body is None: raise ValueError("Empty value passed for parameter 'uids'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/profile/_has_privileges" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1927,8 +1906,7 @@ def invalidate_api_key( :param username: The username of a user. This parameter cannot be used with either `ids` or `name`, or when `owner` flag is set to `true`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -1990,8 +1968,7 @@ def invalidate_token( :param token: :param username: """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/oauth2/token" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2057,8 +2034,7 @@ def put_privileges( ) elif privileges is not None and body is not None: raise ValueError("Cannot set both 'privileges' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/privilege" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2150,8 +2126,7 @@ def put_role( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2238,8 +2213,7 @@ def put_role_mapping( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"name": _quote(name)} + __path_parts: t.Dict[str, str] = {"name": _quote(name)} __path = f'/_security/role_mapping/{__path_parts["name"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2328,8 +2302,7 @@ def put_user( """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'username'") - __path_parts: t.Dict[str, str] - __path_parts = {"username": _quote(username)} + __path_parts: t.Dict[str, str] = {"username": _quote(username)} __path = f'/_security/user/{__path_parts["username"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2418,8 +2391,7 @@ def query_api_keys( associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/_query/api_key" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2502,8 +2474,7 @@ def saml_authenticate( raise ValueError("Empty value passed for parameter 'content'") if ids is None and body is None: raise ValueError("Empty value passed for parameter 'ids'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/authenticate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2568,8 +2539,7 @@ def saml_complete_logout( raise ValueError("Empty value passed for parameter 'ids'") if realm is None and body is None: raise ValueError("Empty value passed for parameter 'realm'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/complete_logout" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2639,8 +2609,7 @@ def saml_invalidate( """ if query_string is None and body is None: raise ValueError("Empty value passed for parameter 'query_string'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/invalidate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2699,8 +2668,7 @@ def saml_logout( """ if token is None and body is None: raise ValueError("Empty value passed for parameter 'token'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/logout" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2758,8 +2726,7 @@ def saml_prepare_authentication( API returns as the RelayState query parameter. If the Authentication Request is signed, this value is used as part of the signature computation. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/saml/prepare" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2808,8 +2775,7 @@ def saml_service_provider_metadata( """ if realm_name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'realm_name'") - __path_parts: t.Dict[str, str] - __path_parts = {"realm_name": _quote(realm_name)} + __path_parts: t.Dict[str, str] = {"realm_name": _quote(realm_name)} __path = f'/_security/saml/metadata/{__path_parts["realm_name"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -2863,8 +2829,7 @@ def suggest_user_profiles( Name-related fields are the user's `username`, `full_name`, and `email`. :param size: Number of profiles to return. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_security/profile/_suggest" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -2937,8 +2902,7 @@ def update_api_key( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_security/api_key/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -3012,8 +2976,7 @@ def update_user_profile_data( """ if uid in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'uid'") - __path_parts: t.Dict[str, str] - __path_parts = {"uid": _quote(uid)} + __path_parts: t.Dict[str, str] = {"uid": _quote(uid)} __path = f'/_security/profile/{__path_parts["uid"]}/_data' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/shutdown.py b/elasticsearch/_sync/client/shutdown.py index c74d2f09f..0ab0d20bb 100644 --- a/elasticsearch/_sync/client/shutdown.py +++ b/elasticsearch/_sync/client/shutdown.py @@ -56,8 +56,7 @@ def delete_node( """ if node_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'node_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"node_id": _quote(node_id)} + __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)} __path = f'/_nodes/{__path_parts["node_id"]}/shutdown' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -211,8 +210,7 @@ def put_node( raise ValueError("Empty value passed for parameter 'reason'") if type is None and body is None: raise ValueError("Empty value passed for parameter 'type'") - __path_parts: t.Dict[str, str] - __path_parts = {"node_id": _quote(node_id)} + __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)} __path = f'/_nodes/{__path_parts["node_id"]}/shutdown' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/slm.py b/elasticsearch/_sync/client/slm.py index 89ed8360b..ed002ed2f 100644 --- a/elasticsearch/_sync/client/slm.py +++ b/elasticsearch/_sync/client/slm.py @@ -44,8 +44,7 @@ def delete_lifecycle( """ if policy_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'policy_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy_id": _quote(policy_id)} + __path_parts: t.Dict[str, str] = {"policy_id": _quote(policy_id)} __path = f'/_slm/policy/{__path_parts["policy_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -86,8 +85,7 @@ def execute_lifecycle( """ if policy_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'policy_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy_id": _quote(policy_id)} + __path_parts: t.Dict[str, str] = {"policy_id": _quote(policy_id)} __path = f'/_slm/policy/{__path_parts["policy_id"]}/_execute' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -122,8 +120,7 @@ def execute_retention( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/_execute_retention" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -203,8 +200,7 @@ def get_stats( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/stats" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -239,8 +235,7 @@ def get_status( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/status" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -309,8 +304,7 @@ def put_lifecycle( """ if policy_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'policy_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"policy_id": _quote(policy_id)} + __path_parts: t.Dict[str, str] = {"policy_id": _quote(policy_id)} __path = f'/_slm/policy/{__path_parts["policy_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -366,8 +360,7 @@ def start( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/start" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -402,8 +395,7 @@ def stop( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_slm/stop" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/snapshot.py b/elasticsearch/_sync/client/snapshot.py index dff7f1a28..ce374356e 100644 --- a/elasticsearch/_sync/client/snapshot.py +++ b/elasticsearch/_sync/client/snapshot.py @@ -50,8 +50,7 @@ def cleanup_repository( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}/_cleanup' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -116,8 +115,7 @@ def clone( raise ValueError("Empty value passed for parameter 'target_snapshot'") if indices is None and body is None: raise ValueError("Empty value passed for parameter 'indices'") - __path_parts: t.Dict[str, str] - __path_parts = { + __path_parts: t.Dict[str, str] = { "repository": _quote(repository), "snapshot": _quote(snapshot), "target_snapshot": _quote(target_snapshot), @@ -222,8 +220,10 @@ def create( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -268,14 +268,14 @@ def create( ) @_rewrite_parameters( - body_fields=("settings", "type", "repository"), + body_name="repository", ) def create_repository( self, *, name: str, - settings: t.Optional[t.Mapping[str, t.Any]] = None, - type: t.Optional[str] = None, + repository: t.Optional[t.Mapping[str, t.Any]] = None, + body: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -283,10 +283,8 @@ def create_repository( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - repository: t.Optional[t.Mapping[str, t.Any]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, verify: t.Optional[bool] = None, - body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a repository. @@ -294,24 +292,22 @@ def create_repository( ``_ :param name: A repository name - :param settings: - :param type: - :param master_timeout: Explicit operation timeout for connection to master node :param repository: + :param master_timeout: Explicit operation timeout for connection to master node :param timeout: Explicit operation timeout :param verify: Whether to verify the repository after creation """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - if settings is None and body is None: - raise ValueError("Empty value passed for parameter 'settings'") - if type is None and body is None: - raise ValueError("Empty value passed for parameter 'type'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + if repository is None and body is None: + raise ValueError( + "Empty value passed for parameters 'repository' and 'body', one of them should be set." + ) + elif repository is not None and body is not None: + raise ValueError("Cannot set both 'repository' and 'body'") + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}' __query: t.Dict[str, t.Any] = {} - __body: t.Dict[str, t.Any] = body if body is not None else {} if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -326,13 +322,7 @@ def create_repository( __query["timeout"] = timeout if verify is not None: __query["verify"] = verify - if not __body: - if settings is not None: - __body["settings"] = settings - if type is not None: - __body["type"] = type - if repository is not None: - __body["repository"] = repository + __body = repository if repository is not None else body __headers = {"accept": "application/json", "content-type": "application/json"} return self.perform_request( # type: ignore[return-value] "PUT", @@ -371,8 +361,10 @@ def delete( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -421,8 +413,7 @@ def delete_repository( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -528,8 +519,10 @@ def get( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}' __query: t.Dict[str, t.Any] = {} if after is not None: @@ -694,8 +687,10 @@ def restore( raise ValueError("Empty value passed for parameter 'repository'") if snapshot in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'snapshot'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(repository), "snapshot": _quote(snapshot)} + __path_parts: t.Dict[str, str] = { + "repository": _quote(repository), + "snapshot": _quote(snapshot), + } __path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_restore' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -834,8 +829,7 @@ def verify_repository( """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - __path_parts: t.Dict[str, str] - __path_parts = {"repository": _quote(name)} + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} __path = f'/_snapshot/{__path_parts["repository"]}/_verify' __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/sql.py b/elasticsearch/_sync/client/sql.py index 45273a10e..ea25c4c25 100644 --- a/elasticsearch/_sync/client/sql.py +++ b/elasticsearch/_sync/client/sql.py @@ -47,8 +47,7 @@ def clear_cursor( """ if cursor is None and body is None: raise ValueError("Empty value passed for parameter 'cursor'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_sql/close" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -94,8 +93,7 @@ def delete_async( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_sql/async/delete/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -151,8 +149,7 @@ def get_async( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_sql/async/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if delimiter is not None: @@ -201,8 +198,7 @@ def get_async_status( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_sql/async/status/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -310,8 +306,7 @@ def query( to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_sql" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -397,8 +392,7 @@ def translate( """ if query is None and body is None: raise ValueError("Empty value passed for parameter 'query'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_sql/translate" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/ssl.py b/elasticsearch/_sync/client/ssl.py index 4225032df..19892748e 100644 --- a/elasticsearch/_sync/client/ssl.py +++ b/elasticsearch/_sync/client/ssl.py @@ -40,8 +40,7 @@ def certificates( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_ssl/certificates" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/synonyms.py b/elasticsearch/_sync/client/synonyms.py index b97562d7d..be3b30e95 100644 --- a/elasticsearch/_sync/client/synonyms.py +++ b/elasticsearch/_sync/client/synonyms.py @@ -44,8 +44,7 @@ def delete_synonym( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_synonyms/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -89,8 +88,10 @@ def delete_synonym_rule( raise ValueError("Empty value passed for parameter 'set_id'") if rule_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'rule_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"set_id": _quote(set_id), "rule_id": _quote(rule_id)} + __path_parts: t.Dict[str, str] = { + "set_id": _quote(set_id), + "rule_id": _quote(rule_id), + } __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -136,8 +137,7 @@ def get_synonym( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_synonyms/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -185,8 +185,10 @@ def get_synonym_rule( raise ValueError("Empty value passed for parameter 'set_id'") if rule_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'rule_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"set_id": _quote(set_id), "rule_id": _quote(rule_id)} + __path_parts: t.Dict[str, str] = { + "set_id": _quote(set_id), + "rule_id": _quote(rule_id), + } __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -228,8 +230,7 @@ def get_synonyms_sets( :param from_: Starting offset :param size: specifies a max number of results to get """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_synonyms" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -280,8 +281,7 @@ def put_synonym( raise ValueError("Empty value passed for parameter 'id'") if synonyms_set is None and body is None: raise ValueError("Empty value passed for parameter 'synonyms_set'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_synonyms/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -337,8 +337,10 @@ def put_synonym_rule( raise ValueError("Empty value passed for parameter 'rule_id'") if synonyms is None and body is None: raise ValueError("Empty value passed for parameter 'synonyms'") - __path_parts: t.Dict[str, str] - __path_parts = {"set_id": _quote(set_id), "rule_id": _quote(rule_id)} + __path_parts: t.Dict[str, str] = { + "set_id": _quote(set_id), + "rule_id": _quote(rule_id), + } __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/tasks.py b/elasticsearch/_sync/client/tasks.py index f21ad1d4d..b6dad4097 100644 --- a/elasticsearch/_sync/client/tasks.py +++ b/elasticsearch/_sync/client/tasks.py @@ -111,8 +111,7 @@ def get( """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'task_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"task_id": _quote(task_id)} + __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)} __path = f'/_tasks/{__path_parts["task_id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -180,8 +179,7 @@ def list( :param wait_for_completion: If `true`, the request blocks until the operation is complete. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_tasks" __query: t.Dict[str, t.Any] = {} if actions is not None: diff --git a/elasticsearch/_sync/client/text_structure.py b/elasticsearch/_sync/client/text_structure.py index c3cfafb7e..a7c30711e 100644 --- a/elasticsearch/_sync/client/text_structure.py +++ b/elasticsearch/_sync/client/text_structure.py @@ -127,8 +127,7 @@ def find_structure( ) elif text_files is not None and body is not None: raise ValueError("Cannot set both 'text_files' and 'body'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_text_structure/find_structure" __query: t.Dict[str, t.Any] = {} if charset is not None: @@ -205,8 +204,7 @@ def test_grok_pattern( raise ValueError("Empty value passed for parameter 'grok_pattern'") if text is None and body is None: raise ValueError("Empty value passed for parameter 'text'") - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_text_structure/test_grok_pattern" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} diff --git a/elasticsearch/_sync/client/transform.py b/elasticsearch/_sync/client/transform.py index 836f121f1..74aa65f0c 100644 --- a/elasticsearch/_sync/client/transform.py +++ b/elasticsearch/_sync/client/transform.py @@ -55,8 +55,7 @@ def delete_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}' __query: t.Dict[str, t.Any] = {} if delete_dest_index is not None: @@ -187,8 +186,7 @@ def get_transform_stats( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_stats' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -408,8 +406,7 @@ def put_transform( raise ValueError("Empty value passed for parameter 'dest'") if source is None and body is None: raise ValueError("Empty value passed for parameter 'source'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -482,8 +479,7 @@ def reset_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_reset' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -527,8 +523,7 @@ def schedule_now_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_schedule_now' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -579,8 +574,7 @@ def start_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_start' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -649,8 +643,7 @@ def stop_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_stop' __query: t.Dict[str, t.Any] = {} if allow_no_match is not None: @@ -740,8 +733,7 @@ def update_transform( """ if transform_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'transform_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"transform_id": _quote(transform_id)} + __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)} __path = f'/_transform/{__path_parts["transform_id"]}/_update' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -805,8 +797,7 @@ def upgrade_transforms( :param timeout: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_transform/_upgrade" __query: t.Dict[str, t.Any] = {} if dry_run is not None: diff --git a/elasticsearch/_sync/client/watcher.py b/elasticsearch/_sync/client/watcher.py index 03fc9c060..5f7291dbd 100644 --- a/elasticsearch/_sync/client/watcher.py +++ b/elasticsearch/_sync/client/watcher.py @@ -96,8 +96,7 @@ def activate_watch( """ if watch_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'watch_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"watch_id": _quote(watch_id)} + __path_parts: t.Dict[str, str] = {"watch_id": _quote(watch_id)} __path = f'/_watcher/watch/{__path_parts["watch_id"]}/_activate' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -137,8 +136,7 @@ def deactivate_watch( """ if watch_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'watch_id'") - __path_parts: t.Dict[str, str] - __path_parts = {"watch_id": _quote(watch_id)} + __path_parts: t.Dict[str, str] = {"watch_id": _quote(watch_id)} __path = f'/_watcher/watch/{__path_parts["watch_id"]}/_deactivate' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -178,8 +176,7 @@ def delete_watch( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_watcher/watch/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -329,8 +326,7 @@ def get_watch( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_watcher/watch/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -405,8 +401,7 @@ def put_watch( """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") - __path_parts: t.Dict[str, str] - __path_parts = {"id": _quote(id)} + __path_parts: t.Dict[str, str] = {"id": _quote(id)} __path = f'/_watcher/watch/{__path_parts["id"]}' __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -493,8 +488,7 @@ def query_watches( :param size: The number of hits to return. Needs to be non-negative. :param sort: Optional sort definition. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_watcher/_query/watches" __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} @@ -557,8 +551,7 @@ def start( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_watcher/_start" __query: t.Dict[str, t.Any] = {} if error_trace is not None: @@ -654,8 +647,7 @@ def stop( ``_ """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_watcher/_stop" __query: t.Dict[str, t.Any] = {} if error_trace is not None: diff --git a/elasticsearch/_sync/client/xpack.py b/elasticsearch/_sync/client/xpack.py index a46dc8e80..9ab1989a1 100644 --- a/elasticsearch/_sync/client/xpack.py +++ b/elasticsearch/_sync/client/xpack.py @@ -49,8 +49,7 @@ def info( :param categories: A comma-separated list of the information categories to include in the response. For example, `build,license,features`. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_xpack" __query: t.Dict[str, t.Any] = {} if accept_enterprise is not None: @@ -96,8 +95,7 @@ def usage( no response is received before the timeout expires, the request fails and returns an error. """ - __path_parts: t.Dict[str, str] - __path_parts = {} + __path_parts: t.Dict[str, str] = {} __path = "/_xpack/usage" __query: t.Dict[str, t.Any] = {} if error_trace is not None: