diff --git a/docs/sphinx/api.rst b/docs/sphinx/api.rst index 77895da..56c5bc6 100644 --- a/docs/sphinx/api.rst +++ b/docs/sphinx/api.rst @@ -66,6 +66,12 @@ Indices .. autoclass:: IndicesClient :members: +Inference +--------- + +.. autoclass:: InferenceClient + :members: + Ingest Pipelines ---------------- diff --git a/elasticsearch_serverless/_async/client/__init__.py b/elasticsearch_serverless/_async/client/__init__.py index aec5b40..2cda8a9 100644 --- a/elasticsearch_serverless/_async/client/__init__.py +++ b/elasticsearch_serverless/_async/client/__init__.py @@ -41,6 +41,7 @@ from .eql import EqlClient from .graph import GraphClient from .indices import IndicesClient +from .inference import InferenceClient from .ingest import IngestClient from .license import LicenseClient from .logstash import LogstashClient @@ -279,6 +280,7 @@ def __init__( self.cat = CatClient(self) self.cluster = ClusterClient(self) self.indices = IndicesClient(self) + self.inference = InferenceClient(self) self.ingest = IngestClient(self) self.tasks = TasksClient(self) @@ -442,14 +444,10 @@ async def ping( async def bulk( self, *, - operations: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + operations: t.Sequence[t.Mapping[str, t.Any]], index: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pipeline: t.Optional[str] = None, pretty: t.Optional[bool] = None, @@ -458,15 +456,9 @@ async def bulk( ] = None, require_alias: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, wait_for_active_shards: t.Optional[ t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]] @@ -552,14 +544,10 @@ async def clear_scroll( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, - scroll_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + scroll_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, ) -> ObjectApiResponse[t.Any]: """ Explicitly clears the search context for a scroll. @@ -598,9 +586,7 @@ async def close_point_in_time( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -641,7 +627,7 @@ async def close_point_in_time( async def count( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, analyzer: t.Optional[str] = None, @@ -650,25 +636,13 @@ async def count( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -786,9 +760,7 @@ async def create( id: str, document: t.Mapping[str, t.Any], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pipeline: t.Optional[str] = None, pretty: t.Optional[bool] = None, @@ -881,9 +853,7 @@ async def delete( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_primary_term: t.Optional[int] = None, if_seq_no: t.Optional[int] = None, @@ -968,7 +938,7 @@ async def delete( async def delete_by_query( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, analyzer: t.Optional[str] = None, @@ -978,25 +948,13 @@ async def delete_by_query( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -1020,8 +978,8 @@ async def delete_by_query( ] = None, slice: t.Optional[t.Mapping[str, t.Any]] = None, slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None, - sort: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + sort: t.Optional[t.Sequence[str]] = None, + stats: t.Optional[t.Sequence[str]] = None, terminate_after: t.Optional[int] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, version: t.Optional[bool] = None, @@ -1195,9 +1153,7 @@ async def delete_script( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -1251,27 +1207,17 @@ async def exists( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1357,24 +1303,16 @@ async def exists_source( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1460,9 +1398,7 @@ async def explain( default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None, df: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, lenient: t.Optional[bool] = None, preference: t.Optional[str] = None, @@ -1470,18 +1406,10 @@ async def explain( q: t.Optional[str] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, ) -> ObjectApiResponse[t.Any]: """ Returns information about why a specific matches (or doesn't match) a query. @@ -1570,41 +1498,28 @@ async def explain( async def field_caps( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, filters: t.Optional[str] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, + include_empty_fields: t.Optional[bool] = None, include_unmapped: t.Optional[bool] = None, index_filter: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, - types: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + types: t.Optional[t.Sequence[str]] = None, ) -> ObjectApiResponse[t.Any]: """ Returns the information about the capabilities of fields among multiple indices. @@ -1628,6 +1543,7 @@ async def field_caps( :param filters: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. + :param include_empty_fields: If false, empty fields are not included in the response. :param include_unmapped: If true, unmapped fields are included in the response. :param index_filter: Allows to filter indices if the provided query rewrites to match_none on every shard. @@ -1660,6 +1576,8 @@ async def field_caps( __query["human"] = human if ignore_unavailable is not None: __query["ignore_unavailable"] = ignore_unavailable + if include_empty_fields is not None: + __query["include_empty_fields"] = include_empty_fields if include_unmapped is not None: __query["include_unmapped"] = include_unmapped if index_filter is not None: @@ -1692,27 +1610,18 @@ async def get( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + force_synthetic_source: t.Optional[bool] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1725,6 +1634,10 @@ async def get( :param index: Name of the index that contains the document. :param id: Unique identifier of the document. + :param force_synthetic_source: Should this request force synthetic _source? Use + this to test if the mapping supports synthetic _source and to get a sense + of the worst case performance. Fetches with this enabled will be slower the + enabling synthetic source natively in the index. :param preference: Specifies the node or shard the operation should be performed on. Random by default. :param realtime: If `true`, the request is real-time as opposed to near-real-time. @@ -1755,6 +1668,8 @@ async def get( __query["error_trace"] = error_trace if filter_path is not None: __query["filter_path"] = filter_path + if force_synthetic_source is not None: + __query["force_synthetic_source"] = force_synthetic_source if human is not None: __query["human"] = human if preference is not None: @@ -1790,9 +1705,7 @@ async def get_script( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -1839,27 +1752,17 @@ async def get_source( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1939,9 +1842,7 @@ async def index( document: t.Mapping[str, t.Any], id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_primary_term: t.Optional[int] = None, if_seq_no: t.Optional[int] = None, @@ -2054,9 +1955,7 @@ async def info( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -2092,32 +1991,21 @@ async def mget( self, *, index: t.Optional[str] = None, - docs: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + force_synthetic_source: t.Optional[bool] = None, human: t.Optional[bool] = None, - ids: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + ids: t.Optional[t.Union[str, t.Sequence[str]]] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, ) -> ObjectApiResponse[t.Any]: """ Allows to get multiple documents in one request. @@ -2128,6 +2016,10 @@ async def mget( or when a document in the `docs` array does not specify an index. :param docs: The documents you want to retrieve. Required if no index is specified in the request URI. + :param force_synthetic_source: Should this request force synthetic _source? Use + this to test if the mapping supports synthetic _source and to get a sense + of the worst case performance. Fetches with this enabled will be slower the + enabling synthetic source natively in the index. :param ids: The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI. :param preference: Specifies the node or shard the operation should be performed @@ -2161,6 +2053,8 @@ async def mget( __query["error_trace"] = error_trace if filter_path is not None: __query["filter_path"] = filter_path + if force_synthetic_source is not None: + __query["force_synthetic_source"] = force_synthetic_source if human is not None: __query["human"] = human if ids is not None: @@ -2194,34 +2088,20 @@ async def mget( async def msearch( self, *, - searches: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + searches: t.Sequence[t.Mapping[str, t.Any]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, ccs_minimize_roundtrips: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -2331,15 +2211,11 @@ async def msearch( async def msearch_template( self, *, - search_templates: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + search_templates: t.Sequence[t.Mapping[str, t.Any]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, ccs_minimize_roundtrips: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_concurrent_searches: t.Optional[int] = None, pretty: t.Optional[bool] = None, @@ -2410,19 +2286,13 @@ async def mtermvectors( self, *, index: t.Optional[str] = None, - docs: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, field_statistics: t.Optional[bool] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - ids: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + ids: t.Optional[t.Sequence[str]] = None, offsets: t.Optional[bool] = None, payloads: t.Optional[bool] = None, positions: t.Optional[bool] = None, @@ -2515,30 +2385,18 @@ async def mtermvectors( async def open_point_in_time( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], keep_alive: t.Union["t.Literal[-1]", "t.Literal[0]", str], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, preference: t.Optional[str] = None, @@ -2602,9 +2460,7 @@ async def put_script( script: t.Mapping[str, t.Any], context: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -2667,33 +2523,19 @@ async def put_script( async def rank_eval( self, *, - requests: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + requests: t.Sequence[t.Mapping[str, t.Any]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, metric: t.Optional[t.Mapping[str, t.Any]] = None, @@ -2767,9 +2609,7 @@ async def reindex( source: t.Mapping[str, t.Any], conflicts: t.Optional[t.Union["t.Literal['abort', 'proceed']", str]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_docs: t.Optional[int] = None, pretty: t.Optional[bool] = None, @@ -2875,9 +2715,7 @@ async def render_search_template( id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, file: t.Optional[str] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, params: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -2935,9 +2773,7 @@ async def scripts_painless_execute( context: t.Optional[str] = None, context_setup: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, script: t.Optional[t.Mapping[str, t.Any]] = None, @@ -2985,9 +2821,7 @@ async def scroll( *, scroll_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, rest_total_hits_as_int: t.Optional[bool] = None, @@ -3044,7 +2878,7 @@ async def scroll( async def search( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, allow_no_indices: t.Optional[bool] = None, @@ -3056,51 +2890,29 @@ async def search( collapse: t.Optional[t.Mapping[str, t.Any]] = None, default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None, df: t.Optional[str] = None, - docvalue_fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, ext: t.Optional[t.Mapping[str, t.Any]] = None, - fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + force_synthetic_source: t.Optional[bool] = None, from_: t.Optional[int] = None, highlight: t.Optional[t.Mapping[str, t.Any]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indices_boost: t.Optional[ - t.Union[t.List[t.Mapping[str, float]], t.Tuple[t.Mapping[str, float], ...]] - ] = None, + indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None, knn: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, lenient: t.Optional[bool] = None, max_concurrent_shard_requests: t.Optional[int] = None, @@ -3117,12 +2929,7 @@ async def search( rank: t.Optional[t.Mapping[str, t.Any]] = None, request_cache: t.Optional[bool] = None, rescore: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, rest_total_hits_as_int: t.Optional[bool] = None, routing: t.Optional[str] = None, @@ -3130,10 +2937,7 @@ async def search( script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, search_after: t.Optional[ - t.Union[ - t.List[t.Union[None, bool, float, int, str, t.Any]], - t.Tuple[t.Union[None, bool, float, int, str, t.Any], ...], - ] + t.Sequence[t.Union[None, bool, float, int, str, t.Any]] ] = None, search_type: t.Optional[ t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str] @@ -3143,24 +2947,15 @@ async def search( slice: t.Optional[t.Mapping[str, t.Any]] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stats: t.Optional[t.Sequence[str]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, suggest: t.Optional[t.Mapping[str, t.Any]] = None, suggest_field: t.Optional[str] = None, suggest_mode: t.Optional[ @@ -3225,6 +3020,10 @@ async def search( :param fields: Array of wildcard (`*`) patterns. The request returns values for field names matching these patterns in the `hits.fields` property of the response. + :param force_synthetic_source: Should this request force synthetic _source? Use + this to test if the mapping supports synthetic _source and to get a sense + of the worst case performance. Fetches with this enabled will be slower the + enabling synthetic source natively in the index. :param from_: Starting document offset. Needs to be non-negative. 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. @@ -3415,6 +3214,8 @@ async def search( __body["fields"] = fields if filter_path is not None: __query["filter_path"] = filter_path + if force_synthetic_source is not None: + __query["force_synthetic_source"] = force_synthetic_source if from_ is not None: __body["from"] = from_ if highlight is not None: @@ -3528,7 +3329,7 @@ async def search( async def search_mvt( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], field: str, zoom: int, x: int, @@ -3538,12 +3339,8 @@ async def search_mvt( error_trace: t.Optional[bool] = None, exact_bounds: t.Optional[bool] = None, extent: t.Optional[int] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, grid_agg: t.Optional[t.Union["t.Literal['geohex', 'geotile']", str]] = None, grid_precision: t.Optional[int] = None, grid_type: t.Optional[ @@ -3556,11 +3353,8 @@ async def search_mvt( size: t.Optional[int] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, track_total_hits: t.Optional[t.Union[bool, int]] = None, @@ -3691,32 +3485,20 @@ async def search_mvt( async def search_template( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, ccs_minimize_roundtrips: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, id: t.Optional[str] = None, ignore_throttled: t.Optional[bool] = None, @@ -3838,9 +3620,7 @@ async def terms_enum( field: str, case_insensitive: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, index_filter: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -3922,13 +3702,9 @@ async def termvectors( doc: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, field_statistics: t.Optional[bool] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, offsets: t.Optional[bool] = None, payloads: t.Optional[bool] = None, @@ -4045,9 +3821,7 @@ async def update( doc: t.Optional[t.Mapping[str, t.Any]] = None, doc_as_upsert: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_primary_term: t.Optional[int] = None, if_seq_no: t.Optional[int] = None, @@ -4062,12 +3836,8 @@ async def update( script: t.Optional[t.Mapping[str, t.Any]] = None, scripted_upsert: t.Optional[bool] = None, source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, upsert: t.Optional[t.Mapping[str, t.Any]] = None, wait_for_active_shards: t.Optional[ @@ -4178,7 +3948,7 @@ async def update( async def update_by_query( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, analyzer: t.Optional[str] = None, @@ -4188,25 +3958,13 @@ async def update_by_query( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -4231,8 +3989,8 @@ async def update_by_query( ] = None, slice: t.Optional[t.Mapping[str, t.Any]] = None, slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None, - sort: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + sort: t.Optional[t.Sequence[str]] = None, + stats: t.Optional[t.Sequence[str]] = None, terminate_after: t.Optional[int] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, version: t.Optional[bool] = None, @@ -4243,8 +4001,9 @@ async def update_by_query( wait_for_completion: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Performs an update on every document in the index without changing the source, - for example to pick up a mapping change. + Updates documents that match the specified query. If no query is specified, performs + an update on every document in the index without changing the source, for example + to pick up a mapping change. ``_ diff --git a/elasticsearch_serverless/_async/client/async_search.py b/elasticsearch_serverless/_async/client/async_search.py index 1351d3e..9269449 100644 --- a/elasticsearch_serverless/_async/client/async_search.py +++ b/elasticsearch_serverless/_async/client/async_search.py @@ -24,15 +24,14 @@ class AsyncSearchClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -67,9 +66,7 @@ async def get( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, pretty: t.Optional[bool] = None, @@ -129,9 +126,7 @@ async def status( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -172,7 +167,7 @@ async def status( async def submit( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, allow_no_indices: t.Optional[bool] = None, @@ -184,53 +179,30 @@ async def submit( collapse: t.Optional[t.Mapping[str, t.Any]] = None, default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None, df: t.Optional[str] = None, - docvalue_fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, ext: t.Optional[t.Mapping[str, t.Any]] = None, - fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, highlight: t.Optional[t.Mapping[str, t.Any]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indices_boost: t.Optional[ - t.Union[t.List[t.Mapping[str, float]], t.Tuple[t.Mapping[str, float], ...]] - ] = None, + indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, keep_on_completion: t.Optional[bool] = None, knn: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, lenient: t.Optional[bool] = None, max_concurrent_shard_requests: t.Optional[int] = None, @@ -246,12 +218,7 @@ async def submit( query: t.Optional[t.Mapping[str, t.Any]] = None, request_cache: t.Optional[bool] = None, rescore: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, rest_total_hits_as_int: t.Optional[bool] = None, routing: t.Optional[str] = None, @@ -259,10 +226,7 @@ async def submit( script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, search_after: t.Optional[ - t.Union[ - t.List[t.Union[None, bool, float, int, str, t.Any]], - t.Tuple[t.Union[None, bool, float, int, str, t.Any], ...], - ] + t.Sequence[t.Union[None, bool, float, int, str, t.Any]] ] = None, search_type: t.Optional[ t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str] @@ -272,24 +236,15 @@ async def submit( slice: t.Optional[t.Mapping[str, t.Any]] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stats: t.Optional[t.Sequence[str]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, suggest: t.Optional[t.Mapping[str, t.Any]] = None, suggest_field: t.Optional[str] = None, suggest_mode: t.Optional[ diff --git a/elasticsearch_serverless/_async/client/cat.py b/elasticsearch_serverless/_async/client/cat.py index da1e424..c9a65c5 100644 --- a/elasticsearch_serverless/_async/client/cat.py +++ b/elasticsearch_serverless/_async/client/cat.py @@ -24,35 +24,24 @@ class CatClient(NamespacedClient): + @_rewrite_parameters() async def aliases( self, *, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -60,7 +49,7 @@ async def aliases( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: """ @@ -128,11 +117,9 @@ async def component_templates( *, name: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -140,7 +127,7 @@ async def component_templates( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: """ @@ -201,13 +188,11 @@ async def component_templates( async def count( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -215,7 +200,7 @@ async def count( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: """ @@ -279,11 +264,9 @@ async def help( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -291,7 +274,7 @@ async def help( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> TextApiResponse: """ @@ -347,34 +330,22 @@ async def help( async def indices( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, bytes: t.Optional[ t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, health: t.Optional[t.Union["t.Literal['green', 'red', 'yellow']", str]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, @@ -385,7 +356,7 @@ async def indices( ] = None, pretty: t.Optional[bool] = None, pri: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, time: t.Optional[ t.Union["t.Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's']", str] ] = None, @@ -477,31 +448,20 @@ async def ml_data_frame_analytics( t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -513,25 +473,16 @@ async def ml_data_frame_analytics( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ], - ..., - ], - ], ] ] = None, time: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -606,31 +557,20 @@ async def ml_datafeeds( datafeed_id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", + str, + ] + ], t.Union[ "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -642,25 +582,16 @@ async def ml_datafeeds( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", + str, + ] + ], t.Union[ "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ], - ..., - ], - ], ] ] = None, time: t.Optional[ @@ -743,31 +674,20 @@ async def ml_jobs( t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -779,25 +699,16 @@ async def ml_jobs( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ], - ..., - ], - ], ] ] = None, time: t.Optional[ @@ -884,32 +795,21 @@ async def ml_trained_models( t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, from_: t.Optional[int] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", + str, + ] + ], t.Union[ "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -921,25 +821,16 @@ async def ml_trained_models( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", + str, + ] + ], t.Union[ "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ], - ..., - ], - ], ] ] = None, size: t.Optional[int] = None, @@ -1024,32 +915,21 @@ async def transforms( transform_id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, from_: t.Optional[int] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", + str, + ] + ], t.Union[ "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -1061,25 +941,16 @@ async def transforms( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", + str, + ] + ], t.Union[ "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ], - ..., - ], - ], ] ] = None, size: t.Optional[int] = None, diff --git a/elasticsearch_serverless/_async/client/cluster.py b/elasticsearch_serverless/_async/client/cluster.py index f5f581e..c1d9965 100644 --- a/elasticsearch_serverless/_async/client/cluster.py +++ b/elasticsearch_serverless/_async/client/cluster.py @@ -24,15 +24,14 @@ class ClusterClient(NamespacedClient): + @_rewrite_parameters() async def delete_component_template( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -78,11 +77,9 @@ async def delete_component_template( async def exists_component_template( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, master_timeout: t.Optional[ @@ -131,9 +128,7 @@ async def get_component_template( *, name: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, @@ -190,29 +185,17 @@ async def info( self, *, target: t.Union[ - t.Union[ - "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + t.Sequence[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + ] ], t.Union[ - t.List[ - t.Union[ - "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", - str, - ], - ..., - ], + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str ], ], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -253,9 +236,7 @@ async def put_component_template( allow_auto_create: t.Optional[bool] = None, create: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] diff --git a/elasticsearch_serverless/_async/client/enrich.py b/elasticsearch_serverless/_async/client/enrich.py index 62abc72..d639ac4 100644 --- a/elasticsearch_serverless/_async/client/enrich.py +++ b/elasticsearch_serverless/_async/client/enrich.py @@ -24,15 +24,14 @@ class EnrichClient(NamespacedClient): + @_rewrite_parameters() async def delete_policy( self, *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -66,9 +65,7 @@ async def execute_policy( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, wait_for_completion: t.Optional[bool] = None, @@ -105,11 +102,9 @@ async def execute_policy( async def get_policy( self, *, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -147,9 +142,7 @@ async def put_policy( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, geo_match: t.Optional[t.Mapping[str, t.Any]] = None, human: t.Optional[bool] = None, match: t.Optional[t.Mapping[str, t.Any]] = None, @@ -197,9 +190,7 @@ async def stats( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_async/client/eql.py b/elasticsearch_serverless/_async/client/eql.py index 056e45b..4a3e5d1 100644 --- a/elasticsearch_serverless/_async/client/eql.py +++ b/elasticsearch_serverless/_async/client/eql.py @@ -24,15 +24,14 @@ class EqlClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -69,9 +68,7 @@ async def get( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, pretty: t.Optional[bool] = None, @@ -82,7 +79,7 @@ async def get( """ Returns async results from previously executed Event Query Language (EQL) search - `< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html>`_ + ``_ :param id: Identifier for the search. :param keep_alive: Period for which the search and its results are stored on @@ -119,9 +116,7 @@ async def get_status( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -129,7 +124,7 @@ async def get_status( Returns the status of a previously submitted async or stored Event Query Language (EQL) search - `< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html>`_ + ``_ :param id: Identifier for the search. """ @@ -156,7 +151,7 @@ async def get_status( async def search( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], query: str, allow_no_indices: t.Optional[bool] = None, case_sensitive: t.Optional[bool] = None, @@ -164,42 +159,20 @@ async def search( event_category_field: t.Optional[str] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, fetch_size: t.Optional[int] = None, fields: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, filter: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, diff --git a/elasticsearch_serverless/_async/client/graph.py b/elasticsearch_serverless/_async/client/graph.py index 214bd31..c814b77 100644 --- a/elasticsearch_serverless/_async/client/graph.py +++ b/elasticsearch_serverless/_async/client/graph.py @@ -24,27 +24,24 @@ class GraphClient(NamespacedClient): + @_rewrite_parameters( body_fields=True, ) async def explore( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], connections: t.Optional[t.Mapping[str, t.Any]] = None, controls: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, routing: t.Optional[str] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, - vertices: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + vertices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, ) -> ObjectApiResponse[t.Any]: """ Explore extracted and summarized information about the documents and terms in diff --git a/elasticsearch_serverless/_async/client/indices.py b/elasticsearch_serverless/_async/client/indices.py index 40c59ea..c9e9443 100644 --- a/elasticsearch_serverless/_async/client/indices.py +++ b/elasticsearch_serverless/_async/client/indices.py @@ -24,6 +24,7 @@ class IndicesClient(NamespacedClient): + @_rewrite_parameters() async def add_block( self, @@ -34,25 +35,13 @@ async def add_block( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + 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[ @@ -115,29 +104,17 @@ async def analyze( *, index: t.Optional[str] = None, analyzer: t.Optional[str] = None, - attributes: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - char_filter: t.Optional[ - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ] - ] = None, + attributes: t.Optional[t.Sequence[str]] = None, + char_filter: t.Optional[t.Sequence[t.Union[str, t.Mapping[str, t.Any]]]] = None, error_trace: t.Optional[bool] = None, explain: t.Optional[bool] = None, field: t.Optional[str] = None, - filter: t.Optional[ - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter: t.Optional[t.Sequence[t.Union[str, t.Mapping[str, t.Any]]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, normalizer: t.Optional[str] = None, pretty: t.Optional[bool] = None, - text: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + text: t.Optional[t.Union[str, t.Sequence[str]]] = None, tokenizer: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -217,9 +194,7 @@ async def create( index: str, aliases: 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.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, mappings: t.Optional[t.Mapping[str, t.Any]] = None, master_timeout: t.Optional[ @@ -291,9 +266,7 @@ async def create_data_stream( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -333,25 +306,13 @@ async def data_streams_stats( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -390,30 +351,18 @@ async def data_streams_stats( async def delete( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: 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[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + 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[ @@ -477,12 +426,10 @@ async def delete( async def delete_alias( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -532,29 +479,17 @@ async def delete_alias( async def delete_data_lifecycle( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -601,29 +536,17 @@ async def delete_data_lifecycle( async def delete_data_stream( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -660,11 +583,9 @@ async def delete_data_stream( async def delete_index_template( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -675,7 +596,7 @@ async def delete_index_template( """ Deletes an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -710,30 +631,18 @@ async def delete_index_template( async def exists( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: 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[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -795,31 +704,19 @@ async def exists( async def exists_alias( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Union[str, t.Sequence[str]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -882,9 +779,7 @@ async def exists_index_template( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -894,7 +789,7 @@ async def exists_index_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -925,11 +820,9 @@ async def exists_index_template( async def explain_data_lifecycle( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, master_timeout: t.Optional[ @@ -973,44 +866,26 @@ async def explain_data_lifecycle( async def get( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: 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[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, features: t.Optional[ t.Union[ - t.Union["t.Literal['aliases', 'mappings', 'settings']", str], - t.Union[ - t.List[ - t.Union["t.Literal['aliases', 'mappings', 'settings']", str] - ], - t.Tuple[ - t.Union["t.Literal['aliases', 'mappings', 'settings']", str], - ..., - ], + t.Sequence[ + t.Union["t.Literal['aliases', 'mappings', 'settings']", str] ], + t.Union["t.Literal['aliases', 'mappings', 'settings']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -1086,31 +961,19 @@ async def get( async def get_alias( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -1172,29 +1035,17 @@ async def get_alias( async def get_data_lifecycle( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1237,29 +1088,17 @@ async def get_data_lifecycle( async def get_data_stream( self, *, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1305,9 +1144,7 @@ async def get_index_template( *, name: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, @@ -1320,7 +1157,7 @@ async def get_index_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -1364,30 +1201,18 @@ async def get_index_template( async def get_mapping( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -1451,31 +1276,19 @@ async def get_mapping( async def get_settings( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -1556,9 +1369,7 @@ async def migrate_to_data_stream( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1592,13 +1403,9 @@ async def migrate_to_data_stream( async def modify_data_stream( self, *, - actions: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + actions: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1635,13 +1442,11 @@ async def modify_data_stream( async def put_alias( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], name: str, error_trace: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, index_routing: t.Optional[str] = None, is_write_index: t.Optional[bool] = None, @@ -1728,7 +1533,7 @@ async def put_alias( async def put_data_lifecycle( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], data_retention: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, @@ -1736,25 +1541,13 @@ async def put_data_lifecycle( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -1825,17 +1618,13 @@ async def put_index_template( self, *, name: str, - composed_of: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + composed_of: t.Optional[t.Sequence[str]] = None, create: t.Optional[bool] = None, data_stream: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - index_patterns: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None, meta: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, priority: t.Optional[int] = None, @@ -1845,7 +1634,7 @@ async def put_index_template( """ Creates or updates an index template. - ``_ + ``_ :param name: Index or template name :param composed_of: An ordered list of component template names. Component templates @@ -1915,47 +1704,30 @@ async def put_index_template( async def put_mapping( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], allow_no_indices: t.Optional[bool] = None, date_detection: t.Optional[bool] = None, dynamic: t.Optional[ t.Union["t.Literal['false', 'runtime', 'strict', 'true']", str] ] = None, - dynamic_date_formats: t.Optional[ - t.Union[t.List[str], t.Tuple[str, ...]] - ] = None, + dynamic_date_formats: t.Optional[t.Sequence[str]] = None, dynamic_templates: t.Optional[ t.Union[ t.Mapping[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Mapping[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Mapping[str, t.Mapping[str, t.Any]], ...], - ], + t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]], ] ] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, field_names: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + 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[ @@ -2071,30 +1843,18 @@ async def put_settings( self, *, settings: t.Mapping[str, t.Any], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -2177,14 +1937,10 @@ async def put_template( aliases: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, create: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, - index_patterns: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None, mappings: t.Optional[t.Mapping[str, t.Any]] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -2198,7 +1954,7 @@ async def put_template( """ Creates or updates an index template. - ``_ + ``_ :param name: The name of the template :param aliases: Aliases for the index. @@ -2263,30 +2019,18 @@ async def put_template( async def refresh( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = 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, @@ -2337,29 +2081,17 @@ async def refresh( async def resolve_index( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -2407,9 +2139,7 @@ async def rollover( conditions: t.Optional[t.Mapping[str, t.Any]] = None, dry_run: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, mappings: t.Optional[t.Mapping[str, t.Any]] = None, master_timeout: t.Optional[ @@ -2497,90 +2227,36 @@ async def rollover( "POST", __path, params=__query, headers=__headers, body=__body ) - @_rewrite_parameters( - body_fields=True, - parameter_aliases={"_meta": "meta"}, - ) + @_rewrite_parameters() async def simulate_index_template( self, *, name: str, - allow_auto_create: t.Optional[bool] = None, - composed_of: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - create: t.Optional[bool] = None, - data_stream: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, - index_patterns: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, - meta: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, - priority: t.Optional[int] = None, - template: t.Optional[t.Mapping[str, t.Any]] = None, - version: t.Optional[int] = None, ) -> ObjectApiResponse[t.Any]: """ Simulate matching the given index name against the index templates in the system - ``_ + ``_ - :param name: Index or template name to simulate - :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` - cluster setting. If set to `true` in a template, then indices can be automatically - created using that template even if auto-creation of indices is disabled - via `actions.auto_create_index`. If set to `false`, then indices or data - streams matching the template must always be explicitly created, and may - never be automatically created. - :param composed_of: An ordered list of component template names. Component templates - are merged in the order specified, meaning that the last component template - specified has the highest precedence. - :param create: If `true`, the template passed in the body is only used if no - existing templates match the same index patterns. If `false`, the simulation - uses the template with the highest priority. Note that the template is not - permanently added or updated in either case; it is only used for the simulation. - :param data_stream: If this object is included, the template is used to create - data streams and their backing indices. Supports an empty object. Data streams - require a matching index template with a `data_stream` object. + :param name: Name of the index to simulate :param include_defaults: If true, returns all relevant default configurations for the index template. - :param index_patterns: Array of wildcard (`*`) expressions used to match the - names of data streams and indices during creation. :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 meta: Optional user metadata about the index template. May have any contents. - This map is not automatically generated by Elasticsearch. - :param priority: Priority to determine index template precedence when a new data - stream or index is created. The index template with the highest priority - is chosen. If no priority is specified the template is treated as though - it is of priority 0 (lowest priority). This number is not automatically generated - by Elasticsearch. - :param template: Template to be applied. It may optionally include an `aliases`, - `mappings`, or `settings` configuration. - :param version: Version number used to manage index templates externally. This - number is not automatically generated by Elasticsearch. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") __path = f"/_index_template/_simulate_index/{_quote(name)}" - __body: t.Dict[str, t.Any] = {} __query: t.Dict[str, t.Any] = {} - if allow_auto_create is not None: - __body["allow_auto_create"] = allow_auto_create - if composed_of is not None: - __body["composed_of"] = composed_of - if create is not None: - __query["create"] = create - if data_stream is not None: - __body["data_stream"] = data_stream if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -2589,90 +2265,130 @@ async def simulate_index_template( __query["human"] = human if include_defaults is not None: __query["include_defaults"] = include_defaults - if index_patterns is not None: - __body["index_patterns"] = index_patterns if master_timeout is not None: __query["master_timeout"] = master_timeout - if meta is not None: - __body["_meta"] = meta if pretty is not None: __query["pretty"] = pretty - if priority is not None: - __body["priority"] = priority - if template is not None: - __body["template"] = template - if version is not None: - __body["version"] = version - if not __body: - __body = None # type: ignore[assignment] __headers = {"accept": "application/json"} - if __body is not None: - __headers["content-type"] = "application/json" return await self.perform_request( # type: ignore[return-value] - "POST", __path, params=__query, headers=__headers, body=__body + "POST", __path, params=__query, headers=__headers ) @_rewrite_parameters( - body_name="template", + body_fields=True, + parameter_aliases={"_meta": "meta"}, ) async def simulate_template( self, *, name: t.Optional[str] = None, + allow_auto_create: t.Optional[bool] = None, + composed_of: t.Optional[t.Sequence[str]] = None, create: t.Optional[bool] = None, + data_stream: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, + ignore_missing_component_templates: t.Optional[t.Sequence[str]] = None, include_defaults: t.Optional[bool] = None, + index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, + meta: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, + priority: t.Optional[int] = None, template: t.Optional[t.Mapping[str, t.Any]] = None, + version: t.Optional[int] = None, ) -> ObjectApiResponse[t.Any]: """ Simulate resolving the given template name or body - ``_ + ``_ :param name: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. + :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` + cluster setting. If set to `true` in a template, then indices can be automatically + created using that template even if auto-creation of indices is disabled + via `actions.auto_create_index`. If set to `false`, then indices or data + streams matching the template must always be explicitly created, and may + never be automatically created. + :param composed_of: An ordered list of component template names. Component templates + are merged in the order specified, meaning that the last component template + specified has the highest precedence. :param create: If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. + :param data_stream: If this object is included, the template is used to create + data streams and their backing indices. Supports an empty object. Data streams + require a matching index template with a `data_stream` object. + :param ignore_missing_component_templates: The configuration option ignore_missing_component_templates + can be used when an index template references a component template that might + not exist :param include_defaults: If true, returns all relevant default configurations for the index template. + :param index_patterns: Array of wildcard (`*`) expressions used to match the + names of data streams and indices during creation. :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 template: + :param meta: Optional user metadata about the index template. May have any contents. + This map is not automatically generated by Elasticsearch. + :param priority: Priority to determine index template precedence when a new data + stream or index is created. The index template with the highest priority + is chosen. If no priority is specified the template is treated as though + it is of priority 0 (lowest priority). This number is not automatically generated + by Elasticsearch. + :param template: Template to be applied. It may optionally include an `aliases`, + `mappings`, or `settings` configuration. + :param version: Version number used to manage index templates externally. This + number is not automatically generated by Elasticsearch. """ if name not in SKIP_IN_PATH: __path = f"/_index_template/_simulate/{_quote(name)}" else: __path = "/_index_template/_simulate" + __body: t.Dict[str, t.Any] = {} __query: t.Dict[str, t.Any] = {} + if allow_auto_create is not None: + __body["allow_auto_create"] = allow_auto_create + if composed_of is not None: + __body["composed_of"] = composed_of if create is not None: __query["create"] = create + if data_stream is not None: + __body["data_stream"] = data_stream 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 ignore_missing_component_templates is not None: + __body["ignore_missing_component_templates"] = ( + ignore_missing_component_templates + ) if include_defaults is not None: __query["include_defaults"] = include_defaults + if index_patterns is not None: + __body["index_patterns"] = index_patterns if master_timeout is not None: __query["master_timeout"] = master_timeout + if meta is not None: + __body["_meta"] = meta if pretty is not None: __query["pretty"] = pretty - __body = template + if priority is not None: + __body["priority"] = priority + if template is not None: + __body["template"] = template + if version is not None: + __body["version"] = version if not __body: - __body = None + __body = None # type: ignore[assignment] __headers = {"accept": "application/json"} if __body is not None: __headers["content-type"] = "application/json" @@ -2686,13 +2402,9 @@ async def simulate_template( async def update_aliases( self, *, - actions: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + actions: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -2740,7 +2452,7 @@ async def update_aliases( async def validate_query( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, all_shards: t.Optional[bool] = None, allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, @@ -2750,26 +2462,14 @@ async def validate_query( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, lenient: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_async/client/inference.py b/elasticsearch_serverless/_async/client/inference.py new file mode 100644 index 0000000..3c89f3d --- /dev/null +++ b/elasticsearch_serverless/_async/client/inference.py @@ -0,0 +1,238 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import typing as t + +from elastic_transport import ObjectApiResponse + +from ._base import NamespacedClient +from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters + + +class InferenceClient(NamespacedClient): + + @_rewrite_parameters() + async def delete_model( + self, + *, + inference_id: str, + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Delete model in the Inference API + + ``_ + + :param inference_id: The inference Id + :param task_type: The task type + """ + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __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 pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + async def get_model( + self, + *, + inference_id: str, + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Get a model in the Inference API + + ``_ + + :param inference_id: The inference Id + :param task_type: The task type + """ + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __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 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 + ) + + @_rewrite_parameters( + body_fields=True, + ) + async def inference( + self, + *, + inference_id: str, + input: t.Union[str, t.Sequence[str]], + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + query: t.Optional[str] = None, + task_settings: t.Optional[t.Any] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Perform inference on a model + + ``_ + + :param inference_id: The inference Id + :param input: Text input to the model. Either a string or an array of strings. + :param task_type: The task type + :param query: Query input, required for rerank task. Not required for other tasks. + :param task_settings: Optional task settings + """ + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if input is None: + raise ValueError("Empty value passed for parameter 'input'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if input is not None: + __body["input"] = input + 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 pretty is not None: + __query["pretty"] = pretty + if query is not None: + __body["query"] = query + if task_settings is not None: + __body["task_settings"] = task_settings + if not __body: + __body = None # type: ignore[assignment] + __headers = {"accept": "application/json"} + if __body is not None: + __headers["content-type"] = "application/json" + return await self.perform_request( # type: ignore[return-value] + "POST", __path, params=__query, headers=__headers, body=__body + ) + + @_rewrite_parameters( + body_name="model_config", + ) + async def put_model( + self, + *, + inference_id: str, + model_config: t.Mapping[str, t.Any], + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Configure a model for use in the Inference API + + ``_ + + :param inference_id: The inference Id + :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'") + if model_config is None: + raise ValueError("Empty value passed for parameter 'model_config'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __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 pretty is not None: + __query["pretty"] = pretty + __body = model_config + __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 + ) diff --git a/elasticsearch_serverless/_async/client/ingest.py b/elasticsearch_serverless/_async/client/ingest.py index dca93eb..5eb936d 100644 --- a/elasticsearch_serverless/_async/client/ingest.py +++ b/elasticsearch_serverless/_async/client/ingest.py @@ -24,15 +24,14 @@ class IngestClient(NamespacedClient): + @_rewrite_parameters() async def delete_pipeline( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -80,9 +79,7 @@ async def get_pipeline( *, id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -129,9 +126,7 @@ async def processor_grok( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -165,22 +160,16 @@ async def put_pipeline( id: str, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_version: t.Optional[int] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, meta: t.Optional[t.Mapping[str, t.Any]] = None, - on_failure: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + on_failure: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, pretty: t.Optional[bool] = None, - processors: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + processors: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, version: t.Optional[int] = None, ) -> ObjectApiResponse[t.Any]: @@ -253,13 +242,9 @@ async def simulate( self, *, id: t.Optional[str] = None, - docs: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pipeline: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_async/client/license.py b/elasticsearch_serverless/_async/client/license.py index bb5c631..24800e5 100644 --- a/elasticsearch_serverless/_async/client/license.py +++ b/elasticsearch_serverless/_async/client/license.py @@ -24,15 +24,14 @@ class LicenseClient(NamespacedClient): + @_rewrite_parameters() async def get( self, *, accept_enterprise: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, pretty: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_async/client/logstash.py b/elasticsearch_serverless/_async/client/logstash.py index 967b16d..c6b2ac6 100644 --- a/elasticsearch_serverless/_async/client/logstash.py +++ b/elasticsearch_serverless/_async/client/logstash.py @@ -24,15 +24,14 @@ class LogstashClient(NamespacedClient): + @_rewrite_parameters() async def delete_pipeline( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -64,11 +63,9 @@ async def delete_pipeline( async def get_pipeline( self, *, - id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + id: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -79,8 +76,6 @@ async def get_pipeline( :param id: Comma-separated list of pipeline identifiers. """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'id'") if id not in SKIP_IN_PATH: __path = f"/_logstash/pipeline/{_quote(id)}" else: @@ -108,9 +103,7 @@ async def put_pipeline( id: str, pipeline: t.Mapping[str, t.Any], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_async/client/ml.py b/elasticsearch_serverless/_async/client/ml.py index 9cf02ce..d191ce8 100644 --- a/elasticsearch_serverless/_async/client/ml.py +++ b/elasticsearch_serverless/_async/client/ml.py @@ -24,6 +24,7 @@ class MlClient(NamespacedClient): + @_rewrite_parameters( body_fields=True, ) @@ -33,9 +34,7 @@ async def close_job( job_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -91,9 +90,7 @@ async def delete_calendar( *, calendar_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -128,9 +125,7 @@ async def delete_calendar_event( calendar_id: str, event_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -167,11 +162,9 @@ async def delete_calendar_job( self, *, calendar_id: str, - job_id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + job_id: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -209,9 +202,7 @@ async def delete_data_frame_analytics( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -254,9 +245,7 @@ async def delete_datafeed( *, datafeed_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -298,9 +287,7 @@ async def delete_filter( *, filter_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -335,9 +322,7 @@ async def delete_job( job_id: str, delete_user_annotations: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -386,9 +371,7 @@ async def delete_trained_model( *, model_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -429,9 +412,7 @@ async def delete_trained_model_alias( model_id: str, model_alias: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -470,9 +451,7 @@ async def estimate_model_memory( *, analysis_config: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_bucket_cardinality: t.Optional[t.Mapping[str, int]] = None, overall_cardinality: t.Optional[t.Mapping[str, int]] = None, @@ -529,9 +508,7 @@ async def evaluate_data_frame( evaluation: t.Mapping[str, t.Any], index: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, @@ -583,9 +560,7 @@ async def flush_job( calc_interim: t.Optional[bool] = None, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, skip_time: t.Optional[t.Union[str, t.Any]] = None, @@ -644,9 +619,7 @@ async def get_calendar_events( calendar_id: str, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, job_id: t.Optional[str] = None, @@ -706,9 +679,7 @@ async def get_calendars( *, calendar_id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, page: t.Optional[t.Mapping[str, t.Any]] = None, @@ -769,9 +740,7 @@ async def get_data_frame_analytics( allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -834,9 +803,7 @@ async def get_data_frame_analytics_stats( id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -893,14 +860,10 @@ async def get_data_frame_analytics_stats( async def get_datafeed_stats( self, *, - datafeed_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + datafeed_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -944,15 +907,11 @@ async def get_datafeed_stats( async def get_datafeeds( self, *, - datafeed_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + datafeed_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1003,13 +962,9 @@ async def get_datafeeds( async def get_filters( self, *, - filter_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1053,9 +1008,7 @@ async def get_job_stats( job_id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1100,15 +1053,11 @@ async def get_job_stats( async def get_jobs( self, *, - job_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + job_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1165,9 +1114,7 @@ async def get_overall_buckets( end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, exclude_interim: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, overall_score: t.Optional[t.Union[float, str]] = None, pretty: t.Optional[bool] = None, @@ -1242,9 +1189,7 @@ async def get_trained_models( decompress_definition: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, include: t.Optional[ @@ -1320,14 +1265,10 @@ async def get_trained_models( async def get_trained_models_stats( self, *, - model_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + model_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1379,13 +1320,9 @@ async def infer_trained_model( self, *, model_id: str, - docs: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + docs: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, inference_config: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -1439,9 +1376,7 @@ async def open_job( *, job_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -1485,13 +1420,9 @@ async def post_calendar_events( self, *, calendar_id: str, - events: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + events: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1536,9 +1467,7 @@ async def preview_data_frame_analytics( id: t.Optional[str] = None, config: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1587,9 +1516,7 @@ async def preview_datafeed( datafeed_config: t.Optional[t.Mapping[str, t.Any]] = None, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, job_config: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -1655,11 +1582,9 @@ async def put_calendar( calendar_id: str, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - job_ids: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + job_ids: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -1704,9 +1629,7 @@ async def put_calendar_job( calendar_id: str, job_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1753,12 +1676,8 @@ async def put_data_frame_analytics( analyzed_fields: t.Optional[t.Mapping[str, t.Any]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - headers: t.Optional[ - t.Mapping[str, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + headers: t.Optional[t.Mapping[str, t.Union[str, t.Sequence[str]]]] = None, human: t.Optional[bool] = None, max_num_threads: t.Optional[int] = None, model_memory_limit: t.Optional[str] = None, @@ -1884,38 +1803,20 @@ async def put_datafeed( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, - headers: t.Optional[ - t.Mapping[str, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, + headers: t.Optional[t.Mapping[str, t.Union[str, t.Sequence[str]]]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indexes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - indices: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + indexes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + indices: t.Optional[t.Union[str, t.Sequence[str]]] = None, indices_options: t.Optional[t.Mapping[str, t.Any]] = None, job_id: t.Optional[str] = None, max_empty_searches: t.Optional[int] = None, @@ -2065,11 +1966,9 @@ async def put_filter( filter_id: str, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - items: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + items: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -2123,10 +2022,8 @@ async def put_job( datafeed_config: t.Optional[t.Mapping[str, t.Any]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - groups: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + groups: t.Optional[t.Sequence[str]] = None, human: t.Optional[bool] = None, model_plot_config: t.Optional[t.Mapping[str, t.Any]] = None, model_snapshot_retention_days: t.Optional[int] = None, @@ -2279,9 +2176,7 @@ async def put_trained_model( definition: t.Optional[t.Mapping[str, t.Any]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, inference_config: t.Optional[t.Mapping[str, t.Any]] = None, input: t.Optional[t.Mapping[str, t.Any]] = None, @@ -2290,8 +2185,11 @@ async def put_trained_model( model_type: t.Optional[ t.Union["t.Literal['lang_ident', 'pytorch', 'tree_ensemble']", str] ] = None, + platform_architecture: t.Optional[str] = None, + prefix_strings: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, - tags: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + tags: t.Optional[t.Sequence[str]] = None, + wait_for_completion: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Creates an inference trained model. @@ -2318,7 +2216,18 @@ async def put_trained_model( model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied. :param model_type: The model type. + :param platform_architecture: The platform architecture (if applicable) of the + trained mode. If the model only works on one platform, because it is heavily + optimized for a particular processor architecture and OS combination, then + this field specifies which. The format of the string must match the platform + identifiers used by Elasticsearch, so one of, `linux-x86_64`, `linux-aarch64`, + `darwin-x86_64`, `darwin-aarch64`, or `windows-x86_64`. For portable models + (those that work independent of processor architecture or OS features), leave + this field unset. + :param prefix_strings: Optional prefix strings applied at inference :param tags: An array of tags to organize the model. + :param wait_for_completion: Whether to wait for all child operations (e.g. model + download) to complete. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -2349,10 +2258,16 @@ async def put_trained_model( __body["model_size_bytes"] = model_size_bytes if model_type is not None: __body["model_type"] = model_type + if platform_architecture is not None: + __body["platform_architecture"] = platform_architecture + if prefix_strings is not None: + __body["prefix_strings"] = prefix_strings if pretty is not None: __query["pretty"] = pretty if tags is not None: __body["tags"] = tags + if wait_for_completion is not None: + __query["wait_for_completion"] = wait_for_completion __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 @@ -2365,9 +2280,7 @@ async def put_trained_model_alias( model_id: str, model_alias: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, reassign: t.Optional[bool] = None, @@ -2417,9 +2330,7 @@ async def put_trained_model_definition_part( total_definition_length: int, total_parts: int, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -2480,14 +2391,13 @@ async def put_trained_model_vocabulary( self, *, model_id: str, - vocabulary: t.Union[t.List[str], t.Tuple[str, ...]], + vocabulary: t.Sequence[str], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - merges: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + merges: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, + scores: t.Optional[t.Sequence[float]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a trained model vocabulary @@ -2497,6 +2407,7 @@ async def put_trained_model_vocabulary( :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. :param merges: The optional model merges if required by the tokenizer. + :param scores: The optional vocabulary value scores if required by the tokenizer. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -2517,6 +2428,8 @@ async def put_trained_model_vocabulary( __body["merges"] = merges if pretty is not None: __query["pretty"] = pretty + if scores is not None: + __body["scores"] = scores __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 @@ -2529,9 +2442,7 @@ async def reset_job( job_id: str, delete_user_annotations: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, wait_for_completion: t.Optional[bool] = None, @@ -2575,9 +2486,7 @@ async def start_data_frame_analytics( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -2621,9 +2530,7 @@ async def start_datafeed( datafeed_id: str, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, start: t.Optional[t.Union[str, t.Any]] = None, @@ -2676,10 +2583,9 @@ async def start_trained_model_deployment( *, model_id: str, cache_size: t.Optional[t.Union[int, str]] = None, + deployment_id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, number_of_allocations: t.Optional[int] = None, pretty: t.Optional[bool] = None, @@ -2701,6 +2607,7 @@ async def start_trained_model_deployment( :param cache_size: The inference cache size (in memory outside the JVM heap) per node for the model. The default value is the same size as the `model_size_bytes`. To disable the cache, `0b` can be provided. + :param deployment_id: A unique identifier for the deployment of the model. :param number_of_allocations: The number of model allocations on each node where the model is deployed. All allocations on a node share the same copy of the model in memory but use a separate set of threads to evaluate the model. @@ -2727,6 +2634,8 @@ async def start_trained_model_deployment( __query: t.Dict[str, t.Any] = {} if cache_size is not None: __query["cache_size"] = cache_size + if deployment_id is not None: + __query["deployment_id"] = deployment_id if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -2759,9 +2668,7 @@ async def stop_data_frame_analytics( id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -2819,9 +2726,7 @@ async def stop_datafeed( datafeed_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -2876,9 +2781,7 @@ async def stop_trained_model_deployment( model_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -2930,9 +2833,7 @@ async def update_data_frame_analytics( allow_lazy_start: t.Optional[bool] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_num_threads: t.Optional[int] = None, model_memory_limit: t.Optional[str] = None, @@ -2999,31 +2900,19 @@ async def update_datafeed( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indexes: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - indices: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + indexes: t.Optional[t.Sequence[str]] = None, + indices: t.Optional[t.Sequence[str]] = None, indices_options: t.Optional[t.Mapping[str, t.Any]] = None, job_id: t.Optional[str] = None, max_empty_searches: t.Optional[int] = None, @@ -3180,15 +3069,13 @@ async def update_filter( self, *, filter_id: str, - add_items: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + add_items: t.Optional[t.Sequence[str]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, - remove_items: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + remove_items: t.Optional[t.Sequence[str]] = None, ) -> ObjectApiResponse[t.Any]: """ Updates the description of a filter, adds items, or removes items. @@ -3236,20 +3123,14 @@ async def update_job( background_persist_interval: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, - categorization_filters: t.Optional[ - t.Union[t.List[str], t.Tuple[str, ...]] - ] = None, + categorization_filters: t.Optional[t.Sequence[str]] = None, custom_settings: t.Optional[t.Mapping[str, t.Any]] = None, daily_model_snapshot_retention_after_days: t.Optional[int] = None, description: t.Optional[str] = None, - detectors: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + detectors: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - groups: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + groups: t.Optional[t.Sequence[str]] = None, human: t.Optional[bool] = None, model_plot_config: t.Optional[t.Mapping[str, t.Any]] = None, model_prune_window: t.Optional[ diff --git a/elasticsearch_serverless/_async/client/query_ruleset.py b/elasticsearch_serverless/_async/client/query_ruleset.py index 2edfc60..a2e68e5 100644 --- a/elasticsearch_serverless/_async/client/query_ruleset.py +++ b/elasticsearch_serverless/_async/client/query_ruleset.py @@ -24,15 +24,14 @@ class QueryRulesetClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, *, ruleset_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -66,9 +65,7 @@ async def get( *, ruleset_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -103,9 +100,7 @@ async def list( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -145,13 +140,9 @@ async def put( self, *, ruleset_id: str, - rules: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + rules: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_async/client/search_application.py b/elasticsearch_serverless/_async/client/search_application.py index 7defb82..c3b8e38 100644 --- a/elasticsearch_serverless/_async/client/search_application.py +++ b/elasticsearch_serverless/_async/client/search_application.py @@ -24,22 +24,21 @@ class SearchApplicationClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Deletes a search application. - ``_ + ``_ :param name: The name of the search application to delete """ @@ -66,9 +65,7 @@ async def delete_behavioral_analytics( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -102,9 +99,7 @@ async def get( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -136,11 +131,9 @@ async def get( async def get_behavioral_analytics( self, *, - name: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + name: t.Optional[t.Sequence[str]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -176,9 +169,7 @@ async def list( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -225,9 +216,7 @@ async def put( search_application: t.Mapping[str, t.Any], create: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -269,9 +258,7 @@ async def put_behavioral_analytics( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -308,9 +295,7 @@ async def search( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, params: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_async/client/security.py b/elasticsearch_serverless/_async/client/security.py index 9871b2b..aa46058 100644 --- a/elasticsearch_serverless/_async/client/security.py +++ b/elasticsearch_serverless/_async/client/security.py @@ -24,14 +24,13 @@ class SecurityClient(NamespacedClient): + @_rewrite_parameters() async def authenticate( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -64,9 +63,7 @@ async def create_api_key( *, error_trace: t.Optional[bool] = None, expiration: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, metadata: t.Optional[t.Mapping[str, t.Any]] = None, name: t.Optional[str] = None, @@ -129,10 +126,9 @@ async def create_api_key( async def get_api_key( self, *, + active_only: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, id: t.Optional[str] = None, name: t.Optional[str] = None, @@ -141,12 +137,18 @@ async def get_api_key( realm_name: t.Optional[str] = None, username: t.Optional[str] = None, with_limited_by: t.Optional[bool] = None, + with_profile_uid: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Retrieves information for one or more API keys. ``_ + :param active_only: A boolean flag that can be used to query API keys that are + currently active. An API key is considered active if it is neither invalidated, + nor expired at query time. You can specify this together with other parameters + such as `owner` or `name`. If `active_only` is false, the response will include + both active and inactive (expired or invalidated) keys. :param id: An API key id. This parameter cannot be used with any of `name`, `realm_name` or `username`. :param name: An API key name. This parameter cannot be used with any of `id`, @@ -162,9 +164,13 @@ async def get_api_key( :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. + :param with_profile_uid: Determines whether to also retrieve the profile uid, + for the API key owner principal, if it exists. """ __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} + if active_only is not None: + __query["active_only"] = active_only if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -185,6 +191,8 @@ async def get_api_key( __query["username"] = username if with_limited_by is not None: __query["with_limited_by"] = with_limited_by + if with_profile_uid is not None: + __query["with_profile_uid"] = with_profile_uid __headers = {"accept": "application/json"} return await self.perform_request( # type: ignore[return-value] "GET", __path, params=__query, headers=__headers @@ -197,34 +205,19 @@ async def has_privileges( self, *, user: t.Optional[str] = None, - application: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + application: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, cluster: t.Optional[ - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']", - str, - ], - ..., - ], + t.Sequence[ + t.Union[ + "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']", + str, + ] ] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - index: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + index: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -269,12 +262,10 @@ async def invalidate_api_key( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, id: t.Optional[str] = None, - ids: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + ids: t.Optional[t.Sequence[str]] = None, name: t.Optional[str] = None, owner: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -335,44 +326,55 @@ async def invalidate_api_key( 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.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, search_after: t.Optional[ - t.Union[ - t.List[t.Union[None, bool, float, int, str, t.Any]], - t.Tuple[t.Union[None, bool, float, int, str, t.Any], ...], - ] + t.Sequence[t.Union[None, bool, float, int, str, t.Any]] ] = None, size: t.Optional[int] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, + typed_keys: t.Optional[bool] = None, with_limited_by: t.Optional[bool] = None, + with_profile_uid: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Retrieves information for API keys using a subset of query DSL ``_ + :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 @@ -380,13 +382,17 @@ async def query_api_keys( :param sort: Other than `id`, all public fields of an API key are eligible for sorting. In addition, sort can also be applied to the `_doc` field to sort by index order. + :param typed_keys: Determines whether aggregation names are prefixed by their + respective types in the response. :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. + :param with_profile_uid: Determines whether to also retrieve the profile uid, + for the API key owner principal, if it exists. """ __path = "/_security/_query/api_key" - __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} # The 'sort' parameter with a colon can't be encoded to the body. if sort is not None and ( (isinstance(sort, str) and ":" in sort) @@ -398,6 +404,10 @@ async def query_api_keys( ): __query["sort"] = sort sort = None + if aggregations is not None: + __body["aggregations"] = aggregations + if aggs is not None: + __body["aggs"] = aggs if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -416,8 +426,12 @@ async def query_api_keys( __body["size"] = size if sort is not None: __body["sort"] = sort + if typed_keys is not None: + __query["typed_keys"] = typed_keys if with_limited_by is not None: __query["with_limited_by"] = with_limited_by + if with_profile_uid is not None: + __query["with_profile_uid"] = with_profile_uid if not __body: __body = None # type: ignore[assignment] __headers = {"accept": "application/json"} @@ -435,9 +449,8 @@ async def update_api_key( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + expiration: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, metadata: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -449,6 +462,7 @@ async def update_api_key( ``_ :param id: The ID of the API key to update. + :param expiration: Expiration time for the API key. :param metadata: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage. @@ -468,6 +482,8 @@ async def update_api_key( __body: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace + if expiration is not None: + __body["expiration"] = expiration if filter_path is not None: __query["filter_path"] = filter_path if human is not None: diff --git a/elasticsearch_serverless/_async/client/sql.py b/elasticsearch_serverless/_async/client/sql.py index b5134d7..e869e2b 100644 --- a/elasticsearch_serverless/_async/client/sql.py +++ b/elasticsearch_serverless/_async/client/sql.py @@ -24,6 +24,7 @@ class SqlClient(NamespacedClient): + @_rewrite_parameters( body_fields=True, ) @@ -32,9 +33,7 @@ async def clear_cursor( *, cursor: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -71,9 +70,7 @@ async def delete_async( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -109,9 +106,7 @@ async def get_async( id: str, delimiter: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, human: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -168,9 +163,7 @@ async def get_async_status( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -213,9 +206,7 @@ async def query( fetch_size: t.Optional[int] = None, field_multi_value_leniency: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, human: t.Optional[bool] = None, index_using_frozen: t.Optional[bool] = None, @@ -330,9 +321,7 @@ async def translate( error_trace: t.Optional[bool] = None, fetch_size: t.Optional[int] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, time_zone: t.Optional[str] = None, diff --git a/elasticsearch_serverless/_async/client/synonyms.py b/elasticsearch_serverless/_async/client/synonyms.py index b6e7a0d..c685d79 100644 --- a/elasticsearch_serverless/_async/client/synonyms.py +++ b/elasticsearch_serverless/_async/client/synonyms.py @@ -24,15 +24,14 @@ class SynonymsClient(NamespacedClient): + @_rewrite_parameters() async def delete_synonym( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -67,9 +66,7 @@ async def delete_synonym_rule( set_id: str, rule_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -108,9 +105,7 @@ async def get_synonym( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -153,9 +148,7 @@ async def get_synonym_rule( set_id: str, rule_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -193,9 +186,7 @@ async def get_synonyms_sets( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -235,13 +226,9 @@ async def put_synonym( self, *, id: str, - synonyms_set: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + synonyms_set: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -283,11 +270,9 @@ async def put_synonym_rule( *, set_id: str, rule_id: str, - synonyms: t.Union[t.List[str], t.Tuple[str, ...]], + synonyms: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_async/client/tasks.py b/elasticsearch_serverless/_async/client/tasks.py index 68c5ac5..c7d9f99 100644 --- a/elasticsearch_serverless/_async/client/tasks.py +++ b/elasticsearch_serverless/_async/client/tasks.py @@ -24,15 +24,14 @@ class TasksClient(NamespacedClient): + @_rewrite_parameters() async def get( self, *, task_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, diff --git a/elasticsearch_serverless/_async/client/transform.py b/elasticsearch_serverless/_async/client/transform.py index d72bea2..a7cafbb 100644 --- a/elasticsearch_serverless/_async/client/transform.py +++ b/elasticsearch_serverless/_async/client/transform.py @@ -24,15 +24,15 @@ class TransformClient(NamespacedClient): + @_rewrite_parameters() async def delete_transform( self, *, transform_id: str, + delete_dest_index: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -44,6 +44,9 @@ async def delete_transform( ``_ :param transform_id: Identifier for the transform. + :param delete_dest_index: If this value is true, the destination index is deleted + together with the transform. If false, the destination index will not be + deleted :param force: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state. @@ -54,6 +57,8 @@ async def delete_transform( raise ValueError("Empty value passed for parameter 'transform_id'") __path = f"/_transform/{_quote(transform_id)}" __query: t.Dict[str, t.Any] = {} + if delete_dest_index is not None: + __query["delete_dest_index"] = delete_dest_index if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -77,15 +82,11 @@ async def delete_transform( async def get_transform( self, *, - transform_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + transform_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -142,12 +143,10 @@ async def get_transform( async def get_transform_stats( self, *, - transform_id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + transform_id: t.Union[str, t.Sequence[str]], allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -206,9 +205,7 @@ async def preview_transform( description: t.Optional[str] = None, dest: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, latest: t.Optional[t.Mapping[str, t.Any]] = None, @@ -303,9 +300,7 @@ async def put_transform( defer_validation: t.Optional[bool] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, latest: t.Optional[t.Mapping[str, t.Any]] = None, @@ -404,9 +399,7 @@ async def reset_transform( *, transform_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -448,9 +441,7 @@ async def schedule_now_transform( *, transform_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -490,9 +481,7 @@ async def start_transform( *, transform_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[str] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -538,9 +527,7 @@ async def stop_transform( transform_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -614,9 +601,7 @@ async def update_transform( description: t.Optional[str] = None, dest: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, meta: t.Optional[t.Mapping[str, t.Any]] = None, diff --git a/elasticsearch_serverless/_sync/client/__init__.py b/elasticsearch_serverless/_sync/client/__init__.py index 453df38..207026f 100644 --- a/elasticsearch_serverless/_sync/client/__init__.py +++ b/elasticsearch_serverless/_sync/client/__init__.py @@ -41,6 +41,7 @@ from .eql import EqlClient from .graph import GraphClient from .indices import IndicesClient +from .inference import InferenceClient from .ingest import IngestClient from .license import LicenseClient from .logstash import LogstashClient @@ -279,6 +280,7 @@ def __init__( self.cat = CatClient(self) self.cluster = ClusterClient(self) self.indices = IndicesClient(self) + self.inference = InferenceClient(self) self.ingest = IngestClient(self) self.tasks = TasksClient(self) @@ -440,14 +442,10 @@ def ping( def bulk( self, *, - operations: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + operations: t.Sequence[t.Mapping[str, t.Any]], index: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pipeline: t.Optional[str] = None, pretty: t.Optional[bool] = None, @@ -456,15 +454,9 @@ def bulk( ] = None, require_alias: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, wait_for_active_shards: t.Optional[ t.Union[int, t.Union["t.Literal['all', 'index-setting']", str]] @@ -550,14 +542,10 @@ def clear_scroll( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, - scroll_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + scroll_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, ) -> ObjectApiResponse[t.Any]: """ Explicitly clears the search context for a scroll. @@ -596,9 +584,7 @@ def close_point_in_time( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -639,7 +625,7 @@ def close_point_in_time( def count( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, analyzer: t.Optional[str] = None, @@ -648,25 +634,13 @@ def count( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -784,9 +758,7 @@ def create( id: str, document: t.Mapping[str, t.Any], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pipeline: t.Optional[str] = None, pretty: t.Optional[bool] = None, @@ -879,9 +851,7 @@ def delete( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_primary_term: t.Optional[int] = None, if_seq_no: t.Optional[int] = None, @@ -966,7 +936,7 @@ def delete( def delete_by_query( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, analyzer: t.Optional[str] = None, @@ -976,25 +946,13 @@ def delete_by_query( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -1018,8 +976,8 @@ def delete_by_query( ] = None, slice: t.Optional[t.Mapping[str, t.Any]] = None, slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None, - sort: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + sort: t.Optional[t.Sequence[str]] = None, + stats: t.Optional[t.Sequence[str]] = None, terminate_after: t.Optional[int] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, version: t.Optional[bool] = None, @@ -1193,9 +1151,7 @@ def delete_script( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -1249,27 +1205,17 @@ def exists( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1355,24 +1301,16 @@ def exists_source( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1458,9 +1396,7 @@ def explain( default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None, df: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, lenient: t.Optional[bool] = None, preference: t.Optional[str] = None, @@ -1468,18 +1404,10 @@ def explain( q: t.Optional[str] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, ) -> ObjectApiResponse[t.Any]: """ Returns information about why a specific matches (or doesn't match) a query. @@ -1568,41 +1496,28 @@ def explain( def field_caps( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, filters: t.Optional[str] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, + include_empty_fields: t.Optional[bool] = None, include_unmapped: t.Optional[bool] = None, index_filter: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, - types: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + types: t.Optional[t.Sequence[str]] = None, ) -> ObjectApiResponse[t.Any]: """ Returns the information about the capabilities of fields among multiple indices. @@ -1626,6 +1541,7 @@ def field_caps( :param filters: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. + :param include_empty_fields: If false, empty fields are not included in the response. :param include_unmapped: If true, unmapped fields are included in the response. :param index_filter: Allows to filter indices if the provided query rewrites to match_none on every shard. @@ -1658,6 +1574,8 @@ def field_caps( __query["human"] = human if ignore_unavailable is not None: __query["ignore_unavailable"] = ignore_unavailable + if include_empty_fields is not None: + __query["include_empty_fields"] = include_empty_fields if include_unmapped is not None: __query["include_unmapped"] = include_unmapped if index_filter is not None: @@ -1690,27 +1608,18 @@ def get( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + force_synthetic_source: t.Optional[bool] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1723,6 +1632,10 @@ def get( :param index: Name of the index that contains the document. :param id: Unique identifier of the document. + :param force_synthetic_source: Should this request force synthetic _source? Use + this to test if the mapping supports synthetic _source and to get a sense + of the worst case performance. Fetches with this enabled will be slower the + enabling synthetic source natively in the index. :param preference: Specifies the node or shard the operation should be performed on. Random by default. :param realtime: If `true`, the request is real-time as opposed to near-real-time. @@ -1753,6 +1666,8 @@ def get( __query["error_trace"] = error_trace if filter_path is not None: __query["filter_path"] = filter_path + if force_synthetic_source is not None: + __query["force_synthetic_source"] = force_synthetic_source if human is not None: __query["human"] = human if preference is not None: @@ -1788,9 +1703,7 @@ def get_script( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -1837,27 +1750,17 @@ def get_source( index: str, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, version: t.Optional[int] = None, version_type: t.Optional[ t.Union["t.Literal['external', 'external_gte', 'force', 'internal']", str] @@ -1937,9 +1840,7 @@ def index( document: t.Mapping[str, t.Any], id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_primary_term: t.Optional[int] = None, if_seq_no: t.Optional[int] = None, @@ -2052,9 +1953,7 @@ def info( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -2090,32 +1989,21 @@ def mget( self, *, index: t.Optional[str] = None, - docs: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + force_synthetic_source: t.Optional[bool] = None, human: t.Optional[bool] = None, - ids: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + ids: t.Optional[t.Union[str, t.Sequence[str]]] = None, preference: t.Optional[str] = None, pretty: t.Optional[bool] = None, realtime: t.Optional[bool] = None, refresh: t.Optional[bool] = None, routing: t.Optional[str] = None, - source: t.Optional[ - t.Union[bool, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, ) -> ObjectApiResponse[t.Any]: """ Allows to get multiple documents in one request. @@ -2126,6 +2014,10 @@ def mget( or when a document in the `docs` array does not specify an index. :param docs: The documents you want to retrieve. Required if no index is specified in the request URI. + :param force_synthetic_source: Should this request force synthetic _source? Use + this to test if the mapping supports synthetic _source and to get a sense + of the worst case performance. Fetches with this enabled will be slower the + enabling synthetic source natively in the index. :param ids: The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI. :param preference: Specifies the node or shard the operation should be performed @@ -2159,6 +2051,8 @@ def mget( __query["error_trace"] = error_trace if filter_path is not None: __query["filter_path"] = filter_path + if force_synthetic_source is not None: + __query["force_synthetic_source"] = force_synthetic_source if human is not None: __query["human"] = human if ids is not None: @@ -2192,34 +2086,20 @@ def mget( def msearch( self, *, - searches: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + searches: t.Sequence[t.Mapping[str, t.Any]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, ccs_minimize_roundtrips: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -2329,15 +2209,11 @@ def msearch( def msearch_template( self, *, - search_templates: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + search_templates: t.Sequence[t.Mapping[str, t.Any]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, ccs_minimize_roundtrips: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_concurrent_searches: t.Optional[int] = None, pretty: t.Optional[bool] = None, @@ -2408,19 +2284,13 @@ def mtermvectors( self, *, index: t.Optional[str] = None, - docs: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, field_statistics: t.Optional[bool] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - ids: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + ids: t.Optional[t.Sequence[str]] = None, offsets: t.Optional[bool] = None, payloads: t.Optional[bool] = None, positions: t.Optional[bool] = None, @@ -2513,30 +2383,18 @@ def mtermvectors( def open_point_in_time( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], keep_alive: t.Union["t.Literal[-1]", "t.Literal[0]", str], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, preference: t.Optional[str] = None, @@ -2600,9 +2458,7 @@ def put_script( script: t.Mapping[str, t.Any], context: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -2665,33 +2521,19 @@ def put_script( def rank_eval( self, *, - requests: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + requests: t.Sequence[t.Mapping[str, t.Any]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, metric: t.Optional[t.Mapping[str, t.Any]] = None, @@ -2765,9 +2607,7 @@ def reindex( source: t.Mapping[str, t.Any], conflicts: t.Optional[t.Union["t.Literal['abort', 'proceed']", str]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_docs: t.Optional[int] = None, pretty: t.Optional[bool] = None, @@ -2873,9 +2713,7 @@ def render_search_template( id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, file: t.Optional[str] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, params: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -2933,9 +2771,7 @@ def scripts_painless_execute( context: t.Optional[str] = None, context_setup: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, script: t.Optional[t.Mapping[str, t.Any]] = None, @@ -2983,9 +2819,7 @@ def scroll( *, scroll_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, rest_total_hits_as_int: t.Optional[bool] = None, @@ -3042,7 +2876,7 @@ def scroll( def search( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, allow_no_indices: t.Optional[bool] = None, @@ -3054,51 +2888,29 @@ def search( collapse: t.Optional[t.Mapping[str, t.Any]] = None, default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None, df: t.Optional[str] = None, - docvalue_fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, ext: t.Optional[t.Mapping[str, t.Any]] = None, - fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + force_synthetic_source: t.Optional[bool] = None, from_: t.Optional[int] = None, highlight: t.Optional[t.Mapping[str, t.Any]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indices_boost: t.Optional[ - t.Union[t.List[t.Mapping[str, float]], t.Tuple[t.Mapping[str, float], ...]] - ] = None, + indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None, knn: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, lenient: t.Optional[bool] = None, max_concurrent_shard_requests: t.Optional[int] = None, @@ -3115,12 +2927,7 @@ def search( rank: t.Optional[t.Mapping[str, t.Any]] = None, request_cache: t.Optional[bool] = None, rescore: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, rest_total_hits_as_int: t.Optional[bool] = None, routing: t.Optional[str] = None, @@ -3128,10 +2935,7 @@ def search( script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, search_after: t.Optional[ - t.Union[ - t.List[t.Union[None, bool, float, int, str, t.Any]], - t.Tuple[t.Union[None, bool, float, int, str, t.Any], ...], - ] + t.Sequence[t.Union[None, bool, float, int, str, t.Any]] ] = None, search_type: t.Optional[ t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str] @@ -3141,24 +2945,15 @@ def search( slice: t.Optional[t.Mapping[str, t.Any]] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stats: t.Optional[t.Sequence[str]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, suggest: t.Optional[t.Mapping[str, t.Any]] = None, suggest_field: t.Optional[str] = None, suggest_mode: t.Optional[ @@ -3223,6 +3018,10 @@ def search( :param fields: Array of wildcard (`*`) patterns. The request returns values for field names matching these patterns in the `hits.fields` property of the response. + :param force_synthetic_source: Should this request force synthetic _source? Use + this to test if the mapping supports synthetic _source and to get a sense + of the worst case performance. Fetches with this enabled will be slower the + enabling synthetic source natively in the index. :param from_: Starting document offset. Needs to be non-negative. 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. @@ -3413,6 +3212,8 @@ def search( __body["fields"] = fields if filter_path is not None: __query["filter_path"] = filter_path + if force_synthetic_source is not None: + __query["force_synthetic_source"] = force_synthetic_source if from_ is not None: __body["from"] = from_ if highlight is not None: @@ -3526,7 +3327,7 @@ def search( def search_mvt( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], field: str, zoom: int, x: int, @@ -3536,12 +3337,8 @@ def search_mvt( error_trace: t.Optional[bool] = None, exact_bounds: t.Optional[bool] = None, extent: t.Optional[int] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, grid_agg: t.Optional[t.Union["t.Literal['geohex', 'geotile']", str]] = None, grid_precision: t.Optional[int] = None, grid_type: t.Optional[ @@ -3554,11 +3351,8 @@ def search_mvt( size: t.Optional[int] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, track_total_hits: t.Optional[t.Union[bool, int]] = None, @@ -3689,32 +3483,20 @@ def search_mvt( def search_template( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, ccs_minimize_roundtrips: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, id: t.Optional[str] = None, ignore_throttled: t.Optional[bool] = None, @@ -3836,9 +3618,7 @@ def terms_enum( field: str, case_insensitive: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, index_filter: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -3920,13 +3700,9 @@ def termvectors( doc: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, field_statistics: t.Optional[bool] = None, - fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, offsets: t.Optional[bool] = None, payloads: t.Optional[bool] = None, @@ -4043,9 +3819,7 @@ def update( doc: t.Optional[t.Mapping[str, t.Any]] = None, doc_as_upsert: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_primary_term: t.Optional[int] = None, if_seq_no: t.Optional[int] = None, @@ -4060,12 +3834,8 @@ def update( script: t.Optional[t.Mapping[str, t.Any]] = None, scripted_upsert: t.Optional[bool] = None, source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, upsert: t.Optional[t.Mapping[str, t.Any]] = None, wait_for_active_shards: t.Optional[ @@ -4176,7 +3946,7 @@ def update( def update_by_query( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, analyzer: t.Optional[str] = None, @@ -4186,25 +3956,13 @@ def update_by_query( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -4229,8 +3987,8 @@ def update_by_query( ] = None, slice: t.Optional[t.Mapping[str, t.Any]] = None, slices: t.Optional[t.Union[int, t.Union["t.Literal['auto']", str]]] = None, - sort: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + sort: t.Optional[t.Sequence[str]] = None, + stats: t.Optional[t.Sequence[str]] = None, terminate_after: t.Optional[int] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, version: t.Optional[bool] = None, @@ -4241,8 +3999,9 @@ def update_by_query( wait_for_completion: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Performs an update on every document in the index without changing the source, - for example to pick up a mapping change. + Updates documents that match the specified query. If no query is specified, performs + an update on every document in the index without changing the source, for example + to pick up a mapping change. ``_ diff --git a/elasticsearch_serverless/_sync/client/async_search.py b/elasticsearch_serverless/_sync/client/async_search.py index 6934e6a..98e6e0a 100644 --- a/elasticsearch_serverless/_sync/client/async_search.py +++ b/elasticsearch_serverless/_sync/client/async_search.py @@ -24,15 +24,14 @@ class AsyncSearchClient(NamespacedClient): + @_rewrite_parameters() def delete( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -67,9 +66,7 @@ def get( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, pretty: t.Optional[bool] = None, @@ -129,9 +126,7 @@ def status( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -172,7 +167,7 @@ def status( def submit( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, allow_no_indices: t.Optional[bool] = None, @@ -184,53 +179,30 @@ def submit( collapse: t.Optional[t.Mapping[str, t.Any]] = None, default_operator: t.Optional[t.Union["t.Literal['and', 'or']", str]] = None, df: t.Optional[str] = None, - docvalue_fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docvalue_fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, ext: t.Optional[t.Mapping[str, t.Any]] = None, - fields: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + fields: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, highlight: t.Optional[t.Mapping[str, t.Any]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indices_boost: t.Optional[ - t.Union[t.List[t.Mapping[str, float]], t.Tuple[t.Mapping[str, float], ...]] - ] = None, + indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, keep_on_completion: t.Optional[bool] = None, knn: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, lenient: t.Optional[bool] = None, max_concurrent_shard_requests: t.Optional[int] = None, @@ -246,12 +218,7 @@ def submit( query: t.Optional[t.Mapping[str, t.Any]] = None, request_cache: t.Optional[bool] = None, rescore: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, rest_total_hits_as_int: t.Optional[bool] = None, routing: t.Optional[str] = None, @@ -259,10 +226,7 @@ def submit( script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, scroll: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, search_after: t.Optional[ - t.Union[ - t.List[t.Union[None, bool, float, int, str, t.Any]], - t.Tuple[t.Union[None, bool, float, int, str, t.Any], ...], - ] + t.Sequence[t.Union[None, bool, float, int, str, t.Any]] ] = None, search_type: t.Optional[ t.Union["t.Literal['dfs_query_then_fetch', 'query_then_fetch']", str] @@ -272,24 +236,15 @@ def submit( slice: t.Optional[t.Mapping[str, t.Any]] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None, - source_excludes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - source_includes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - stats: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - stored_fields: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + stats: t.Optional[t.Sequence[str]] = None, + stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None, suggest: t.Optional[t.Mapping[str, t.Any]] = None, suggest_field: t.Optional[str] = None, suggest_mode: t.Optional[ diff --git a/elasticsearch_serverless/_sync/client/cat.py b/elasticsearch_serverless/_sync/client/cat.py index 5edb42a..f1a2ef5 100644 --- a/elasticsearch_serverless/_sync/client/cat.py +++ b/elasticsearch_serverless/_sync/client/cat.py @@ -24,35 +24,24 @@ class CatClient(NamespacedClient): + @_rewrite_parameters() def aliases( self, *, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -60,7 +49,7 @@ def aliases( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: """ @@ -128,11 +117,9 @@ def component_templates( *, name: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -140,7 +127,7 @@ def component_templates( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: """ @@ -201,13 +188,11 @@ def component_templates( def count( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -215,7 +200,7 @@ def count( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]: """ @@ -279,11 +264,9 @@ def help( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -291,7 +274,7 @@ def help( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, v: t.Optional[bool] = None, ) -> TextApiResponse: """ @@ -347,34 +330,22 @@ def help( def indices( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, bytes: t.Optional[ t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, - h: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + h: t.Optional[t.Union[str, t.Sequence[str]]] = None, health: t.Optional[t.Union["t.Literal['green', 'red', 'yellow']", str]] = None, help: t.Optional[bool] = None, human: t.Optional[bool] = None, @@ -385,7 +356,7 @@ def indices( ] = None, pretty: t.Optional[bool] = None, pri: t.Optional[bool] = None, - s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + s: t.Optional[t.Union[str, t.Sequence[str]]] = None, time: t.Optional[ t.Union["t.Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's']", str] ] = None, @@ -477,31 +448,20 @@ def ml_data_frame_analytics( t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -513,25 +473,16 @@ def ml_data_frame_analytics( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']", - str, - ], - ..., - ], - ], ] ] = None, time: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -606,31 +557,20 @@ def ml_datafeeds( datafeed_id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", + str, + ] + ], t.Union[ "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -642,25 +582,16 @@ def ml_datafeeds( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", + str, + ] + ], t.Union[ "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']", - str, - ], - ..., - ], - ], ] ] = None, time: t.Optional[ @@ -743,31 +674,20 @@ def ml_jobs( t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -779,25 +699,16 @@ def ml_jobs( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", + str, + ] + ], t.Union[ "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']", - str, - ], - ..., - ], - ], ] ] = None, time: t.Optional[ @@ -884,32 +795,21 @@ def ml_trained_models( t.Union["t.Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb']", str] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, from_: t.Optional[int] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", + str, + ] + ], t.Union[ "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -921,25 +821,16 @@ def ml_trained_models( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", + str, + ] + ], t.Union[ "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']", - str, - ], - ..., - ], - ], ] ] = None, size: t.Optional[int] = None, @@ -1024,32 +915,21 @@ def transforms( transform_id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, from_: t.Optional[int] = None, h: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", + str, + ] + ], t.Union[ "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ], - ..., - ], - ], ] ] = None, help: t.Optional[bool] = None, @@ -1061,25 +941,16 @@ def transforms( pretty: t.Optional[bool] = None, s: t.Optional[ t.Union[ + t.Sequence[ + t.Union[ + "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", + str, + ] + ], t.Union[ "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", str, ], - t.Union[ - t.List[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']", - str, - ], - ..., - ], - ], ] ] = None, size: t.Optional[int] = None, diff --git a/elasticsearch_serverless/_sync/client/cluster.py b/elasticsearch_serverless/_sync/client/cluster.py index add324b..1830479 100644 --- a/elasticsearch_serverless/_sync/client/cluster.py +++ b/elasticsearch_serverless/_sync/client/cluster.py @@ -24,15 +24,14 @@ class ClusterClient(NamespacedClient): + @_rewrite_parameters() def delete_component_template( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -78,11 +77,9 @@ def delete_component_template( def exists_component_template( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, master_timeout: t.Optional[ @@ -131,9 +128,7 @@ def get_component_template( *, name: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, @@ -190,29 +185,17 @@ def info( self, *, target: t.Union[ - t.Union[ - "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + t.Sequence[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + ] ], t.Union[ - t.List[ - t.Union[ - "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", - str, - ], - ..., - ], + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str ], ], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -253,9 +236,7 @@ def put_component_template( allow_auto_create: t.Optional[bool] = None, create: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] diff --git a/elasticsearch_serverless/_sync/client/enrich.py b/elasticsearch_serverless/_sync/client/enrich.py index 337f2e8..03bc828 100644 --- a/elasticsearch_serverless/_sync/client/enrich.py +++ b/elasticsearch_serverless/_sync/client/enrich.py @@ -24,15 +24,14 @@ class EnrichClient(NamespacedClient): + @_rewrite_parameters() def delete_policy( self, *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -66,9 +65,7 @@ def execute_policy( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, wait_for_completion: t.Optional[bool] = None, @@ -105,11 +102,9 @@ def execute_policy( def get_policy( self, *, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -147,9 +142,7 @@ def put_policy( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, geo_match: t.Optional[t.Mapping[str, t.Any]] = None, human: t.Optional[bool] = None, match: t.Optional[t.Mapping[str, t.Any]] = None, @@ -197,9 +190,7 @@ def stats( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_sync/client/eql.py b/elasticsearch_serverless/_sync/client/eql.py index c6b314b..8ecf452 100644 --- a/elasticsearch_serverless/_sync/client/eql.py +++ b/elasticsearch_serverless/_sync/client/eql.py @@ -24,15 +24,14 @@ class EqlClient(NamespacedClient): + @_rewrite_parameters() def delete( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -69,9 +68,7 @@ def get( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, pretty: t.Optional[bool] = None, @@ -82,7 +79,7 @@ def get( """ Returns async results from previously executed Event Query Language (EQL) search - `< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html>`_ + ``_ :param id: Identifier for the search. :param keep_alive: Period for which the search and its results are stored on @@ -119,9 +116,7 @@ def get_status( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -129,7 +124,7 @@ def get_status( Returns the status of a previously submitted async or stored Event Query Language (EQL) search - `< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html>`_ + ``_ :param id: Identifier for the search. """ @@ -156,7 +151,7 @@ def get_status( def search( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], query: str, allow_no_indices: t.Optional[bool] = None, case_sensitive: t.Optional[bool] = None, @@ -164,42 +159,20 @@ def search( event_category_field: t.Optional[str] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, fetch_size: t.Optional[int] = None, fields: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, filter: t.Optional[ - t.Union[ - t.Mapping[str, t.Any], - t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], - ] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]] ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, diff --git a/elasticsearch_serverless/_sync/client/graph.py b/elasticsearch_serverless/_sync/client/graph.py index b362069..f86353a 100644 --- a/elasticsearch_serverless/_sync/client/graph.py +++ b/elasticsearch_serverless/_sync/client/graph.py @@ -24,27 +24,24 @@ class GraphClient(NamespacedClient): + @_rewrite_parameters( body_fields=True, ) def explore( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], connections: t.Optional[t.Mapping[str, t.Any]] = None, controls: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, routing: t.Optional[str] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, - vertices: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + vertices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, ) -> ObjectApiResponse[t.Any]: """ Explore extracted and summarized information about the documents and terms in diff --git a/elasticsearch_serverless/_sync/client/indices.py b/elasticsearch_serverless/_sync/client/indices.py index f0ebdb2..92fa84e 100644 --- a/elasticsearch_serverless/_sync/client/indices.py +++ b/elasticsearch_serverless/_sync/client/indices.py @@ -24,6 +24,7 @@ class IndicesClient(NamespacedClient): + @_rewrite_parameters() def add_block( self, @@ -34,25 +35,13 @@ def add_block( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + 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[ @@ -115,29 +104,17 @@ def analyze( *, index: t.Optional[str] = None, analyzer: t.Optional[str] = None, - attributes: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - char_filter: t.Optional[ - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ] - ] = None, + attributes: t.Optional[t.Sequence[str]] = None, + char_filter: t.Optional[t.Sequence[t.Union[str, t.Mapping[str, t.Any]]]] = None, error_trace: t.Optional[bool] = None, explain: t.Optional[bool] = None, field: t.Optional[str] = None, - filter: t.Optional[ - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ] - ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter: t.Optional[t.Sequence[t.Union[str, t.Mapping[str, t.Any]]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, normalizer: t.Optional[str] = None, pretty: t.Optional[bool] = None, - text: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + text: t.Optional[t.Union[str, t.Sequence[str]]] = None, tokenizer: t.Optional[t.Union[str, t.Mapping[str, t.Any]]] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -217,9 +194,7 @@ def create( index: str, aliases: 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.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, mappings: t.Optional[t.Mapping[str, t.Any]] = None, master_timeout: t.Optional[ @@ -291,9 +266,7 @@ def create_data_stream( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -333,25 +306,13 @@ def data_streams_stats( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -390,30 +351,18 @@ def data_streams_stats( def delete( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: 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[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + 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[ @@ -477,12 +426,10 @@ def delete( def delete_alias( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -532,29 +479,17 @@ def delete_alias( def delete_data_lifecycle( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -601,29 +536,17 @@ def delete_data_lifecycle( def delete_data_stream( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -660,11 +583,9 @@ def delete_data_stream( def delete_index_template( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -675,7 +596,7 @@ def delete_index_template( """ Deletes an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -710,30 +631,18 @@ def delete_index_template( def exists( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: 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[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -795,31 +704,19 @@ def exists( def exists_alias( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Union[str, t.Sequence[str]], + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -882,9 +779,7 @@ def exists_index_template( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -894,7 +789,7 @@ def exists_index_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -925,11 +820,9 @@ def exists_index_template( def explain_data_lifecycle( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, master_timeout: t.Optional[ @@ -973,44 +866,26 @@ def explain_data_lifecycle( def get( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: 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[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, features: t.Optional[ t.Union[ - t.Union["t.Literal['aliases', 'mappings', 'settings']", str], - t.Union[ - t.List[ - t.Union["t.Literal['aliases', 'mappings', 'settings']", str] - ], - t.Tuple[ - t.Union["t.Literal['aliases', 'mappings', 'settings']", str], - ..., - ], + t.Sequence[ + t.Union["t.Literal['aliases', 'mappings', 'settings']", str] ], + t.Union["t.Literal['aliases', 'mappings', 'settings']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -1086,31 +961,19 @@ def get( def get_alias( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -1172,29 +1035,17 @@ def get_alias( def get_data_lifecycle( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1237,29 +1088,17 @@ def get_data_lifecycle( def get_data_stream( self, *, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1305,9 +1144,7 @@ def get_index_template( *, name: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, @@ -1320,7 +1157,7 @@ def get_index_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -1364,30 +1201,18 @@ def get_index_template( def get_mapping( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, local: t.Optional[bool] = None, @@ -1451,31 +1276,19 @@ def get_mapping( def get_settings( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, - name: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, + name: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -1556,9 +1369,7 @@ def migrate_to_data_stream( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1592,13 +1403,9 @@ def migrate_to_data_stream( def modify_data_stream( self, *, - actions: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + actions: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1635,13 +1442,11 @@ def modify_data_stream( def put_alias( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], name: str, error_trace: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, index_routing: t.Optional[str] = None, is_write_index: t.Optional[bool] = None, @@ -1728,7 +1533,7 @@ def put_alias( def put_data_lifecycle( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], data_retention: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, @@ -1736,25 +1541,13 @@ def put_data_lifecycle( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -1825,17 +1618,13 @@ def put_index_template( self, *, name: str, - composed_of: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + composed_of: t.Optional[t.Sequence[str]] = None, create: t.Optional[bool] = None, data_stream: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - index_patterns: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None, meta: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, priority: t.Optional[int] = None, @@ -1845,7 +1634,7 @@ def put_index_template( """ Creates or updates an index template. - ``_ + ``_ :param name: Index or template name :param composed_of: An ordered list of component template names. Component templates @@ -1915,47 +1704,30 @@ def put_index_template( def put_mapping( self, *, - index: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + index: t.Union[str, t.Sequence[str]], allow_no_indices: t.Optional[bool] = None, date_detection: t.Optional[bool] = None, dynamic: t.Optional[ t.Union["t.Literal['false', 'runtime', 'strict', 'true']", str] ] = None, - dynamic_date_formats: t.Optional[ - t.Union[t.List[str], t.Tuple[str, ...]] - ] = None, + dynamic_date_formats: t.Optional[t.Sequence[str]] = None, dynamic_templates: t.Optional[ t.Union[ t.Mapping[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Mapping[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Mapping[str, t.Mapping[str, t.Any]], ...], - ], + t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]], ] ] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, field_names: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + 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[ @@ -2071,30 +1843,18 @@ def put_settings( self, *, settings: t.Mapping[str, t.Any], - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, @@ -2177,14 +1937,10 @@ def put_template( aliases: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None, create: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, - index_patterns: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None, mappings: t.Optional[t.Mapping[str, t.Any]] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -2198,7 +1954,7 @@ def put_template( """ Creates or updates an index template. - ``_ + ``_ :param name: The name of the template :param aliases: Aliases for the index. @@ -2263,30 +2019,18 @@ def put_template( def refresh( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_indices: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = 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, @@ -2337,29 +2081,17 @@ def refresh( def resolve_index( self, *, - name: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + name: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -2407,9 +2139,7 @@ def rollover( conditions: t.Optional[t.Mapping[str, t.Any]] = None, dry_run: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, mappings: t.Optional[t.Mapping[str, t.Any]] = None, master_timeout: t.Optional[ @@ -2497,90 +2227,36 @@ def rollover( "POST", __path, params=__query, headers=__headers, body=__body ) - @_rewrite_parameters( - body_fields=True, - parameter_aliases={"_meta": "meta"}, - ) + @_rewrite_parameters() def simulate_index_template( self, *, name: str, - allow_auto_create: t.Optional[bool] = None, - composed_of: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - create: t.Optional[bool] = None, - data_stream: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, include_defaults: t.Optional[bool] = None, - index_patterns: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, - meta: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, - priority: t.Optional[int] = None, - template: t.Optional[t.Mapping[str, t.Any]] = None, - version: t.Optional[int] = None, ) -> ObjectApiResponse[t.Any]: """ Simulate matching the given index name against the index templates in the system - ``_ + ``_ - :param name: Index or template name to simulate - :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` - cluster setting. If set to `true` in a template, then indices can be automatically - created using that template even if auto-creation of indices is disabled - via `actions.auto_create_index`. If set to `false`, then indices or data - streams matching the template must always be explicitly created, and may - never be automatically created. - :param composed_of: An ordered list of component template names. Component templates - are merged in the order specified, meaning that the last component template - specified has the highest precedence. - :param create: If `true`, the template passed in the body is only used if no - existing templates match the same index patterns. If `false`, the simulation - uses the template with the highest priority. Note that the template is not - permanently added or updated in either case; it is only used for the simulation. - :param data_stream: If this object is included, the template is used to create - data streams and their backing indices. Supports an empty object. Data streams - require a matching index template with a `data_stream` object. + :param name: Name of the index to simulate :param include_defaults: If true, returns all relevant default configurations for the index template. - :param index_patterns: Array of wildcard (`*`) expressions used to match the - names of data streams and indices during creation. :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 meta: Optional user metadata about the index template. May have any contents. - This map is not automatically generated by Elasticsearch. - :param priority: Priority to determine index template precedence when a new data - stream or index is created. The index template with the highest priority - is chosen. If no priority is specified the template is treated as though - it is of priority 0 (lowest priority). This number is not automatically generated - by Elasticsearch. - :param template: Template to be applied. It may optionally include an `aliases`, - `mappings`, or `settings` configuration. - :param version: Version number used to manage index templates externally. This - number is not automatically generated by Elasticsearch. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") __path = f"/_index_template/_simulate_index/{_quote(name)}" - __body: t.Dict[str, t.Any] = {} __query: t.Dict[str, t.Any] = {} - if allow_auto_create is not None: - __body["allow_auto_create"] = allow_auto_create - if composed_of is not None: - __body["composed_of"] = composed_of - if create is not None: - __query["create"] = create - if data_stream is not None: - __body["data_stream"] = data_stream if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -2589,90 +2265,130 @@ def simulate_index_template( __query["human"] = human if include_defaults is not None: __query["include_defaults"] = include_defaults - if index_patterns is not None: - __body["index_patterns"] = index_patterns if master_timeout is not None: __query["master_timeout"] = master_timeout - if meta is not None: - __body["_meta"] = meta if pretty is not None: __query["pretty"] = pretty - if priority is not None: - __body["priority"] = priority - if template is not None: - __body["template"] = template - if version is not None: - __body["version"] = version - if not __body: - __body = None # type: ignore[assignment] __headers = {"accept": "application/json"} - if __body is not None: - __headers["content-type"] = "application/json" return self.perform_request( # type: ignore[return-value] - "POST", __path, params=__query, headers=__headers, body=__body + "POST", __path, params=__query, headers=__headers ) @_rewrite_parameters( - body_name="template", + body_fields=True, + parameter_aliases={"_meta": "meta"}, ) def simulate_template( self, *, name: t.Optional[str] = None, + allow_auto_create: t.Optional[bool] = None, + composed_of: t.Optional[t.Sequence[str]] = None, create: t.Optional[bool] = None, + data_stream: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, + ignore_missing_component_templates: t.Optional[t.Sequence[str]] = None, include_defaults: t.Optional[bool] = None, + index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, + meta: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, + priority: t.Optional[int] = None, template: t.Optional[t.Mapping[str, t.Any]] = None, + version: t.Optional[int] = None, ) -> ObjectApiResponse[t.Any]: """ Simulate resolving the given template name or body - ``_ + ``_ :param name: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. + :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` + cluster setting. If set to `true` in a template, then indices can be automatically + created using that template even if auto-creation of indices is disabled + via `actions.auto_create_index`. If set to `false`, then indices or data + streams matching the template must always be explicitly created, and may + never be automatically created. + :param composed_of: An ordered list of component template names. Component templates + are merged in the order specified, meaning that the last component template + specified has the highest precedence. :param create: If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. + :param data_stream: If this object is included, the template is used to create + data streams and their backing indices. Supports an empty object. Data streams + require a matching index template with a `data_stream` object. + :param ignore_missing_component_templates: The configuration option ignore_missing_component_templates + can be used when an index template references a component template that might + not exist :param include_defaults: If true, returns all relevant default configurations for the index template. + :param index_patterns: Array of wildcard (`*`) expressions used to match the + names of data streams and indices during creation. :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 template: + :param meta: Optional user metadata about the index template. May have any contents. + This map is not automatically generated by Elasticsearch. + :param priority: Priority to determine index template precedence when a new data + stream or index is created. The index template with the highest priority + is chosen. If no priority is specified the template is treated as though + it is of priority 0 (lowest priority). This number is not automatically generated + by Elasticsearch. + :param template: Template to be applied. It may optionally include an `aliases`, + `mappings`, or `settings` configuration. + :param version: Version number used to manage index templates externally. This + number is not automatically generated by Elasticsearch. """ if name not in SKIP_IN_PATH: __path = f"/_index_template/_simulate/{_quote(name)}" else: __path = "/_index_template/_simulate" + __body: t.Dict[str, t.Any] = {} __query: t.Dict[str, t.Any] = {} + if allow_auto_create is not None: + __body["allow_auto_create"] = allow_auto_create + if composed_of is not None: + __body["composed_of"] = composed_of if create is not None: __query["create"] = create + if data_stream is not None: + __body["data_stream"] = data_stream 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 ignore_missing_component_templates is not None: + __body["ignore_missing_component_templates"] = ( + ignore_missing_component_templates + ) if include_defaults is not None: __query["include_defaults"] = include_defaults + if index_patterns is not None: + __body["index_patterns"] = index_patterns if master_timeout is not None: __query["master_timeout"] = master_timeout + if meta is not None: + __body["_meta"] = meta if pretty is not None: __query["pretty"] = pretty - __body = template + if priority is not None: + __body["priority"] = priority + if template is not None: + __body["template"] = template + if version is not None: + __body["version"] = version if not __body: - __body = None + __body = None # type: ignore[assignment] __headers = {"accept": "application/json"} if __body is not None: __headers["content-type"] = "application/json" @@ -2686,13 +2402,9 @@ def simulate_template( def update_aliases( self, *, - actions: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + actions: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -2740,7 +2452,7 @@ def update_aliases( def validate_query( self, *, - index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, + index: t.Optional[t.Union[str, t.Sequence[str]]] = None, all_shards: t.Optional[bool] = None, allow_no_indices: t.Optional[bool] = None, analyze_wildcard: t.Optional[bool] = None, @@ -2750,26 +2462,14 @@ def validate_query( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, explain: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, lenient: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_sync/client/inference.py b/elasticsearch_serverless/_sync/client/inference.py new file mode 100644 index 0000000..fd85a94 --- /dev/null +++ b/elasticsearch_serverless/_sync/client/inference.py @@ -0,0 +1,238 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import typing as t + +from elastic_transport import ObjectApiResponse + +from ._base import NamespacedClient +from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters + + +class InferenceClient(NamespacedClient): + + @_rewrite_parameters() + def delete_model( + self, + *, + inference_id: str, + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Delete model in the Inference API + + ``_ + + :param inference_id: The inference Id + :param task_type: The task type + """ + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __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 pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + def get_model( + self, + *, + inference_id: str, + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Get a model in the Inference API + + ``_ + + :param inference_id: The inference Id + :param task_type: The task type + """ + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __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 pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + body_fields=True, + ) + def inference( + self, + *, + inference_id: str, + input: t.Union[str, t.Sequence[str]], + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + query: t.Optional[str] = None, + task_settings: t.Optional[t.Any] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Perform inference on a model + + ``_ + + :param inference_id: The inference Id + :param input: Text input to the model. Either a string or an array of strings. + :param task_type: The task type + :param query: Query input, required for rerank task. Not required for other tasks. + :param task_settings: Optional task settings + """ + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if input is None: + raise ValueError("Empty value passed for parameter 'input'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if input is not None: + __body["input"] = input + 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 pretty is not None: + __query["pretty"] = pretty + if query is not None: + __body["query"] = query + if task_settings is not None: + __body["task_settings"] = task_settings + if not __body: + __body = None # type: ignore[assignment] + __headers = {"accept": "application/json"} + if __body is not None: + __headers["content-type"] = "application/json" + return self.perform_request( # type: ignore[return-value] + "POST", __path, params=__query, headers=__headers, body=__body + ) + + @_rewrite_parameters( + body_name="model_config", + ) + def put_model( + self, + *, + inference_id: str, + model_config: t.Mapping[str, t.Any], + task_type: t.Optional[ + t.Union[ + "t.Literal['completion', 'rerank', '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, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Configure a model for use in the Inference API + + ``_ + + :param inference_id: The inference Id + :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'") + if model_config is None: + raise ValueError("Empty value passed for parameter 'model_config'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") + __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 pretty is not None: + __query["pretty"] = pretty + __body = model_config + __headers = {"accept": "application/json", "content-type": "application/json"} + return self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch_serverless/_sync/client/ingest.py b/elasticsearch_serverless/_sync/client/ingest.py index c8255fc..cfcce36 100644 --- a/elasticsearch_serverless/_sync/client/ingest.py +++ b/elasticsearch_serverless/_sync/client/ingest.py @@ -24,15 +24,14 @@ class IngestClient(NamespacedClient): + @_rewrite_parameters() def delete_pipeline( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -80,9 +79,7 @@ def get_pipeline( *, id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] @@ -129,9 +126,7 @@ def processor_grok( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -165,22 +160,16 @@ def put_pipeline( id: str, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, if_version: t.Optional[int] = None, master_timeout: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, meta: t.Optional[t.Mapping[str, t.Any]] = None, - on_failure: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + on_failure: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, pretty: t.Optional[bool] = None, - processors: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + processors: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, version: t.Optional[int] = None, ) -> ObjectApiResponse[t.Any]: @@ -253,13 +242,9 @@ def simulate( self, *, id: t.Optional[str] = None, - docs: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pipeline: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_sync/client/license.py b/elasticsearch_serverless/_sync/client/license.py index 3faddf0..7ecca5b 100644 --- a/elasticsearch_serverless/_sync/client/license.py +++ b/elasticsearch_serverless/_sync/client/license.py @@ -24,15 +24,14 @@ class LicenseClient(NamespacedClient): + @_rewrite_parameters() def get( self, *, accept_enterprise: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, local: t.Optional[bool] = None, pretty: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_sync/client/logstash.py b/elasticsearch_serverless/_sync/client/logstash.py index 5726c1f..a51825e 100644 --- a/elasticsearch_serverless/_sync/client/logstash.py +++ b/elasticsearch_serverless/_sync/client/logstash.py @@ -24,15 +24,14 @@ class LogstashClient(NamespacedClient): + @_rewrite_parameters() def delete_pipeline( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -64,11 +63,9 @@ def delete_pipeline( def get_pipeline( self, *, - id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + id: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -79,8 +76,6 @@ def get_pipeline( :param id: Comma-separated list of pipeline identifiers. """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'id'") if id not in SKIP_IN_PATH: __path = f"/_logstash/pipeline/{_quote(id)}" else: @@ -108,9 +103,7 @@ def put_pipeline( id: str, pipeline: t.Mapping[str, t.Any], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_sync/client/ml.py b/elasticsearch_serverless/_sync/client/ml.py index bc184f8..27148a1 100644 --- a/elasticsearch_serverless/_sync/client/ml.py +++ b/elasticsearch_serverless/_sync/client/ml.py @@ -24,6 +24,7 @@ class MlClient(NamespacedClient): + @_rewrite_parameters( body_fields=True, ) @@ -33,9 +34,7 @@ def close_job( job_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -91,9 +90,7 @@ def delete_calendar( *, calendar_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -128,9 +125,7 @@ def delete_calendar_event( calendar_id: str, event_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -167,11 +162,9 @@ def delete_calendar_job( self, *, calendar_id: str, - job_id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + job_id: t.Union[str, t.Sequence[str]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -209,9 +202,7 @@ def delete_data_frame_analytics( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -254,9 +245,7 @@ def delete_datafeed( *, datafeed_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -298,9 +287,7 @@ def delete_filter( *, filter_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -335,9 +322,7 @@ def delete_job( job_id: str, delete_user_annotations: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -386,9 +371,7 @@ def delete_trained_model( *, model_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -429,9 +412,7 @@ def delete_trained_model_alias( model_id: str, model_alias: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -470,9 +451,7 @@ def estimate_model_memory( *, analysis_config: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_bucket_cardinality: t.Optional[t.Mapping[str, int]] = None, overall_cardinality: t.Optional[t.Mapping[str, int]] = None, @@ -529,9 +508,7 @@ def evaluate_data_frame( evaluation: t.Mapping[str, t.Any], index: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, @@ -583,9 +560,7 @@ def flush_job( calc_interim: t.Optional[bool] = None, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, skip_time: t.Optional[t.Union[str, t.Any]] = None, @@ -644,9 +619,7 @@ def get_calendar_events( calendar_id: str, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, job_id: t.Optional[str] = None, @@ -706,9 +679,7 @@ def get_calendars( *, calendar_id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, page: t.Optional[t.Mapping[str, t.Any]] = None, @@ -769,9 +740,7 @@ def get_data_frame_analytics( allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -834,9 +803,7 @@ def get_data_frame_analytics_stats( id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -893,14 +860,10 @@ def get_data_frame_analytics_stats( def get_datafeed_stats( self, *, - datafeed_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + datafeed_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -944,15 +907,11 @@ def get_datafeed_stats( def get_datafeeds( self, *, - datafeed_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + datafeed_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1003,13 +962,9 @@ def get_datafeeds( def get_filters( self, *, - filter_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1053,9 +1008,7 @@ def get_job_stats( job_id: t.Optional[str] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1100,15 +1053,11 @@ def get_job_stats( def get_jobs( self, *, - job_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + job_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1165,9 +1114,7 @@ def get_overall_buckets( end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, exclude_interim: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, overall_score: t.Optional[t.Union[float, str]] = None, pretty: t.Optional[bool] = None, @@ -1242,9 +1189,7 @@ def get_trained_models( decompress_definition: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, include: t.Optional[ @@ -1320,14 +1265,10 @@ def get_trained_models( def get_trained_models_stats( self, *, - model_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + model_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -1379,13 +1320,9 @@ def infer_trained_model( self, *, model_id: str, - docs: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + docs: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, inference_config: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -1439,9 +1376,7 @@ def open_job( *, job_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -1485,13 +1420,9 @@ def post_calendar_events( self, *, calendar_id: str, - events: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + events: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1536,9 +1467,7 @@ def preview_data_frame_analytics( id: t.Optional[str] = None, config: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1587,9 +1516,7 @@ def preview_datafeed( datafeed_config: t.Optional[t.Mapping[str, t.Any]] = None, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, job_config: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -1655,11 +1582,9 @@ def put_calendar( calendar_id: str, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - job_ids: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + job_ids: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -1704,9 +1629,7 @@ def put_calendar_job( calendar_id: str, job_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -1753,12 +1676,8 @@ def put_data_frame_analytics( analyzed_fields: t.Optional[t.Mapping[str, t.Any]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - headers: t.Optional[ - t.Mapping[str, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + headers: t.Optional[t.Mapping[str, t.Union[str, t.Sequence[str]]]] = None, human: t.Optional[bool] = None, max_num_threads: t.Optional[int] = None, model_memory_limit: t.Optional[str] = None, @@ -1884,38 +1803,20 @@ def put_datafeed( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, - headers: t.Optional[ - t.Mapping[str, t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] - ] = None, + headers: t.Optional[t.Mapping[str, t.Union[str, t.Sequence[str]]]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indexes: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - indices: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + indexes: t.Optional[t.Union[str, t.Sequence[str]]] = None, + indices: t.Optional[t.Union[str, t.Sequence[str]]] = None, indices_options: t.Optional[t.Mapping[str, t.Any]] = None, job_id: t.Optional[str] = None, max_empty_searches: t.Optional[int] = None, @@ -2065,11 +1966,9 @@ def put_filter( filter_id: str, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - items: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + items: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -2123,10 +2022,8 @@ def put_job( datafeed_config: t.Optional[t.Mapping[str, t.Any]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - groups: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + groups: t.Optional[t.Sequence[str]] = None, human: t.Optional[bool] = None, model_plot_config: t.Optional[t.Mapping[str, t.Any]] = None, model_snapshot_retention_days: t.Optional[int] = None, @@ -2279,9 +2176,7 @@ def put_trained_model( definition: t.Optional[t.Mapping[str, t.Any]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, inference_config: t.Optional[t.Mapping[str, t.Any]] = None, input: t.Optional[t.Mapping[str, t.Any]] = None, @@ -2290,8 +2185,11 @@ def put_trained_model( model_type: t.Optional[ t.Union["t.Literal['lang_ident', 'pytorch', 'tree_ensemble']", str] ] = None, + platform_architecture: t.Optional[str] = None, + prefix_strings: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, - tags: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + tags: t.Optional[t.Sequence[str]] = None, + wait_for_completion: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Creates an inference trained model. @@ -2318,7 +2216,18 @@ def put_trained_model( model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied. :param model_type: The model type. + :param platform_architecture: The platform architecture (if applicable) of the + trained mode. If the model only works on one platform, because it is heavily + optimized for a particular processor architecture and OS combination, then + this field specifies which. The format of the string must match the platform + identifiers used by Elasticsearch, so one of, `linux-x86_64`, `linux-aarch64`, + `darwin-x86_64`, `darwin-aarch64`, or `windows-x86_64`. For portable models + (those that work independent of processor architecture or OS features), leave + this field unset. + :param prefix_strings: Optional prefix strings applied at inference :param tags: An array of tags to organize the model. + :param wait_for_completion: Whether to wait for all child operations (e.g. model + download) to complete. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -2349,10 +2258,16 @@ def put_trained_model( __body["model_size_bytes"] = model_size_bytes if model_type is not None: __body["model_type"] = model_type + if platform_architecture is not None: + __body["platform_architecture"] = platform_architecture + if prefix_strings is not None: + __body["prefix_strings"] = prefix_strings if pretty is not None: __query["pretty"] = pretty if tags is not None: __body["tags"] = tags + if wait_for_completion is not None: + __query["wait_for_completion"] = wait_for_completion __headers = {"accept": "application/json", "content-type": "application/json"} return self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body @@ -2365,9 +2280,7 @@ def put_trained_model_alias( model_id: str, model_alias: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, reassign: t.Optional[bool] = None, @@ -2417,9 +2330,7 @@ def put_trained_model_definition_part( total_definition_length: int, total_parts: int, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -2480,14 +2391,13 @@ def put_trained_model_vocabulary( self, *, model_id: str, - vocabulary: t.Union[t.List[str], t.Tuple[str, ...]], + vocabulary: t.Sequence[str], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - merges: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + merges: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, + scores: t.Optional[t.Sequence[float]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a trained model vocabulary @@ -2497,6 +2407,7 @@ def put_trained_model_vocabulary( :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. :param merges: The optional model merges if required by the tokenizer. + :param scores: The optional vocabulary value scores if required by the tokenizer. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -2517,6 +2428,8 @@ def put_trained_model_vocabulary( __body["merges"] = merges if pretty is not None: __query["pretty"] = pretty + if scores is not None: + __body["scores"] = scores __headers = {"accept": "application/json", "content-type": "application/json"} return self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body @@ -2529,9 +2442,7 @@ def reset_job( job_id: str, delete_user_annotations: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, wait_for_completion: t.Optional[bool] = None, @@ -2575,9 +2486,7 @@ def start_data_frame_analytics( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -2621,9 +2530,7 @@ def start_datafeed( datafeed_id: str, end: t.Optional[t.Union[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, start: t.Optional[t.Union[str, t.Any]] = None, @@ -2676,10 +2583,9 @@ def start_trained_model_deployment( *, model_id: str, cache_size: t.Optional[t.Union[int, str]] = None, + deployment_id: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, number_of_allocations: t.Optional[int] = None, pretty: t.Optional[bool] = None, @@ -2701,6 +2607,7 @@ def start_trained_model_deployment( :param cache_size: The inference cache size (in memory outside the JVM heap) per node for the model. The default value is the same size as the `model_size_bytes`. To disable the cache, `0b` can be provided. + :param deployment_id: A unique identifier for the deployment of the model. :param number_of_allocations: The number of model allocations on each node where the model is deployed. All allocations on a node share the same copy of the model in memory but use a separate set of threads to evaluate the model. @@ -2727,6 +2634,8 @@ def start_trained_model_deployment( __query: t.Dict[str, t.Any] = {} if cache_size is not None: __query["cache_size"] = cache_size + if deployment_id is not None: + __query["deployment_id"] = deployment_id if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -2759,9 +2668,7 @@ def stop_data_frame_analytics( id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -2819,9 +2726,7 @@ def stop_datafeed( datafeed_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -2876,9 +2781,7 @@ def stop_trained_model_deployment( model_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -2930,9 +2833,7 @@ def update_data_frame_analytics( allow_lazy_start: t.Optional[bool] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, max_num_threads: t.Optional[int] = None, model_memory_limit: t.Optional[str] = None, @@ -2999,31 +2900,19 @@ def update_datafeed( error_trace: t.Optional[bool] = None, expand_wildcards: t.Optional[ t.Union[ - t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'closed', 'hidden', 'none', 'open']", str - ], - ..., - ], + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], ] ] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, ignore_throttled: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, - indexes: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - indices: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + indexes: t.Optional[t.Sequence[str]] = None, + indices: t.Optional[t.Sequence[str]] = None, indices_options: t.Optional[t.Mapping[str, t.Any]] = None, job_id: t.Optional[str] = None, max_empty_searches: t.Optional[int] = None, @@ -3180,15 +3069,13 @@ def update_filter( self, *, filter_id: str, - add_items: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + add_items: t.Optional[t.Sequence[str]] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, - remove_items: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + remove_items: t.Optional[t.Sequence[str]] = None, ) -> ObjectApiResponse[t.Any]: """ Updates the description of a filter, adds items, or removes items. @@ -3236,20 +3123,14 @@ def update_job( background_persist_interval: t.Optional[ t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, - categorization_filters: t.Optional[ - t.Union[t.List[str], t.Tuple[str, ...]] - ] = None, + categorization_filters: t.Optional[t.Sequence[str]] = None, custom_settings: t.Optional[t.Mapping[str, t.Any]] = None, daily_model_snapshot_retention_after_days: t.Optional[int] = None, description: t.Optional[str] = None, - detectors: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + detectors: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, - groups: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + groups: t.Optional[t.Sequence[str]] = None, human: t.Optional[bool] = None, model_plot_config: t.Optional[t.Mapping[str, t.Any]] = None, model_prune_window: t.Optional[ diff --git a/elasticsearch_serverless/_sync/client/query_ruleset.py b/elasticsearch_serverless/_sync/client/query_ruleset.py index 6680028..33b09b5 100644 --- a/elasticsearch_serverless/_sync/client/query_ruleset.py +++ b/elasticsearch_serverless/_sync/client/query_ruleset.py @@ -24,15 +24,14 @@ class QueryRulesetClient(NamespacedClient): + @_rewrite_parameters() def delete( self, *, ruleset_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -66,9 +65,7 @@ def get( *, ruleset_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -103,9 +100,7 @@ def list( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -145,13 +140,9 @@ def put( self, *, ruleset_id: str, - rules: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + rules: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_sync/client/search_application.py b/elasticsearch_serverless/_sync/client/search_application.py index 17bfd3b..646b520 100644 --- a/elasticsearch_serverless/_sync/client/search_application.py +++ b/elasticsearch_serverless/_sync/client/search_application.py @@ -24,22 +24,21 @@ class SearchApplicationClient(NamespacedClient): + @_rewrite_parameters() def delete( self, *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Deletes a search application. - ``_ + ``_ :param name: The name of the search application to delete """ @@ -66,9 +65,7 @@ def delete_behavioral_analytics( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -102,9 +99,7 @@ def get( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -136,11 +131,9 @@ def get( def get_behavioral_analytics( self, *, - name: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + name: t.Optional[t.Sequence[str]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -176,9 +169,7 @@ def list( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -225,9 +216,7 @@ def put( search_application: t.Mapping[str, t.Any], create: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -269,9 +258,7 @@ def put_behavioral_analytics( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -308,9 +295,7 @@ def search( *, name: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, params: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, diff --git a/elasticsearch_serverless/_sync/client/security.py b/elasticsearch_serverless/_sync/client/security.py index f8b6134..a10b079 100644 --- a/elasticsearch_serverless/_sync/client/security.py +++ b/elasticsearch_serverless/_sync/client/security.py @@ -24,14 +24,13 @@ class SecurityClient(NamespacedClient): + @_rewrite_parameters() def authenticate( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -64,9 +63,7 @@ def create_api_key( *, error_trace: t.Optional[bool] = None, expiration: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, metadata: t.Optional[t.Mapping[str, t.Any]] = None, name: t.Optional[str] = None, @@ -129,10 +126,9 @@ def create_api_key( def get_api_key( self, *, + active_only: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, id: t.Optional[str] = None, name: t.Optional[str] = None, @@ -141,12 +137,18 @@ def get_api_key( realm_name: t.Optional[str] = None, username: t.Optional[str] = None, with_limited_by: t.Optional[bool] = None, + with_profile_uid: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Retrieves information for one or more API keys. ``_ + :param active_only: A boolean flag that can be used to query API keys that are + currently active. An API key is considered active if it is neither invalidated, + nor expired at query time. You can specify this together with other parameters + such as `owner` or `name`. If `active_only` is false, the response will include + both active and inactive (expired or invalidated) keys. :param id: An API key id. This parameter cannot be used with any of `name`, `realm_name` or `username`. :param name: An API key name. This parameter cannot be used with any of `id`, @@ -162,9 +164,13 @@ def get_api_key( :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. + :param with_profile_uid: Determines whether to also retrieve the profile uid, + for the API key owner principal, if it exists. """ __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} + if active_only is not None: + __query["active_only"] = active_only if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -185,6 +191,8 @@ def get_api_key( __query["username"] = username if with_limited_by is not None: __query["with_limited_by"] = with_limited_by + if with_profile_uid is not None: + __query["with_profile_uid"] = with_profile_uid __headers = {"accept": "application/json"} return self.perform_request( # type: ignore[return-value] "GET", __path, params=__query, headers=__headers @@ -197,34 +205,19 @@ def has_privileges( self, *, user: t.Optional[str] = None, - application: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + application: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, cluster: t.Optional[ - t.Union[ - t.List[ - t.Union[ - "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']", - str, - ] - ], - t.Tuple[ - t.Union[ - "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']", - str, - ], - ..., - ], + t.Sequence[ + t.Union[ + "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']", + str, + ] ] ] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - index: t.Optional[ - t.Union[t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...]] - ] = None, + index: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ @@ -269,12 +262,10 @@ def invalidate_api_key( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, id: t.Optional[str] = None, - ids: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, + ids: t.Optional[t.Sequence[str]] = None, name: t.Optional[str] = None, owner: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -335,44 +326,55 @@ def invalidate_api_key( 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.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, query: t.Optional[t.Mapping[str, t.Any]] = None, search_after: t.Optional[ - t.Union[ - t.List[t.Union[None, bool, float, int, str, t.Any]], - t.Tuple[t.Union[None, bool, float, int, str, t.Any], ...], - ] + t.Sequence[t.Union[None, bool, float, int, str, t.Any]] ] = None, size: t.Optional[int] = None, sort: t.Optional[ t.Union[ + t.Sequence[t.Union[str, t.Mapping[str, t.Any]]], t.Union[str, t.Mapping[str, t.Any]], - t.Union[ - t.List[t.Union[str, t.Mapping[str, t.Any]]], - t.Tuple[t.Union[str, t.Mapping[str, t.Any]], ...], - ], ] ] = None, + typed_keys: t.Optional[bool] = None, with_limited_by: t.Optional[bool] = None, + with_profile_uid: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ Retrieves information for API keys using a subset of query DSL ``_ + :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 @@ -380,13 +382,17 @@ def query_api_keys( :param sort: Other than `id`, all public fields of an API key are eligible for sorting. In addition, sort can also be applied to the `_doc` field to sort by index order. + :param typed_keys: Determines whether aggregation names are prefixed by their + respective types in the response. :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. + :param with_profile_uid: Determines whether to also retrieve the profile uid, + for the API key owner principal, if it exists. """ __path = "/_security/_query/api_key" - __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} # The 'sort' parameter with a colon can't be encoded to the body. if sort is not None and ( (isinstance(sort, str) and ":" in sort) @@ -398,6 +404,10 @@ def query_api_keys( ): __query["sort"] = sort sort = None + if aggregations is not None: + __body["aggregations"] = aggregations + if aggs is not None: + __body["aggs"] = aggs if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -416,8 +426,12 @@ def query_api_keys( __body["size"] = size if sort is not None: __body["sort"] = sort + if typed_keys is not None: + __query["typed_keys"] = typed_keys if with_limited_by is not None: __query["with_limited_by"] = with_limited_by + if with_profile_uid is not None: + __query["with_profile_uid"] = with_profile_uid if not __body: __body = None # type: ignore[assignment] __headers = {"accept": "application/json"} @@ -435,9 +449,8 @@ def update_api_key( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + expiration: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, metadata: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -449,6 +462,7 @@ def update_api_key( ``_ :param id: The ID of the API key to update. + :param expiration: Expiration time for the API key. :param metadata: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage. @@ -468,6 +482,8 @@ def update_api_key( __body: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace + if expiration is not None: + __body["expiration"] = expiration if filter_path is not None: __query["filter_path"] = filter_path if human is not None: diff --git a/elasticsearch_serverless/_sync/client/sql.py b/elasticsearch_serverless/_sync/client/sql.py index 4f8b37e..8ef750a 100644 --- a/elasticsearch_serverless/_sync/client/sql.py +++ b/elasticsearch_serverless/_sync/client/sql.py @@ -24,6 +24,7 @@ class SqlClient(NamespacedClient): + @_rewrite_parameters( body_fields=True, ) @@ -32,9 +33,7 @@ def clear_cursor( *, cursor: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -71,9 +70,7 @@ def delete_async( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -109,9 +106,7 @@ def get_async( id: str, delimiter: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, human: t.Optional[bool] = None, keep_alive: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -168,9 +163,7 @@ def get_async_status( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -213,9 +206,7 @@ def query( fetch_size: t.Optional[int] = None, field_multi_value_leniency: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, format: t.Optional[str] = None, human: t.Optional[bool] = None, index_using_frozen: t.Optional[bool] = None, @@ -330,9 +321,7 @@ def translate( error_trace: t.Optional[bool] = None, fetch_size: t.Optional[int] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, time_zone: t.Optional[str] = None, diff --git a/elasticsearch_serverless/_sync/client/synonyms.py b/elasticsearch_serverless/_sync/client/synonyms.py index 6fcec2e..07f0812 100644 --- a/elasticsearch_serverless/_sync/client/synonyms.py +++ b/elasticsearch_serverless/_sync/client/synonyms.py @@ -24,15 +24,14 @@ class SynonymsClient(NamespacedClient): + @_rewrite_parameters() def delete_synonym( self, *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -67,9 +66,7 @@ def delete_synonym_rule( set_id: str, rule_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -108,9 +105,7 @@ def get_synonym( *, id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -153,9 +148,7 @@ def get_synonym_rule( set_id: str, rule_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -193,9 +186,7 @@ def get_synonyms_sets( self, *, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -235,13 +226,9 @@ def put_synonym( self, *, id: str, - synonyms_set: t.Union[ - t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] - ], + synonyms_set: t.Sequence[t.Mapping[str, t.Any]], error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: @@ -283,11 +270,9 @@ def put_synonym_rule( *, set_id: str, rule_id: str, - synonyms: t.Union[t.List[str], t.Tuple[str, ...]], + synonyms: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: diff --git a/elasticsearch_serverless/_sync/client/tasks.py b/elasticsearch_serverless/_sync/client/tasks.py index dd166b7..078e850 100644 --- a/elasticsearch_serverless/_sync/client/tasks.py +++ b/elasticsearch_serverless/_sync/client/tasks.py @@ -24,15 +24,14 @@ class TasksClient(NamespacedClient): + @_rewrite_parameters() def get( self, *, task_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, diff --git a/elasticsearch_serverless/_sync/client/transform.py b/elasticsearch_serverless/_sync/client/transform.py index a5be968..ac0776f 100644 --- a/elasticsearch_serverless/_sync/client/transform.py +++ b/elasticsearch_serverless/_sync/client/transform.py @@ -24,15 +24,15 @@ class TransformClient(NamespacedClient): + @_rewrite_parameters() def delete_transform( self, *, transform_id: str, + delete_dest_index: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -44,6 +44,9 @@ def delete_transform( ``_ :param transform_id: Identifier for the transform. + :param delete_dest_index: If this value is true, the destination index is deleted + together with the transform. If false, the destination index will not be + deleted :param force: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state. @@ -54,6 +57,8 @@ def delete_transform( raise ValueError("Empty value passed for parameter 'transform_id'") __path = f"/_transform/{_quote(transform_id)}" __query: t.Dict[str, t.Any] = {} + if delete_dest_index is not None: + __query["delete_dest_index"] = delete_dest_index if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -77,15 +82,11 @@ def delete_transform( def get_transform( self, *, - transform_id: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + transform_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, exclude_generated: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -142,12 +143,10 @@ def get_transform( def get_transform_stats( self, *, - transform_id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]], + transform_id: t.Union[str, t.Sequence[str]], allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[int] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -206,9 +205,7 @@ def preview_transform( description: t.Optional[str] = None, dest: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, latest: t.Optional[t.Mapping[str, t.Any]] = None, @@ -303,9 +300,7 @@ def put_transform( defer_validation: t.Optional[bool] = None, description: t.Optional[str] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, latest: t.Optional[t.Mapping[str, t.Any]] = None, @@ -404,9 +399,7 @@ def reset_transform( *, transform_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -448,9 +441,7 @@ def schedule_now_transform( *, transform_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, @@ -490,9 +481,7 @@ def start_transform( *, transform_id: str, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, from_: t.Optional[str] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -538,9 +527,7 @@ def stop_transform( transform_id: str, allow_no_match: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, human: t.Optional[bool] = None, pretty: t.Optional[bool] = None, @@ -614,9 +601,7 @@ def update_transform( description: t.Optional[str] = None, dest: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, - filter_path: t.Optional[ - t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] - ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, frequency: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, human: t.Optional[bool] = None, meta: t.Optional[t.Mapping[str, t.Any]] = None, diff --git a/elasticsearch_serverless/client.py b/elasticsearch_serverless/client.py index 802268b..80e1667 100644 --- a/elasticsearch_serverless/client.py +++ b/elasticsearch_serverless/client.py @@ -27,6 +27,7 @@ from ._sync.client.eql import EqlClient as EqlClient # noqa: F401 from ._sync.client.graph import GraphClient as GraphClient # noqa: F401 from ._sync.client.indices import IndicesClient as IndicesClient # noqa: F401 +from ._sync.client.inference import InferenceClient as InferenceClient # noqa: F401 from ._sync.client.ingest import IngestClient as IngestClient # noqa: F401 from ._sync.client.license import LicenseClient as LicenseClient # noqa: F401 from ._sync.client.logstash import LogstashClient as LogstashClient # noqa: F401 @@ -58,6 +59,7 @@ "EqlClient", "GraphClient", "IndicesClient", + "InferenceClient", "IngestClient", "LicenseClient", "LogstashClient",