From a6bb5f3808ef8616afde81ebc1dc53f98011a2b8 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 3 Nov 2023 22:48:54 +1100 Subject: [PATCH] Auto-generated API code (#2357) --- elasticsearch/_async/client/ml.py | 4 ++++ elasticsearch/_async/client/transform.py | 6 ++++++ elasticsearch/_sync/client/ml.py | 4 ++++ elasticsearch/_sync/client/transform.py | 6 ++++++ 4 files changed, 20 insertions(+) diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 9c1339aa1..38c312df3 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -3303,6 +3303,7 @@ async def put_trained_model_vocabulary( human: t.Optional[bool] = None, merges: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, + scores: t.Optional[t.Sequence[float]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a trained model vocabulary @@ -3312,6 +3313,7 @@ async def put_trained_model_vocabulary( :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. :param merges: The optional model merges if required by the tokenizer. + :param scores: The optional vocabulary value scores if required by the tokenizer. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -3332,6 +3334,8 @@ async def put_trained_model_vocabulary( __body["merges"] = merges if pretty is not None: __query["pretty"] = pretty + if scores is not None: + __body["scores"] = scores __headers = {"accept": "application/json", "content-type": "application/json"} return await self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body diff --git a/elasticsearch/_async/client/transform.py b/elasticsearch/_async/client/transform.py index 307ac31f6..c4e603fe4 100644 --- a/elasticsearch/_async/client/transform.py +++ b/elasticsearch/_async/client/transform.py @@ -29,6 +29,7 @@ async def delete_transform( self, *, transform_id: str, + delete_dest_index: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, @@ -42,6 +43,9 @@ async def delete_transform( ``_ :param transform_id: Identifier for the transform. + :param delete_dest_index: If this value is true, the destination index is deleted + together with the transform. If false, the destination index will not be + deleted :param force: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state. @@ -52,6 +56,8 @@ async def delete_transform( raise ValueError("Empty value passed for parameter 'transform_id'") __path = f"/_transform/{_quote(transform_id)}" __query: t.Dict[str, t.Any] = {} + if delete_dest_index is not None: + __query["delete_dest_index"] = delete_dest_index if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: diff --git a/elasticsearch/_sync/client/ml.py b/elasticsearch/_sync/client/ml.py index ce85e587c..3a7a7601c 100644 --- a/elasticsearch/_sync/client/ml.py +++ b/elasticsearch/_sync/client/ml.py @@ -3303,6 +3303,7 @@ def put_trained_model_vocabulary( human: t.Optional[bool] = None, merges: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, + scores: t.Optional[t.Sequence[float]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a trained model vocabulary @@ -3312,6 +3313,7 @@ def put_trained_model_vocabulary( :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. :param merges: The optional model merges if required by the tokenizer. + :param scores: The optional vocabulary value scores if required by the tokenizer. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -3332,6 +3334,8 @@ def put_trained_model_vocabulary( __body["merges"] = merges if pretty is not None: __query["pretty"] = pretty + if scores is not None: + __body["scores"] = scores __headers = {"accept": "application/json", "content-type": "application/json"} return self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body diff --git a/elasticsearch/_sync/client/transform.py b/elasticsearch/_sync/client/transform.py index fce52db75..63631d3fd 100644 --- a/elasticsearch/_sync/client/transform.py +++ b/elasticsearch/_sync/client/transform.py @@ -29,6 +29,7 @@ def delete_transform( self, *, transform_id: str, + delete_dest_index: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, @@ -42,6 +43,9 @@ def delete_transform( ``_ :param transform_id: Identifier for the transform. + :param delete_dest_index: If this value is true, the destination index is deleted + together with the transform. If false, the destination index will not be + deleted :param force: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state. @@ -52,6 +56,8 @@ def delete_transform( raise ValueError("Empty value passed for parameter 'transform_id'") __path = f"/_transform/{_quote(transform_id)}" __query: t.Dict[str, t.Any] = {} + if delete_dest_index is not None: + __query["delete_dest_index"] = delete_dest_index if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: