Skip to content

Commit

Permalink
Auto-generated API code (#2358)
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 3, 2023
1 parent 8d43d3d commit f596e8a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'")
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions elasticsearch/_async/client/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -42,6 +43,9 @@ async def delete_transform(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/delete-transform.html>`_
: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.
Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions elasticsearch/_sync/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'")
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions elasticsearch/_sync/client/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -42,6 +43,9 @@ def delete_transform(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/delete-transform.html>`_
: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.
Expand All @@ -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:
Expand Down

0 comments on commit f596e8a

Please sign in to comment.