Skip to content

Commit

Permalink
Auto-generated code for 8.15 (#2642)
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
  • Loading branch information
elasticmachine and pquentin authored Sep 6, 2024
1 parent c78b236 commit afc777c
Show file tree
Hide file tree
Showing 8 changed files with 390 additions and 2 deletions.
4 changes: 4 additions & 0 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4980,6 +4980,7 @@ async def update_by_query(
pipeline: t.Optional[str] = None,
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
q: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
refresh: t.Optional[bool] = None,
request_cache: t.Optional[bool] = None,
Expand Down Expand Up @@ -5046,6 +5047,7 @@ async def update_by_query(
parameter.
:param preference: Specifies the node or shard the operation should be performed
on. Random by default.
:param q: Query in the Lucene query string syntax.
:param query: Specifies the documents to update using the Query DSL.
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
operation visible to search.
Expand Down Expand Up @@ -5130,6 +5132,8 @@ async def update_by_query(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if q is not None:
__query["q"] = q
if refresh is not None:
__query["refresh"] = refresh
if request_cache is not None:
Expand Down
13 changes: 13 additions & 0 deletions elasticsearch/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -3614,6 +3614,7 @@ async def resolve_index(
self,
*,
name: t.Union[str, t.Sequence[str]],
allow_no_indices: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
expand_wildcards: t.Optional[
t.Union[
Expand All @@ -3625,6 +3626,7 @@ async def resolve_index(
] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -3636,16 +3638,25 @@ async def resolve_index(
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
and data streams to resolve. Resources on remote clusters can be specified
using the `<cluster>`:`<name>` syntax.
:param allow_no_indices: If `false`, the request returns an error if any wildcard
expression, index alias, or `_all` value targets only missing or closed indices.
This behavior applies even if the request targets other open indices. For
example, a request targeting `foo*,bar*` returns an error if an index starts
with `foo` but no index starts with `bar`.
: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
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.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
__path = f'/_resolve/index/{__path_parts["name"]}'
__query: t.Dict[str, t.Any] = {}
if allow_no_indices is not None:
__query["allow_no_indices"] = allow_no_indices
if error_trace is not None:
__query["error_trace"] = error_trace
if expand_wildcards is not None:
Expand All @@ -3654,6 +3665,8 @@ async def resolve_index(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down
175 changes: 175 additions & 0 deletions elasticsearch/_async/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,57 @@

class IngestClient(NamespacedClient):

@_rewrite_parameters()
async def delete_geoip_database(
self,
*,
id: t.Union[str, t.Sequence[str]],
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Deletes a geoip database configuration.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/TODO.html>`_
:param id: A comma-separated list of geoip database configurations to delete
: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.
:param timeout: Period to wait for a response. If no response is received before
the timeout expires, the request fails and returns an error.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
__query: t.Dict[str, t.Any] = {}
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
if timeout is not None:
__query["timeout"] = timeout
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"DELETE",
__path,
params=__query,
headers=__headers,
endpoint_id="ingest.delete_geoip_database",
path_parts=__path_parts,
)

@_rewrite_parameters()
async def delete_pipeline(
self,
Expand Down Expand Up @@ -112,6 +163,57 @@ async def geo_ip_stats(
path_parts=__path_parts,
)

@_rewrite_parameters()
async def get_geoip_database(
self,
*,
id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: 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]:
"""
Returns information about one or more geoip database configurations.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/TODO.html>`_
:param id: Comma-separated list of database configuration IDs to retrieve. Wildcard
(`*`) expressions are supported. To get all database configurations, omit
this parameter or use `*`.
: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 id not in SKIP_IN_PATH:
__path_parts = {"id": _quote(id)}
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
else:
__path_parts = {}
__path = "/_ingest/geoip/database"
__query: t.Dict[str, t.Any] = {}
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"GET",
__path,
params=__query,
headers=__headers,
endpoint_id="ingest.get_geoip_database",
path_parts=__path_parts,
)

@_rewrite_parameters()
async def get_pipeline(
self,
Expand Down Expand Up @@ -205,6 +307,79 @@ async def processor_grok(
path_parts=__path_parts,
)

@_rewrite_parameters(
body_fields=("maxmind", "name"),
)
async def put_geoip_database(
self,
*,
id: str,
maxmind: t.Optional[t.Mapping[str, t.Any]] = None,
name: t.Optional[str] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns information about one or more geoip database configurations.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/TODO.html>`_
:param id: ID of the database configuration to create or update.
:param maxmind: The configuration necessary to identify which IP geolocation
provider to use to download the database, as well as any provider-specific
configuration necessary for such downloading. At present, the only supported
provider is maxmind, and the maxmind provider requires that an account_id
(string) is configured.
:param name: The provider-assigned name of the IP geolocation database to download.
: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.
:param timeout: Period to wait for a response. If no response is received before
the timeout expires, the request fails and returns an error.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
if maxmind is None and body is None:
raise ValueError("Empty value passed for parameter 'maxmind'")
if name is None and body is None:
raise ValueError("Empty value passed for parameter 'name'")
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
__query: t.Dict[str, t.Any] = {}
__body: t.Dict[str, t.Any] = body if body is not None else {}
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
if timeout is not None:
__query["timeout"] = timeout
if not __body:
if maxmind is not None:
__body["maxmind"] = maxmind
if name is not None:
__body["name"] = name
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"PUT",
__path,
params=__query,
headers=__headers,
body=__body,
endpoint_id="ingest.put_geoip_database",
path_parts=__path_parts,
)

@_rewrite_parameters(
body_fields=("description", "meta", "on_failure", "processors", "version"),
parameter_aliases={"_meta": "meta"},
Expand Down
4 changes: 3 additions & 1 deletion elasticsearch/_async/client/synonyms.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ async def put_synonym(
self,
*,
id: str,
synonyms_set: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
synonyms_set: t.Optional[
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
Expand Down
4 changes: 4 additions & 0 deletions elasticsearch/_sync/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4978,6 +4978,7 @@ def update_by_query(
pipeline: t.Optional[str] = None,
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
q: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
refresh: t.Optional[bool] = None,
request_cache: t.Optional[bool] = None,
Expand Down Expand Up @@ -5044,6 +5045,7 @@ def update_by_query(
parameter.
:param preference: Specifies the node or shard the operation should be performed
on. Random by default.
:param q: Query in the Lucene query string syntax.
:param query: Specifies the documents to update using the Query DSL.
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
operation visible to search.
Expand Down Expand Up @@ -5128,6 +5130,8 @@ def update_by_query(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if q is not None:
__query["q"] = q
if refresh is not None:
__query["refresh"] = refresh
if request_cache is not None:
Expand Down
13 changes: 13 additions & 0 deletions elasticsearch/_sync/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -3614,6 +3614,7 @@ def resolve_index(
self,
*,
name: t.Union[str, t.Sequence[str]],
allow_no_indices: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
expand_wildcards: t.Optional[
t.Union[
Expand All @@ -3625,6 +3626,7 @@ def resolve_index(
] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -3636,16 +3638,25 @@ def resolve_index(
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
and data streams to resolve. Resources on remote clusters can be specified
using the `<cluster>`:`<name>` syntax.
:param allow_no_indices: If `false`, the request returns an error if any wildcard
expression, index alias, or `_all` value targets only missing or closed indices.
This behavior applies even if the request targets other open indices. For
example, a request targeting `foo*,bar*` returns an error if an index starts
with `foo` but no index starts with `bar`.
: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
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.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
__path = f'/_resolve/index/{__path_parts["name"]}'
__query: t.Dict[str, t.Any] = {}
if allow_no_indices is not None:
__query["allow_no_indices"] = allow_no_indices
if error_trace is not None:
__query["error_trace"] = error_trace
if expand_wildcards is not None:
Expand All @@ -3654,6 +3665,8 @@ def resolve_index(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down
Loading

0 comments on commit afc777c

Please sign in to comment.