Skip to content

Commit 2d2bca3

Browse files
Auto-generated API code
1 parent 784674f commit 2d2bca3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

elasticsearch/_async/client/esql.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
class EsqlClient(NamespacedClient):
2727

2828
@_rewrite_parameters(
29-
body_fields=("query", "columnar", "filter", "locale", "params"),
29+
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
3030
ignore_deprecated_options={"params"},
3131
)
3232
async def query(
3333
self,
3434
*,
3535
query: t.Optional[str] = None,
36+
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
3637
columnar: t.Optional[bool] = None,
3738
delimiter: t.Optional[str] = None,
3839
error_trace: t.Optional[bool] = None,
@@ -52,6 +53,8 @@ async def query(
5253
5354
:param query: The ES|QL query API accepts an ES|QL query string in the query
5455
parameter, runs it, and returns the results.
56+
:param version: The version of the ES|QL language in which the "query" field
57+
was written.
5558
:param columnar: By default, ES|QL returns results as rows. For example, FROM
5659
returns each individual document as one row. For the JSON, YAML, CBOR and
5760
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -68,6 +71,8 @@ async def query(
6871
"""
6972
if query is None and body is None:
7073
raise ValueError("Empty value passed for parameter 'query'")
74+
if version is None and body is None:
75+
raise ValueError("Empty value passed for parameter 'version'")
7176
__path_parts: t.Dict[str, str] = {}
7277
__path = "/_query"
7378
__query: t.Dict[str, t.Any] = {}
@@ -87,6 +92,8 @@ async def query(
8792
if not __body:
8893
if query is not None:
8994
__body["query"] = query
95+
if version is not None:
96+
__body["version"] = version
9097
if columnar is not None:
9198
__body["columnar"] = columnar
9299
if filter is not None:

elasticsearch/_sync/client/esql.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
class EsqlClient(NamespacedClient):
2727

2828
@_rewrite_parameters(
29-
body_fields=("query", "columnar", "filter", "locale", "params"),
29+
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
3030
ignore_deprecated_options={"params"},
3131
)
3232
def query(
3333
self,
3434
*,
3535
query: t.Optional[str] = None,
36+
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
3637
columnar: t.Optional[bool] = None,
3738
delimiter: t.Optional[str] = None,
3839
error_trace: t.Optional[bool] = None,
@@ -52,6 +53,8 @@ def query(
5253
5354
:param query: The ES|QL query API accepts an ES|QL query string in the query
5455
parameter, runs it, and returns the results.
56+
:param version: The version of the ES|QL language in which the "query" field
57+
was written.
5558
:param columnar: By default, ES|QL returns results as rows. For example, FROM
5659
returns each individual document as one row. For the JSON, YAML, CBOR and
5760
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -68,6 +71,8 @@ def query(
6871
"""
6972
if query is None and body is None:
7073
raise ValueError("Empty value passed for parameter 'query'")
74+
if version is None and body is None:
75+
raise ValueError("Empty value passed for parameter 'version'")
7176
__path_parts: t.Dict[str, str] = {}
7277
__path = "/_query"
7378
__query: t.Dict[str, t.Any] = {}
@@ -87,6 +92,8 @@ def query(
8792
if not __body:
8893
if query is not None:
8994
__body["query"] = query
95+
if version is not None:
96+
__body["version"] = version
9097
if columnar is not None:
9198
__body["columnar"] = columnar
9299
if filter is not None:

0 commit comments

Comments
 (0)