Skip to content

Auto-generated code for main #2409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion elasticsearch/_async/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ async def enroll_node(
async def get_api_key(
self,
*,
active_only: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
Expand All @@ -951,6 +952,11 @@ async def get_api_key(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-api-key.html>`_

:param active_only: A boolean flag that can be used to query API keys that are
currently active. An API key is considered active if it is neither invalidated,
nor expired at query time. You can specify this together with other parameters
such as `owner` or `name`. If `active_only` is false, the response will include
both active and inactive (expired or invalidated) keys.
:param id: An API key id. This parameter cannot be used with any of `name`, `realm_name`
or `username`.
:param name: An API key name. This parameter cannot be used with any of `id`,
Expand All @@ -969,6 +975,8 @@ async def get_api_key(
"""
__path = "/_security/api_key"
__query: t.Dict[str, t.Any] = {}
if active_only is not None:
__query["active_only"] = active_only
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
Expand Down Expand Up @@ -1875,7 +1883,14 @@ async def put_role(
)

@_rewrite_parameters(
body_fields=("enabled", "metadata", "roles", "rules", "run_as"),
body_fields=(
"enabled",
"metadata",
"role_templates",
"roles",
"rules",
"run_as",
),
)
async def put_role_mapping(
self,
Expand All @@ -1890,6 +1905,7 @@ async def put_role_mapping(
refresh: t.Optional[
t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
] = None,
role_templates: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
roles: t.Optional[t.Sequence[str]] = None,
rules: t.Optional[t.Mapping[str, t.Any]] = None,
run_as: t.Optional[t.Sequence[str]] = None,
Expand All @@ -1906,6 +1922,7 @@ async def put_role_mapping(
:param refresh: If `true` (the default) then refresh the affected shards to make
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 role_templates:
:param roles:
:param rules:
:param run_as:
Expand All @@ -1930,6 +1947,8 @@ async def put_role_mapping(
__body["enabled"] = enabled
if metadata is not None:
__body["metadata"] = metadata
if role_templates is not None:
__body["role_templates"] = role_templates
if roles is not None:
__body["roles"] = roles
if rules is not None:
Expand Down
21 changes: 20 additions & 1 deletion elasticsearch/_sync/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ def enroll_node(
def get_api_key(
self,
*,
active_only: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
Expand All @@ -951,6 +952,11 @@ def get_api_key(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-api-key.html>`_

:param active_only: A boolean flag that can be used to query API keys that are
currently active. An API key is considered active if it is neither invalidated,
nor expired at query time. You can specify this together with other parameters
such as `owner` or `name`. If `active_only` is false, the response will include
both active and inactive (expired or invalidated) keys.
:param id: An API key id. This parameter cannot be used with any of `name`, `realm_name`
or `username`.
:param name: An API key name. This parameter cannot be used with any of `id`,
Expand All @@ -969,6 +975,8 @@ def get_api_key(
"""
__path = "/_security/api_key"
__query: t.Dict[str, t.Any] = {}
if active_only is not None:
__query["active_only"] = active_only
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
Expand Down Expand Up @@ -1875,7 +1883,14 @@ def put_role(
)

@_rewrite_parameters(
body_fields=("enabled", "metadata", "roles", "rules", "run_as"),
body_fields=(
"enabled",
"metadata",
"role_templates",
"roles",
"rules",
"run_as",
),
)
def put_role_mapping(
self,
Expand All @@ -1890,6 +1905,7 @@ def put_role_mapping(
refresh: t.Optional[
t.Union["t.Literal['false', 'true', 'wait_for']", bool, str]
] = None,
role_templates: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
roles: t.Optional[t.Sequence[str]] = None,
rules: t.Optional[t.Mapping[str, t.Any]] = None,
run_as: t.Optional[t.Sequence[str]] = None,
Expand All @@ -1906,6 +1922,7 @@ def put_role_mapping(
:param refresh: If `true` (the default) then refresh the affected shards to make
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 role_templates:
:param roles:
:param rules:
:param run_as:
Expand All @@ -1930,6 +1947,8 @@ def put_role_mapping(
__body["enabled"] = enabled
if metadata is not None:
__body["metadata"] = metadata
if role_templates is not None:
__body["role_templates"] = role_templates
if roles is not None:
__body["roles"] = roles
if rules is not None:
Expand Down