Skip to content

Commit c1689c2

Browse files
Auto-generated API code (elastic#2412)
1 parent e529585 commit c1689c2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

elasticsearch/_async/client/security.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2513,13 +2513,14 @@ async def suggest_user_profiles(
25132513
)
25142514

25152515
@_rewrite_parameters(
2516-
body_fields=("metadata", "role_descriptors"),
2516+
body_fields=("expiration", "metadata", "role_descriptors"),
25172517
)
25182518
async def update_api_key(
25192519
self,
25202520
*,
25212521
id: str,
25222522
error_trace: t.Optional[bool] = None,
2523+
expiration: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
25232524
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
25242525
human: t.Optional[bool] = None,
25252526
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -2533,6 +2534,7 @@ async def update_api_key(
25332534
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-update-api-key.html>`_
25342535
25352536
:param id: The ID of the API key to update.
2537+
:param expiration: Expiration time for the API key.
25362538
:param metadata: Arbitrary metadata that you want to associate with the API key.
25372539
It supports nested data structure. Within the metadata object, keys beginning
25382540
with _ are reserved for system usage.
@@ -2559,6 +2561,8 @@ async def update_api_key(
25592561
if pretty is not None:
25602562
__query["pretty"] = pretty
25612563
if not __body:
2564+
if expiration is not None:
2565+
__body["expiration"] = expiration
25622566
if metadata is not None:
25632567
__body["metadata"] = metadata
25642568
if role_descriptors is not None:

elasticsearch/_sync/client/security.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2513,13 +2513,14 @@ def suggest_user_profiles(
25132513
)
25142514

25152515
@_rewrite_parameters(
2516-
body_fields=("metadata", "role_descriptors"),
2516+
body_fields=("expiration", "metadata", "role_descriptors"),
25172517
)
25182518
def update_api_key(
25192519
self,
25202520
*,
25212521
id: str,
25222522
error_trace: t.Optional[bool] = None,
2523+
expiration: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
25232524
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
25242525
human: t.Optional[bool] = None,
25252526
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -2533,6 +2534,7 @@ def update_api_key(
25332534
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-update-api-key.html>`_
25342535
25352536
:param id: The ID of the API key to update.
2537+
:param expiration: Expiration time for the API key.
25362538
:param metadata: Arbitrary metadata that you want to associate with the API key.
25372539
It supports nested data structure. Within the metadata object, keys beginning
25382540
with _ are reserved for system usage.
@@ -2559,6 +2561,8 @@ def update_api_key(
25592561
if pretty is not None:
25602562
__query["pretty"] = pretty
25612563
if not __body:
2564+
if expiration is not None:
2565+
__body["expiration"] = expiration
25622566
if metadata is not None:
25632567
__body["metadata"] = metadata
25642568
if role_descriptors is not None:

0 commit comments

Comments
 (0)