Skip to content

Commit 8d10e15

Browse files
Auto-generated API code
1 parent 2908dc0 commit 8d10e15

File tree

6 files changed

+16
-20
lines changed

6 files changed

+16
-20
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,10 +2948,10 @@ async def put_script(
29482948
async def rank_eval(
29492949
self,
29502950
*,
2951-
index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]],
29522951
requests: t.Union[
29532952
t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]
29542953
],
2954+
index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None,
29552955
allow_no_indices: t.Optional[bool] = None,
29562956
error_trace: t.Optional[bool] = None,
29572957
expand_wildcards: t.Optional[
@@ -2987,12 +2987,12 @@ async def rank_eval(
29872987
29882988
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
29892989
2990+
:param requests: A set of typical search requests, together with their provided
2991+
ratings.
29902992
:param index: Comma-separated list of data streams, indices, and index aliases
29912993
used to limit the request. Wildcard (`*`) expressions are supported. To target
29922994
all data streams and indices in a cluster, omit this parameter or use `_all`
29932995
or `*`.
2994-
:param requests: A set of typical search requests, together with their provided
2995-
ratings.
29962996
:param allow_no_indices: If `false`, the request returns an error if any wildcard
29972997
expression, index alias, or `_all` value targets only missing or closed indices.
29982998
This behavior applies even if the request targets other open indices. For
@@ -3005,8 +3005,6 @@ async def rank_eval(
30053005
:param metric: Definition of the evaluation metric to calculate.
30063006
:param search_type: Search operation type
30073007
"""
3008-
if index in SKIP_IN_PATH:
3009-
raise ValueError("Empty value passed for parameter 'index'")
30103008
if requests is None:
30113009
raise ValueError("Empty value passed for parameter 'requests'")
30123010
if index not in SKIP_IN_PATH:

elasticsearch/_async/client/fleet.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ async def global_checkpoints(
8989
async def msearch(
9090
self,
9191
*,
92-
index: str,
9392
searches: t.Union[
9493
t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]
9594
],
95+
index: t.Optional[str] = None,
9696
allow_no_indices: t.Optional[bool] = None,
9797
allow_partial_search_results: t.Optional[bool] = None,
9898
ccs_minimize_roundtrips: t.Optional[bool] = None,
@@ -139,9 +139,9 @@ async def msearch(
139139
are available due to a refresh. This API is designed for internal use by the
140140
fleet server project.
141141
142+
:param searches:
142143
:param index: A single target to search. If the target is an index alias, it
143144
must resolve to a single index.
144-
:param searches:
145145
:param allow_no_indices: If false, the request returns an error if any wildcard
146146
expression, index alias, or _all value targets only missing or closed indices.
147147
This behavior applies even if the request targets other open indices. For
@@ -181,8 +181,6 @@ async def msearch(
181181
has become visible for search. Defaults to an empty list which will cause
182182
Elasticsearch to immediately execute the search.
183183
"""
184-
if index in SKIP_IN_PATH:
185-
raise ValueError("Empty value passed for parameter 'index'")
186184
if searches is None:
187185
raise ValueError("Empty value passed for parameter 'searches'")
188186
if index not in SKIP_IN_PATH:

elasticsearch/_async/client/ml.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MlClient(NamespacedClient):
2828
async def clear_trained_model_deployment_cache(
2929
self,
3030
*,
31-
model_id: t.Optional[str] = None,
31+
model_id: str,
3232
error_trace: t.Optional[bool] = None,
3333
filter_path: t.Optional[
3434
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
@@ -43,6 +43,8 @@ async def clear_trained_model_deployment_cache(
4343
4444
:param model_id: The unique identifier of the trained model.
4545
"""
46+
if model_id in SKIP_IN_PATH:
47+
raise ValueError("Empty value passed for parameter 'model_id'")
4648
__path = f"/_ml/trained_models/{_quote(model_id)}/deployment/cache/_clear"
4749
__query: t.Dict[str, t.Any] = {}
4850
if error_trace is not None:

elasticsearch/_sync/client/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,10 +2946,10 @@ def put_script(
29462946
def rank_eval(
29472947
self,
29482948
*,
2949-
index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]],
29502949
requests: t.Union[
29512950
t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]
29522951
],
2952+
index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None,
29532953
allow_no_indices: t.Optional[bool] = None,
29542954
error_trace: t.Optional[bool] = None,
29552955
expand_wildcards: t.Optional[
@@ -2985,12 +2985,12 @@ def rank_eval(
29852985
29862986
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html>`_
29872987
2988+
:param requests: A set of typical search requests, together with their provided
2989+
ratings.
29882990
:param index: Comma-separated list of data streams, indices, and index aliases
29892991
used to limit the request. Wildcard (`*`) expressions are supported. To target
29902992
all data streams and indices in a cluster, omit this parameter or use `_all`
29912993
or `*`.
2992-
:param requests: A set of typical search requests, together with their provided
2993-
ratings.
29942994
:param allow_no_indices: If `false`, the request returns an error if any wildcard
29952995
expression, index alias, or `_all` value targets only missing or closed indices.
29962996
This behavior applies even if the request targets other open indices. For
@@ -3003,8 +3003,6 @@ def rank_eval(
30033003
:param metric: Definition of the evaluation metric to calculate.
30043004
:param search_type: Search operation type
30053005
"""
3006-
if index in SKIP_IN_PATH:
3007-
raise ValueError("Empty value passed for parameter 'index'")
30083006
if requests is None:
30093007
raise ValueError("Empty value passed for parameter 'requests'")
30103008
if index not in SKIP_IN_PATH:

elasticsearch/_sync/client/fleet.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def global_checkpoints(
8989
def msearch(
9090
self,
9191
*,
92-
index: str,
9392
searches: t.Union[
9493
t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]
9594
],
95+
index: t.Optional[str] = None,
9696
allow_no_indices: t.Optional[bool] = None,
9797
allow_partial_search_results: t.Optional[bool] = None,
9898
ccs_minimize_roundtrips: t.Optional[bool] = None,
@@ -139,9 +139,9 @@ def msearch(
139139
are available due to a refresh. This API is designed for internal use by the
140140
fleet server project.
141141
142+
:param searches:
142143
:param index: A single target to search. If the target is an index alias, it
143144
must resolve to a single index.
144-
:param searches:
145145
:param allow_no_indices: If false, the request returns an error if any wildcard
146146
expression, index alias, or _all value targets only missing or closed indices.
147147
This behavior applies even if the request targets other open indices. For
@@ -181,8 +181,6 @@ def msearch(
181181
has become visible for search. Defaults to an empty list which will cause
182182
Elasticsearch to immediately execute the search.
183183
"""
184-
if index in SKIP_IN_PATH:
185-
raise ValueError("Empty value passed for parameter 'index'")
186184
if searches is None:
187185
raise ValueError("Empty value passed for parameter 'searches'")
188186
if index not in SKIP_IN_PATH:

elasticsearch/_sync/client/ml.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MlClient(NamespacedClient):
2828
def clear_trained_model_deployment_cache(
2929
self,
3030
*,
31-
model_id: t.Optional[str] = None,
31+
model_id: str,
3232
error_trace: t.Optional[bool] = None,
3333
filter_path: t.Optional[
3434
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
@@ -43,6 +43,8 @@ def clear_trained_model_deployment_cache(
4343
4444
:param model_id: The unique identifier of the trained model.
4545
"""
46+
if model_id in SKIP_IN_PATH:
47+
raise ValueError("Empty value passed for parameter 'model_id'")
4648
__path = f"/_ml/trained_models/{_quote(model_id)}/deployment/cache/_clear"
4749
__query: t.Dict[str, t.Any] = {}
4850
if error_trace is not None:

0 commit comments

Comments
 (0)