Skip to content

Commit

Permalink
Auto-generated code for main (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored Dec 10, 2024
1 parent d71dc40 commit b25b16f
Show file tree
Hide file tree
Showing 26 changed files with 186 additions and 158 deletions.
9 changes: 8 additions & 1 deletion elasticsearch_serverless/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ async def count(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns number of documents matching a query.
Count search results. Get the number of documents matching a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html>`_
Expand Down Expand Up @@ -2624,6 +2624,7 @@ async def open_point_in_time(
*,
index: t.Union[str, t.Sequence[str]],
keep_alive: t.Union[str, t.Literal[-1], t.Literal[0]],
allow_partial_search_results: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
expand_wildcards: t.Optional[
t.Union[
Expand Down Expand Up @@ -2658,6 +2659,10 @@ async def open_point_in_time(
:param index: A comma-separated list of index names to open point in time; use
`_all` or empty string to perform the operation on all indices
:param keep_alive: Extends the time to live of the corresponding point in time.
:param allow_partial_search_results: If `false`, creating a point in time request
when a shard is missing or unavailable will throw an exception. If `true`,
the point in time will contain all the shards that are available at the time
of the request.
:param expand_wildcards: Type of index that wildcard patterns can match. If the
request can target data streams, this argument determines whether wildcard
expressions match hidden data streams. Supports comma-separated values, such
Expand All @@ -2680,6 +2685,8 @@ async def open_point_in_time(
__body: t.Dict[str, t.Any] = body if body is not None else {}
if keep_alive is not None:
__query["keep_alive"] = keep_alive
if allow_partial_search_results is not None:
__query["allow_partial_search_results"] = allow_partial_search_results
if error_trace is not None:
__query["error_trace"] = error_trace
if expand_wildcards is not None:
Expand Down
26 changes: 8 additions & 18 deletions elasticsearch_serverless/_async/client/async_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ async def status(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -156,6 +157,9 @@ async def status(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
:param id: A unique identifier for the async search.
:param keep_alive: Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this
period.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
Expand All @@ -168,6 +172,8 @@ async def status(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if keep_alive is not None:
__query["keep_alive"] = keep_alive
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down Expand Up @@ -258,7 +264,6 @@ async def submit(
ignore_throttled: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
keep_on_completion: t.Optional[bool] = None,
knn: t.Optional[
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
Expand All @@ -268,7 +273,6 @@ async def submit(
min_score: t.Optional[float] = None,
pit: t.Optional[t.Mapping[str, t.Any]] = None,
post_filter: t.Optional[t.Mapping[str, t.Any]] = None,
pre_filter_shard_size: t.Optional[int] = None,
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
profile: t.Optional[bool] = None,
Expand All @@ -282,7 +286,6 @@ async def submit(
routing: t.Optional[str] = None,
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
search_after: t.Optional[
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
] = None,
Expand Down Expand Up @@ -375,9 +378,6 @@ async def submit(
:param ignore_unavailable: Whether specified concrete indices should be ignored
when unavailable (missing or closed)
:param indices_boost: Boosts the _score of documents from specified indices.
:param keep_alive: Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this
period.
:param keep_on_completion: If `true`, results are stored for later retrieval
when the search completes within the `wait_for_completion_timeout`.
:param knn: Defines the approximate kNN search to run.
Expand All @@ -392,10 +392,6 @@ async def submit(
:param pit: Limits the search to a point in time (PIT). If you provide a PIT,
you cannot specify an <index> in the request path.
:param post_filter:
:param pre_filter_shard_size: The default value cannot be changed, which enforces
the execution of a pre-filter roundtrip to retrieve statistics from each
shard so that the ones that surely don’t hold any document matching the query
get skipped.
:param preference: Specify the node or shard the operation should be performed
on (default: random)
:param profile:
Expand All @@ -404,13 +400,13 @@ async def submit(
:param request_cache: Specify if request cache should be used for this request
or not, defaults to true
:param rescore:
:param rest_total_hits_as_int:
:param rest_total_hits_as_int: Indicates whether hits.total should be rendered
as an integer or an object in the rest search response
:param routing: A comma-separated list of specific routing values
:param runtime_mappings: Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
:param script_fields: Retrieve a script evaluation (based on different fields)
for each hit.
:param scroll:
:param search_after:
:param search_type: Search operation type
:param seq_no_primary_term: If true, returns sequence number and primary term
Expand Down Expand Up @@ -507,16 +503,12 @@ async def submit(
__query["ignore_throttled"] = ignore_throttled
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if keep_alive is not None:
__query["keep_alive"] = keep_alive
if keep_on_completion is not None:
__query["keep_on_completion"] = keep_on_completion
if lenient is not None:
__query["lenient"] = lenient
if max_concurrent_shard_requests is not None:
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
if pre_filter_shard_size is not None:
__query["pre_filter_shard_size"] = pre_filter_shard_size
if preference is not None:
__query["preference"] = preference
if pretty is not None:
Expand All @@ -529,8 +521,6 @@ async def submit(
__query["rest_total_hits_as_int"] = rest_total_hits_as_int
if routing is not None:
__query["routing"] = routing
if scroll is not None:
__query["scroll"] = scroll
if search_type is not None:
__query["search_type"] = search_type
if source_excludes is not None:
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch_serverless/_async/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ async def transforms(
v: t.Optional[bool] = None,
) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
"""
Get transforms. Returns configuration and usage information about transforms.
Get transform information. Get configuration and usage information about transforms.
CAT APIs are only intended for human consumption using the Kibana console or
command line. They are not intended for use by applications. For application
consumption, use the get transform statistics API.
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch_serverless/_async/client/enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def execute_policy(
wait_for_completion: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Creates the enrich index for an existing enrich policy.
Run an enrich policy. Create the enrich index for an existing enrich policy.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/execute-enrich-policy-api.html>`_
Expand Down
16 changes: 9 additions & 7 deletions elasticsearch_serverless/_async/client/eql.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async def delete(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Deletes an async EQL search or a stored synchronous EQL search. The API also
deletes results for the search.
Delete an async EQL search. Delete an async EQL search or a stored synchronous
EQL search. The API also deletes results for the search.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
Expand Down Expand Up @@ -83,8 +83,8 @@ async def get(
] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns the current status and available results for an async EQL search or a
stored synchronous EQL search.
Get async EQL search results. Get the current status and available results for
an async EQL search or a stored synchronous EQL search.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html>`_
Expand Down Expand Up @@ -134,8 +134,8 @@ async def get_status(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns the current status for an async EQL search or a stored synchronous EQL
search without returning results.
Get the async EQL status. Get the current status for an async EQL search or a
stored synchronous EQL search without returning results.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html>`_
Expand Down Expand Up @@ -225,7 +225,9 @@ async def search(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns results matching a query expressed in Event Query Language (EQL)
Get EQL search results. Returns search results for an Event Query Language (EQL)
query. EQL assumes each document in a data stream or index corresponds to an
event.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
Expand Down
3 changes: 2 additions & 1 deletion elasticsearch_serverless/_async/client/esql.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ async def query(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Executes an ES|QL request
Run an ES|QL query. Get search results for an ES|QL (Elasticsearch query language)
query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html>`_
Expand Down
10 changes: 8 additions & 2 deletions elasticsearch_serverless/_async/client/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ async def explore(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Extracts and summarizes information about the documents and terms in an Elasticsearch
data stream or index.
Explore graph analytics. Extract and summarize information about the documents
and terms in an Elasticsearch data stream or index. The easiest way to understand
the behavior of this API is to use the Graph UI to explore connections. An initial
request to the `_explore` API contains a seed query that identifies the documents
of interest and specifies the fields that define the vertices and connections
you want to include in the graph. Subsequent requests enable you to spider out
from one more vertices of interest. You can exclude vertices that have already
been returned.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html>`_
Expand Down
18 changes: 15 additions & 3 deletions elasticsearch_serverless/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ async def exists_alias(
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> HeadApiResponse:
"""
Expand All @@ -721,6 +722,9 @@ async def exists_alias(
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
:param ignore_unavailable: If `false`, requests that include a missing data stream
or index in the target indices or data streams return an error.
:param master_timeout: Period to wait for a connection to the master node. If
no response is received before the timeout expires, the request fails and
returns an error.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -746,6 +750,8 @@ async def exists_alias(
__query["human"] = human
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand All @@ -770,7 +776,7 @@ async def exists_index_template(
pretty: t.Optional[bool] = None,
) -> HeadApiResponse:
"""
Returns information about whether a particular index template exists.
Check index templates. Check whether index templates exist.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index-templates.html>`_
Expand Down Expand Up @@ -974,6 +980,7 @@ async def get_alias(
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -995,6 +1002,9 @@ async def get_alias(
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
:param ignore_unavailable: If `false`, the request returns an error if it targets
a missing or closed index.
:param master_timeout: Period to wait for a connection to the master node. If
no response is received before the timeout expires, the request fails and
returns an error.
"""
__path_parts: t.Dict[str, str]
if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
Expand Down Expand Up @@ -1022,6 +1032,8 @@ async def get_alias(
__query["human"] = human
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down Expand Up @@ -2208,8 +2220,8 @@ async def resolve_index(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Resolves the specified name(s) and/or index patterns for indices, aliases, and
data streams. Multiple patterns and remote clusters are supported.
Resolve indices. Resolve the names and/or index patterns for indices, aliases,
and data streams. Multiple patterns and remote clusters are supported.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html>`_
Expand Down
12 changes: 1 addition & 11 deletions elasticsearch_serverless/_async/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,12 @@
from elastic_transport import ObjectApiResponse

from ._base import NamespacedClient
from .utils import (
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
)
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters


class InferenceClient(NamespacedClient):

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def delete(
self,
*,
Expand Down Expand Up @@ -100,7 +93,6 @@ async def delete(
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def get(
self,
*,
Expand Down Expand Up @@ -159,7 +151,6 @@ async def get(
@_rewrite_parameters(
body_fields=("input", "query", "task_settings"),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def inference(
self,
*,
Expand Down Expand Up @@ -246,7 +237,6 @@ async def inference(
@_rewrite_parameters(
body_name="inference_config",
)
@_stability_warning(Stability.EXPERIMENTAL)
async def put(
self,
*,
Expand Down
Loading

0 comments on commit b25b16f

Please sign in to comment.