Skip to content

Commit c2057f8

Browse files
committed
Update APIs to 8.3.0-SNAPSHOT
1 parent b6d17f8 commit c2057f8

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

elasticsearch/_async/client/security.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,16 @@ async def create_service_token(
438438
*,
439439
namespace: str,
440440
service: str,
441-
name: str,
441+
name: t.Optional[str] = None,
442442
error_trace: t.Optional[bool] = None,
443443
filter_path: t.Optional[
444444
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
445445
] = None,
446446
human: t.Optional[bool] = None,
447447
pretty: t.Optional[bool] = None,
448+
refresh: t.Optional[
449+
t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
450+
] = None,
448451
) -> ObjectApiResponse[t.Any]:
449452
"""
450453
Creates a service account token for access without requiring basic authentication.
@@ -454,13 +457,14 @@ async def create_service_token(
454457
:param namespace: An identifier for the namespace
455458
:param service: An identifier for the service name
456459
:param name: An identifier for the token name
460+
:param refresh: If `true` then refresh the affected shards to make this operation
461+
visible to search, if `wait_for` (the default) then wait for a refresh to
462+
make this operation visible to search, if `false` then do nothing with refreshes.
457463
"""
458464
if namespace in SKIP_IN_PATH:
459465
raise ValueError("Empty value passed for parameter 'namespace'")
460466
if service in SKIP_IN_PATH:
461467
raise ValueError("Empty value passed for parameter 'service'")
462-
if name in SKIP_IN_PATH:
463-
raise ValueError("Empty value passed for parameter 'name'")
464468
if (
465469
namespace not in SKIP_IN_PATH
466470
and service not in SKIP_IN_PATH
@@ -482,6 +486,8 @@ async def create_service_token(
482486
__query["human"] = human
483487
if pretty is not None:
484488
__query["pretty"] = pretty
489+
if refresh is not None:
490+
__query["refresh"] = refresh
485491
__headers = {"accept": "application/json"}
486492
return await self.perform_request( # type: ignore[return-value]
487493
__method, __path, params=__query, headers=__headers

elasticsearch/_sync/client/security.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,16 @@ def create_service_token(
438438
*,
439439
namespace: str,
440440
service: str,
441-
name: str,
441+
name: t.Optional[str] = None,
442442
error_trace: t.Optional[bool] = None,
443443
filter_path: t.Optional[
444444
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
445445
] = None,
446446
human: t.Optional[bool] = None,
447447
pretty: t.Optional[bool] = None,
448+
refresh: t.Optional[
449+
t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
450+
] = None,
448451
) -> ObjectApiResponse[t.Any]:
449452
"""
450453
Creates a service account token for access without requiring basic authentication.
@@ -454,13 +457,14 @@ def create_service_token(
454457
:param namespace: An identifier for the namespace
455458
:param service: An identifier for the service name
456459
:param name: An identifier for the token name
460+
:param refresh: If `true` then refresh the affected shards to make this operation
461+
visible to search, if `wait_for` (the default) then wait for a refresh to
462+
make this operation visible to search, if `false` then do nothing with refreshes.
457463
"""
458464
if namespace in SKIP_IN_PATH:
459465
raise ValueError("Empty value passed for parameter 'namespace'")
460466
if service in SKIP_IN_PATH:
461467
raise ValueError("Empty value passed for parameter 'service'")
462-
if name in SKIP_IN_PATH:
463-
raise ValueError("Empty value passed for parameter 'name'")
464468
if (
465469
namespace not in SKIP_IN_PATH
466470
and service not in SKIP_IN_PATH
@@ -482,6 +486,8 @@ def create_service_token(
482486
__query["human"] = human
483487
if pretty is not None:
484488
__query["pretty"] = pretty
489+
if refresh is not None:
490+
__query["refresh"] = refresh
485491
__headers = {"accept": "application/json"}
486492
return self.perform_request( # type: ignore[return-value]
487493
__method, __path, params=__query, headers=__headers

0 commit comments

Comments
 (0)