Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jun 11, 2024
1 parent 7361e80 commit f2c9f63
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
10 changes: 10 additions & 0 deletions elasticsearch/_async/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ async def delete(
str,
]
] = None,
dry_run: 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,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
Expand All @@ -48,6 +50,10 @@ async def delete(
:param inference_id: The inference Id
:param task_type: The task type
:param dry_run: When true, the endpoint is not deleted, and a list of ingest
processors which reference this endpoint is returned
:param force: When true, the inference endpoint is forcefully deleted even if
it is still being used by ingest processors or semantic text fields
"""
if inference_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'inference_id'")
Expand All @@ -64,10 +70,14 @@ async def delete(
else:
raise ValueError("Couldn't find a path for the given parameters")
__query: t.Dict[str, t.Any] = {}
if dry_run is not None:
__query["dry_run"] = dry_run
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if force is not None:
__query["force"] = force
if human is not None:
__query["human"] = human
if pretty is not None:
Expand Down
6 changes: 5 additions & 1 deletion elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5088,7 +5088,11 @@ async def update_trained_model_deployment(
if not __body:
if number_of_allocations is not None:
__body["number_of_allocations"] = number_of_allocations
__headers = {"accept": "application/json", "content-type": "application/json"}
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
return await self.perform_request( # type: ignore[return-value]
"POST",
__path,
Expand Down
3 changes: 3 additions & 0 deletions elasticsearch/_async/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,9 @@ async def put_role(
this operation visible to search, if `wait_for` then wait for a refresh to
make this operation visible to search, if `false` then do nothing with refreshes.
:param run_as: A list of users that the owners of this role can impersonate.
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
you can still specify an empty `run_as` field, but a non-empty list will
be rejected.
:param transient_metadata: Indicates roles that might be incompatible with the
current cluster license, specifically roles with document and field level
security. When the cluster license doesn’t allow certain features for a given
Expand Down
10 changes: 10 additions & 0 deletions elasticsearch/_sync/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ def delete(
str,
]
] = None,
dry_run: 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,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
Expand All @@ -48,6 +50,10 @@ def delete(
:param inference_id: The inference Id
:param task_type: The task type
:param dry_run: When true, the endpoint is not deleted, and a list of ingest
processors which reference this endpoint is returned
:param force: When true, the inference endpoint is forcefully deleted even if
it is still being used by ingest processors or semantic text fields
"""
if inference_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'inference_id'")
Expand All @@ -64,10 +70,14 @@ def delete(
else:
raise ValueError("Couldn't find a path for the given parameters")
__query: t.Dict[str, t.Any] = {}
if dry_run is not None:
__query["dry_run"] = dry_run
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if force is not None:
__query["force"] = force
if human is not None:
__query["human"] = human
if pretty is not None:
Expand Down
6 changes: 5 additions & 1 deletion elasticsearch/_sync/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5088,7 +5088,11 @@ def update_trained_model_deployment(
if not __body:
if number_of_allocations is not None:
__body["number_of_allocations"] = number_of_allocations
__headers = {"accept": "application/json", "content-type": "application/json"}
if not __body:
__body = None # type: ignore[assignment]
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
return self.perform_request( # type: ignore[return-value]
"POST",
__path,
Expand Down
3 changes: 3 additions & 0 deletions elasticsearch/_sync/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,9 @@ def put_role(
this operation visible to search, if `wait_for` then wait for a refresh to
make this operation visible to search, if `false` then do nothing with refreshes.
:param run_as: A list of users that the owners of this role can impersonate.
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
you can still specify an empty `run_as` field, but a non-empty list will
be rejected.
:param transient_metadata: Indicates roles that might be incompatible with the
current cluster license, specifically roles with document and field level
security. When the cluster license doesn’t allow certain features for a given
Expand Down

0 comments on commit f2c9f63

Please sign in to comment.