Skip to content

Auto-generated code for main #2555

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 2 commits into from
May 23, 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
7 changes: 7 additions & 0 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3638,6 +3638,7 @@ async def scroll(
"query",
"rank",
"rescore",
"retriever",
"runtime_mappings",
"script_fields",
"search_after",
Expand Down Expand Up @@ -3719,6 +3720,7 @@ async def search(
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
] = None,
rest_total_hits_as_int: t.Optional[bool] = None,
retriever: t.Optional[t.Mapping[str, t.Any]] = None,
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,
Expand Down Expand Up @@ -3878,6 +3880,9 @@ async def search(
example 100 - 500) documents returned by the `query` and `post_filter` phases.
: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 retriever: A retriever is a specification to describe top documents returned
from a search. A retriever replaces other elements of the search API that
also return top documents such as query and knn.
:param routing: Custom value used to route operations to a specific shard.
:param runtime_mappings: Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
Expand Down Expand Up @@ -4074,6 +4079,8 @@ async def search(
__body["rank"] = rank
if rescore is not None:
__body["rescore"] = rescore
if retriever is not None:
__body["retriever"] = retriever
if runtime_mappings is not None:
__body["runtime_mappings"] = runtime_mappings
if script_fields is not None:
Expand Down
4 changes: 0 additions & 4 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,6 @@ async def put_component_template(
*,
name: str,
template: t.Optional[t.Mapping[str, t.Any]] = None,
cause: t.Optional[str] = None,
create: t.Optional[bool] = None,
deprecated: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
Expand Down Expand Up @@ -699,7 +698,6 @@ async def put_component_template(
update settings API.
:param template: The template to be applied which includes mappings, settings,
or aliases configuration.
:param cause:
:param create: If `true`, this request cannot replace or update existing component
templates.
:param deprecated: Marks this index template as deprecated. When creating or
Expand All @@ -724,8 +722,6 @@ async def put_component_template(
__path = f'/_component_template/{__path_parts["name"]}'
__query: t.Dict[str, t.Any] = {}
__body: t.Dict[str, t.Any] = body if body is not None else {}
if cause is not None:
__query["cause"] = cause
if create is not None:
__query["create"] = create
if error_trace is not None:
Expand Down
9 changes: 1 addition & 8 deletions elasticsearch/_async/client/esql.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
class EsqlClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
body_fields=("query", "columnar", "filter", "locale", "params"),
ignore_deprecated_options={"params"},
)
async def query(
self,
*,
query: t.Optional[str] = None,
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
columnar: t.Optional[bool] = None,
delimiter: t.Optional[str] = None,
error_trace: t.Optional[bool] = None,
Expand All @@ -53,8 +52,6 @@ async def query(

:param query: The ES|QL query API accepts an ES|QL query string in the query
parameter, runs it, and returns the results.
:param version: The version of the ES|QL language in which the "query" field
was written.
:param columnar: By default, ES|QL returns results as rows. For example, FROM
returns each individual document as one row. For the JSON, YAML, CBOR and
smile formats, ES|QL can return the results in a columnar fashion where one
Expand All @@ -71,8 +68,6 @@ async def query(
"""
if query is None and body is None:
raise ValueError("Empty value passed for parameter 'query'")
if version is None and body is None:
raise ValueError("Empty value passed for parameter 'version'")
__path_parts: t.Dict[str, str] = {}
__path = "/_query"
__query: t.Dict[str, t.Any] = {}
Expand All @@ -92,8 +87,6 @@ async def query(
if not __body:
if query is not None:
__body["query"] = query
if version is not None:
__body["version"] = version
if columnar is not None:
__body["columnar"] = columnar
if filter is not None:
Expand Down
7 changes: 7 additions & 0 deletions elasticsearch/_sync/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3636,6 +3636,7 @@ def scroll(
"query",
"rank",
"rescore",
"retriever",
"runtime_mappings",
"script_fields",
"search_after",
Expand Down Expand Up @@ -3717,6 +3718,7 @@ def search(
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
] = None,
rest_total_hits_as_int: t.Optional[bool] = None,
retriever: t.Optional[t.Mapping[str, t.Any]] = None,
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,
Expand Down Expand Up @@ -3876,6 +3878,9 @@ def search(
example 100 - 500) documents returned by the `query` and `post_filter` phases.
: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 retriever: A retriever is a specification to describe top documents returned
from a search. A retriever replaces other elements of the search API that
also return top documents such as query and knn.
:param routing: Custom value used to route operations to a specific shard.
:param runtime_mappings: Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
Expand Down Expand Up @@ -4072,6 +4077,8 @@ def search(
__body["rank"] = rank
if rescore is not None:
__body["rescore"] = rescore
if retriever is not None:
__body["retriever"] = retriever
if runtime_mappings is not None:
__body["runtime_mappings"] = runtime_mappings
if script_fields is not None:
Expand Down
4 changes: 0 additions & 4 deletions elasticsearch/_sync/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,6 @@ def put_component_template(
*,
name: str,
template: t.Optional[t.Mapping[str, t.Any]] = None,
cause: t.Optional[str] = None,
create: t.Optional[bool] = None,
deprecated: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
Expand Down Expand Up @@ -699,7 +698,6 @@ def put_component_template(
update settings API.
:param template: The template to be applied which includes mappings, settings,
or aliases configuration.
:param cause:
:param create: If `true`, this request cannot replace or update existing component
templates.
:param deprecated: Marks this index template as deprecated. When creating or
Expand All @@ -724,8 +722,6 @@ def put_component_template(
__path = f'/_component_template/{__path_parts["name"]}'
__query: t.Dict[str, t.Any] = {}
__body: t.Dict[str, t.Any] = body if body is not None else {}
if cause is not None:
__query["cause"] = cause
if create is not None:
__query["create"] = create
if error_trace is not None:
Expand Down
9 changes: 1 addition & 8 deletions elasticsearch/_sync/client/esql.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
class EsqlClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
body_fields=("query", "columnar", "filter", "locale", "params"),
ignore_deprecated_options={"params"},
)
def query(
self,
*,
query: t.Optional[str] = None,
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
columnar: t.Optional[bool] = None,
delimiter: t.Optional[str] = None,
error_trace: t.Optional[bool] = None,
Expand All @@ -53,8 +52,6 @@ def query(

:param query: The ES|QL query API accepts an ES|QL query string in the query
parameter, runs it, and returns the results.
:param version: The version of the ES|QL language in which the "query" field
was written.
:param columnar: By default, ES|QL returns results as rows. For example, FROM
returns each individual document as one row. For the JSON, YAML, CBOR and
smile formats, ES|QL can return the results in a columnar fashion where one
Expand All @@ -71,8 +68,6 @@ def query(
"""
if query is None and body is None:
raise ValueError("Empty value passed for parameter 'query'")
if version is None and body is None:
raise ValueError("Empty value passed for parameter 'version'")
__path_parts: t.Dict[str, str] = {}
__path = "/_query"
__query: t.Dict[str, t.Any] = {}
Expand All @@ -92,8 +87,6 @@ def query(
if not __body:
if query is not None:
__body["query"] = query
if version is not None:
__body["version"] = version
if columnar is not None:
__body["columnar"] = columnar
if filter is not None:
Expand Down
Loading