Skip to content

Auto-generated code for main #2475

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 3 commits into from
Mar 26, 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
12 changes: 4 additions & 8 deletions elasticsearch/_async/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ async def put_model(
self,
*,
inference_id: str,
model_config: t.Optional[t.Mapping[str, t.Any]] = None,
body: t.Optional[t.Mapping[str, t.Any]] = None,
task_type: t.Optional[
t.Union["t.Literal['sparse_embedding', 'text_embedding']", str]
] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
model_config: t.Optional[t.Mapping[str, t.Any]] = None,
body: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -230,8 +230,8 @@ async def put_model(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html>`_

:param inference_id: The inference Id
:param task_type: The task type
:param model_config:
:param task_type: The task type
"""
if inference_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'inference_id'")
Expand Down Expand Up @@ -263,11 +263,7 @@ async def put_model(
if pretty is not None:
__query["pretty"] = pretty
__body = model_config if model_config is not None else body
if not __body:
__body = None
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"PUT",
__path,
Expand Down
39 changes: 34 additions & 5 deletions elasticsearch/_async/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -2343,12 +2343,22 @@ async def put_user(
)

@_rewrite_parameters(
body_fields=("from_", "query", "search_after", "size", "sort"),
body_fields=(
"aggregations",
"aggs",
"from_",
"query",
"search_after",
"size",
"sort",
),
parameter_aliases={"from": "from_"},
)
async def query_api_keys(
self,
*,
aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
from_: t.Optional[int] = None,
Expand All @@ -2373,13 +2383,28 @@ async def query_api_keys(

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

:param aggregations: Any aggregations to run over the corpus of returned API
keys. Aggregations and queries work together. Aggregations are computed only
on the API keys that match the query. This supports only a subset of aggregation
types, namely: `terms`, `range`, `date_range`, `missing`, `cardinality`,
`value_count`, `composite`, `filter`, and `filters`. Additionally, aggregations
only run over the same subset of fields that query works with.
:param aggs: Any aggregations to run over the corpus of returned API keys. Aggregations
and queries work together. Aggregations are computed only on the API keys
that match the query. This supports only a subset of aggregation types, namely:
`terms`, `range`, `date_range`, `missing`, `cardinality`, `value_count`,
`composite`, `filter`, and `filters`. Additionally, aggregations only run
over the same subset of fields that query works with.
:param from_: Starting document offset. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the `search_after` parameter.
:param query: A query to filter which API keys to return. The query supports
a subset of query types, including `match_all`, `bool`, `term`, `terms`,
`ids`, `prefix`, `wildcard`, and `range`. You can query all public information
associated with an API key.
:param query: A query to filter which API keys to return. If the query parameter
is missing, it is equivalent to a `match_all` query. The query supports a
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
You can query the following public information associated with an API key:
`id`, `type`, `name`, `creation`, `expiration`, `invalidated`, `invalidation`,
`username`, `realm`, and `metadata`.
:param search_after: Search after definition
:param size: The number of hits to return. By default, you cannot page through
more than 10,000 hits using the `from` and `size` parameters. To page through
Expand Down Expand Up @@ -2417,6 +2442,10 @@ async def query_api_keys(
if with_limited_by is not None:
__query["with_limited_by"] = with_limited_by
if not __body:
if aggregations is not None:
__body["aggregations"] = aggregations
if aggs is not None:
__body["aggs"] = aggs
if from_ is not None:
__body["from"] = from_
if query is not None:
Expand Down
12 changes: 4 additions & 8 deletions elasticsearch/_sync/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ def put_model(
self,
*,
inference_id: str,
model_config: t.Optional[t.Mapping[str, t.Any]] = None,
body: t.Optional[t.Mapping[str, t.Any]] = None,
task_type: t.Optional[
t.Union["t.Literal['sparse_embedding', 'text_embedding']", str]
] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
model_config: t.Optional[t.Mapping[str, t.Any]] = None,
body: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -230,8 +230,8 @@ def put_model(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html>`_

:param inference_id: The inference Id
:param task_type: The task type
:param model_config:
:param task_type: The task type
"""
if inference_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'inference_id'")
Expand Down Expand Up @@ -263,11 +263,7 @@ def put_model(
if pretty is not None:
__query["pretty"] = pretty
__body = model_config if model_config is not None else body
if not __body:
__body = None
__headers = {"accept": "application/json"}
if __body is not None:
__headers["content-type"] = "application/json"
__headers = {"accept": "application/json", "content-type": "application/json"}
return self.perform_request( # type: ignore[return-value]
"PUT",
__path,
Expand Down
39 changes: 34 additions & 5 deletions elasticsearch/_sync/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -2343,12 +2343,22 @@ def put_user(
)

@_rewrite_parameters(
body_fields=("from_", "query", "search_after", "size", "sort"),
body_fields=(
"aggregations",
"aggs",
"from_",
"query",
"search_after",
"size",
"sort",
),
parameter_aliases={"from": "from_"},
)
def query_api_keys(
self,
*,
aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
from_: t.Optional[int] = None,
Expand All @@ -2373,13 +2383,28 @@ def query_api_keys(

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

:param aggregations: Any aggregations to run over the corpus of returned API
keys. Aggregations and queries work together. Aggregations are computed only
on the API keys that match the query. This supports only a subset of aggregation
types, namely: `terms`, `range`, `date_range`, `missing`, `cardinality`,
`value_count`, `composite`, `filter`, and `filters`. Additionally, aggregations
only run over the same subset of fields that query works with.
:param aggs: Any aggregations to run over the corpus of returned API keys. Aggregations
and queries work together. Aggregations are computed only on the API keys
that match the query. This supports only a subset of aggregation types, namely:
`terms`, `range`, `date_range`, `missing`, `cardinality`, `value_count`,
`composite`, `filter`, and `filters`. Additionally, aggregations only run
over the same subset of fields that query works with.
:param from_: Starting document offset. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the `search_after` parameter.
:param query: A query to filter which API keys to return. The query supports
a subset of query types, including `match_all`, `bool`, `term`, `terms`,
`ids`, `prefix`, `wildcard`, and `range`. You can query all public information
associated with an API key.
:param query: A query to filter which API keys to return. If the query parameter
is missing, it is equivalent to a `match_all` query. The query supports a
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
You can query the following public information associated with an API key:
`id`, `type`, `name`, `creation`, `expiration`, `invalidated`, `invalidation`,
`username`, `realm`, and `metadata`.
:param search_after: Search after definition
:param size: The number of hits to return. By default, you cannot page through
more than 10,000 hits using the `from` and `size` parameters. To page through
Expand Down Expand Up @@ -2417,6 +2442,10 @@ def query_api_keys(
if with_limited_by is not None:
__query["with_limited_by"] = with_limited_by
if not __body:
if aggregations is not None:
__body["aggregations"] = aggregations
if aggs is not None:
__body["aggs"] = aggs
if from_ is not None:
__body["from"] = from_
if query is not None:
Expand Down