diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index 4143b4a1..279fda37 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -39,7 +39,7 @@ from __future__ import unicode_literals import logging -from typing import Any, Optional, Type +from typing import Any, Type from ..transport import AsyncTransport, TransportError from .cat import CatClient @@ -357,7 +357,7 @@ async def index( self, index: Any, body: Any, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -420,7 +420,7 @@ async def index( async def bulk( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -470,7 +470,7 @@ async def bulk( async def clear_scroll( self, body: Any = None, - scroll_id: Optional[Any] = None, + scroll_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -512,7 +512,7 @@ async def clear_scroll( async def count( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -970,7 +970,7 @@ async def explain( async def field_caps( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1143,7 +1143,7 @@ async def get_source( async def mget( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1194,7 +1194,7 @@ async def mget( async def msearch( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1252,7 +1252,7 @@ async def msearch( async def msearch_template( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1306,7 +1306,7 @@ async def msearch_template( async def mtermvectors( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1361,7 +1361,7 @@ async def put_script( self, id: Any, body: Any, - context: Optional[Any] = None, + context: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1397,7 +1397,7 @@ async def put_script( async def rank_eval( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1512,7 +1512,7 @@ async def reindex_rethrottle( async def render_search_template( self, body: Any = None, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1556,7 +1556,7 @@ async def scripts_painless_execute( async def scroll( self, body: Any = None, - scroll_id: Optional[Any] = None, + scroll_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1631,7 +1631,7 @@ async def scroll( async def search( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1756,7 +1756,7 @@ async def search( ) async def search_shards( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1803,7 +1803,7 @@ async def search_shards( async def search_template( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1872,7 +1872,7 @@ async def termvectors( self, index: Any, body: Any = None, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/cat.py b/opensearchpy/_async/client/cat.py index 8371c2c9..4310511c 100644 --- a/opensearchpy/_async/client/cat.py +++ b/opensearchpy/_async/client/cat.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import NamespacedClient, _make_path, query_params @@ -45,7 +45,7 @@ class CatClient(NamespacedClient): @query_params("expand_wildcards", "format", "h", "help", "local", "s", "v") async def aliases( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -99,7 +99,7 @@ async def all_pit_segments( ) async def allocation( self, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -175,7 +175,7 @@ async def cluster_manager( @query_params("format", "h", "help", "s", "v") async def count( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -201,7 +201,7 @@ async def count( @query_params("bytes", "format", "h", "help", "s", "v") async def fielddata( self, - fields: Optional[Any] = None, + fields: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -290,7 +290,7 @@ async def help( ) async def indices( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -564,7 +564,7 @@ async def plugins( ) async def recovery( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -647,7 +647,7 @@ async def repositories( ) async def segment_replication( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -696,7 +696,7 @@ async def segment_replication( ) async def segments( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -739,7 +739,7 @@ async def segments( ) async def shards( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -785,7 +785,7 @@ async def shards( ) async def thread_pool( self, - thread_pool_patterns: Optional[Any] = None, + thread_pool_patterns: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -832,7 +832,7 @@ async def thread_pool( ) async def snapshots( self, - repository: Optional[Any] = None, + repository: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -924,7 +924,7 @@ async def tasks( ) async def templates( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/cluster.py b/opensearchpy/_async/client/cluster.py index ac4b1493..905853e9 100644 --- a/opensearchpy/_async/client/cluster.py +++ b/opensearchpy/_async/client/cluster.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -59,7 +59,7 @@ class ClusterClient(NamespacedClient): ) async def health( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -141,8 +141,8 @@ async def pending_tasks( ) async def state( self, - metric: Optional[Any] = None, - index: Optional[Any] = None, + metric: Any = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -190,7 +190,7 @@ async def state( @query_params("flat_settings", "timeout") async def stats( self, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -389,7 +389,7 @@ async def delete_component_template( @query_params("cluster_manager_timeout", "local", "master_timeout") async def get_component_template( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index e1874deb..a4ef8b5b 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -46,7 +46,7 @@ class IndicesClient(NamespacedClient): async def analyze( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -70,7 +70,7 @@ async def analyze( @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") async def refresh( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -102,7 +102,7 @@ async def refresh( ) async def flush( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -441,7 +441,7 @@ async def exists( async def put_mapping( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -493,7 +493,7 @@ async def put_mapping( ) async def get_mapping( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -533,7 +533,7 @@ async def get_mapping( async def get_field_mapping( self, fields: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -607,7 +607,7 @@ async def put_alias( async def exists_alias( self, name: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -638,8 +638,8 @@ async def exists_alias( @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") async def get_alias( self, - index: Optional[Any] = None, - name: Optional[Any] = None, + index: Any = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -790,7 +790,7 @@ async def exists_template( @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") async def get_template( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -851,8 +851,8 @@ async def delete_template( ) async def get_settings( self, - index: Optional[Any] = None, - name: Optional[Any] = None, + index: Any = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -900,7 +900,7 @@ async def get_settings( async def put_settings( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -955,8 +955,8 @@ async def put_settings( ) async def stats( self, - index: Optional[Any] = None, - metric: Optional[Any] = None, + index: Any = None, + metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1002,7 +1002,7 @@ async def stats( ) async def segments( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1044,7 +1044,7 @@ async def segments( async def validate_query( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1098,7 +1098,7 @@ async def validate_query( ) async def clear_cache( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1129,7 +1129,7 @@ async def clear_cache( @query_params("active_only", "detailed") async def recovery( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1157,7 +1157,7 @@ async def recovery( ) async def upgrade( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1187,7 +1187,7 @@ async def upgrade( @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") async def get_upgrade( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1215,7 +1215,7 @@ async def get_upgrade( ) async def shard_stores( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1250,7 +1250,7 @@ async def shard_stores( ) async def forcemerge( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1383,7 +1383,7 @@ async def rollover( self, alias: Any, body: Any = None, - new_index: Optional[Any] = None, + new_index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1528,7 +1528,7 @@ async def exists_index_template( @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") async def get_index_template( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1629,7 +1629,7 @@ async def simulate_index_template( @query_params() async def get_data_stream( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1648,7 +1648,7 @@ async def get_data_stream( async def simulate_template( self, body: Any = None, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1750,7 +1750,7 @@ async def add_block( @query_params() async def data_streams_stats( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/ingest.py b/opensearchpy/_async/client/ingest.py index 587cab9d..2f8cff27 100644 --- a/opensearchpy/_async/client/ingest.py +++ b/opensearchpy/_async/client/ingest.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -45,7 +45,7 @@ class IngestClient(NamespacedClient): @query_params("cluster_manager_timeout", "master_timeout") async def get_pipeline( self, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -131,7 +131,7 @@ async def delete_pipeline( async def simulate( self, body: Any, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/nodes.py b/opensearchpy/_async/client/nodes.py index 3021524a..36146fad 100644 --- a/opensearchpy/_async/client/nodes.py +++ b/opensearchpy/_async/client/nodes.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import NamespacedClient, _make_path, query_params @@ -46,7 +46,7 @@ class NodesClient(NamespacedClient): async def reload_secure_settings( self, body: Any = None, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -72,8 +72,8 @@ async def reload_secure_settings( @query_params("flat_settings", "timeout") async def info( self, - node_id: Optional[Any] = None, - metric: Optional[Any] = None, + node_id: Any = None, + metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -108,9 +108,9 @@ async def info( ) async def stats( self, - node_id: Optional[Any] = None, - metric: Optional[Any] = None, - index_metric: Optional[Any] = None, + node_id: Any = None, + metric: Any = None, + index_metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -159,7 +159,7 @@ async def stats( ) async def hot_threads( self, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -197,8 +197,8 @@ async def hot_threads( @query_params("timeout") async def usage( self, - node_id: Optional[Any] = None, - metric: Optional[Any] = None, + node_id: Any = None, + metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/security.py b/opensearchpy/_async/client/security.py index dd63abfb..dc893f86 100644 --- a/opensearchpy/_async/client/security.py +++ b/opensearchpy/_async/client/security.py @@ -18,7 +18,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -801,7 +801,7 @@ async def patch_configuration( @query_params() async def get_distinguished_names( self, - cluster_name: Optional[Any] = None, + cluster_name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/snapshot.py b/opensearchpy/_async/client/snapshot.py index 1a544ddb..97ffec72 100644 --- a/opensearchpy/_async/client/snapshot.py +++ b/opensearchpy/_async/client/snapshot.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -180,7 +180,7 @@ async def delete_repository( @query_params("cluster_manager_timeout", "local", "master_timeout") async def get_repository( self, - repository: Optional[Any] = None, + repository: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -274,8 +274,8 @@ async def restore( @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") async def status( self, - repository: Optional[Any] = None, - snapshot: Optional[Any] = None, + repository: Any = None, + snapshot: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/_async/client/tasks.py b/opensearchpy/_async/client/tasks.py index 78deb4a9..39aefe93 100644 --- a/opensearchpy/_async/client/tasks.py +++ b/opensearchpy/_async/client/tasks.py @@ -37,7 +37,7 @@ import warnings -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -84,7 +84,7 @@ async def list( @query_params("actions", "nodes", "parent_task_id", "wait_for_completion") async def cancel( self, - task_id: Optional[Any] = None, + task_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -115,7 +115,7 @@ async def cancel( @query_params("timeout", "wait_for_completion") async def get( self, - task_id: Optional[Any] = None, + task_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 6f0c54b0..05af6764 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -39,7 +39,7 @@ from __future__ import unicode_literals import logging -from typing import Any, Optional, Type +from typing import Any, Type from ..transport import Transport, TransportError from .cat import CatClient @@ -357,7 +357,7 @@ def index( self, index: Any, body: Any, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -420,7 +420,7 @@ def index( def bulk( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -470,7 +470,7 @@ def bulk( def clear_scroll( self, body: Any = None, - scroll_id: Optional[Any] = None, + scroll_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -512,7 +512,7 @@ def clear_scroll( def count( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -970,7 +970,7 @@ def explain( def field_caps( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1143,7 +1143,7 @@ def get_source( def mget( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1194,7 +1194,7 @@ def mget( def msearch( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1252,7 +1252,7 @@ def msearch( def msearch_template( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1306,7 +1306,7 @@ def msearch_template( def mtermvectors( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1361,7 +1361,7 @@ def put_script( self, id: Any, body: Any, - context: Optional[Any] = None, + context: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1397,7 +1397,7 @@ def put_script( def rank_eval( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1512,7 +1512,7 @@ def reindex_rethrottle( def render_search_template( self, body: Any = None, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1556,7 +1556,7 @@ def scripts_painless_execute( def scroll( self, body: Any = None, - scroll_id: Optional[Any] = None, + scroll_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1631,7 +1631,7 @@ def scroll( def search( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1756,7 +1756,7 @@ def search( ) def search_shards( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1803,7 +1803,7 @@ def search_shards( def search_template( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1872,7 +1872,7 @@ def termvectors( self, index: Any, body: Any = None, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/cat.py b/opensearchpy/client/cat.py index 01455e9c..91adbf35 100644 --- a/opensearchpy/client/cat.py +++ b/opensearchpy/client/cat.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import NamespacedClient, _make_path, query_params @@ -45,7 +45,7 @@ class CatClient(NamespacedClient): @query_params("expand_wildcards", "format", "h", "help", "local", "s", "v") def aliases( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -99,7 +99,7 @@ def all_pit_segments( ) def allocation( self, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -175,7 +175,7 @@ def cluster_manager( @query_params("format", "h", "help", "s", "v") def count( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -201,7 +201,7 @@ def count( @query_params("bytes", "format", "h", "help", "s", "v") def fielddata( self, - fields: Optional[Any] = None, + fields: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -290,7 +290,7 @@ def help( ) def indices( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -564,7 +564,7 @@ def plugins( ) def recovery( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -647,7 +647,7 @@ def repositories( ) def segment_replication( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -696,7 +696,7 @@ def segment_replication( ) def segments( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -739,7 +739,7 @@ def segments( ) def shards( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -785,7 +785,7 @@ def shards( ) def thread_pool( self, - thread_pool_patterns: Optional[Any] = None, + thread_pool_patterns: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -832,7 +832,7 @@ def thread_pool( ) def snapshots( self, - repository: Optional[Any] = None, + repository: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -924,7 +924,7 @@ def tasks( ) def templates( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/cluster.py b/opensearchpy/client/cluster.py index a3bc1596..f2770f2d 100644 --- a/opensearchpy/client/cluster.py +++ b/opensearchpy/client/cluster.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -59,7 +59,7 @@ class ClusterClient(NamespacedClient): ) def health( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -141,8 +141,8 @@ def pending_tasks( ) def state( self, - metric: Optional[Any] = None, - index: Optional[Any] = None, + metric: Any = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -190,7 +190,7 @@ def state( @query_params("flat_settings", "timeout") def stats( self, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -389,7 +389,7 @@ def delete_component_template( @query_params("cluster_manager_timeout", "local", "master_timeout") def get_component_template( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index 52573409..7cdc7e57 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -46,7 +46,7 @@ class IndicesClient(NamespacedClient): def analyze( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -70,7 +70,7 @@ def analyze( @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") def refresh( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -102,7 +102,7 @@ def refresh( ) def flush( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -441,7 +441,7 @@ def exists( def put_mapping( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -493,7 +493,7 @@ def put_mapping( ) def get_mapping( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -533,7 +533,7 @@ def get_mapping( def get_field_mapping( self, fields: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -607,7 +607,7 @@ def put_alias( def exists_alias( self, name: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -638,8 +638,8 @@ def exists_alias( @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") def get_alias( self, - index: Optional[Any] = None, - name: Optional[Any] = None, + index: Any = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -790,7 +790,7 @@ def exists_template( @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") def get_template( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -851,8 +851,8 @@ def delete_template( ) def get_settings( self, - index: Optional[Any] = None, - name: Optional[Any] = None, + index: Any = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -900,7 +900,7 @@ def get_settings( def put_settings( self, body: Any, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -955,8 +955,8 @@ def put_settings( ) def stats( self, - index: Optional[Any] = None, - metric: Optional[Any] = None, + index: Any = None, + metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1002,7 +1002,7 @@ def stats( ) def segments( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1044,7 +1044,7 @@ def segments( def validate_query( self, body: Any = None, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1098,7 +1098,7 @@ def validate_query( ) def clear_cache( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1129,7 +1129,7 @@ def clear_cache( @query_params("active_only", "detailed") def recovery( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1157,7 +1157,7 @@ def recovery( ) def upgrade( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1187,7 +1187,7 @@ def upgrade( @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") def get_upgrade( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1215,7 +1215,7 @@ def get_upgrade( ) def shard_stores( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1250,7 +1250,7 @@ def shard_stores( ) def forcemerge( self, - index: Optional[Any] = None, + index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1383,7 +1383,7 @@ def rollover( self, alias: Any, body: Any = None, - new_index: Optional[Any] = None, + new_index: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1528,7 +1528,7 @@ def exists_index_template( @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") def get_index_template( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1629,7 +1629,7 @@ def simulate_index_template( @query_params() def get_data_stream( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1648,7 +1648,7 @@ def get_data_stream( def simulate_template( self, body: Any = None, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -1750,7 +1750,7 @@ def add_block( @query_params() def data_streams_stats( self, - name: Optional[Any] = None, + name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/ingest.py b/opensearchpy/client/ingest.py index 527467bb..4bf558b9 100644 --- a/opensearchpy/client/ingest.py +++ b/opensearchpy/client/ingest.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -45,7 +45,7 @@ class IngestClient(NamespacedClient): @query_params("cluster_manager_timeout", "master_timeout") def get_pipeline( self, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -131,7 +131,7 @@ def delete_pipeline( def simulate( self, body: Any, - id: Optional[Any] = None, + id: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/nodes.py b/opensearchpy/client/nodes.py index 728e8f35..6a7b5db1 100644 --- a/opensearchpy/client/nodes.py +++ b/opensearchpy/client/nodes.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import NamespacedClient, _make_path, query_params @@ -46,7 +46,7 @@ class NodesClient(NamespacedClient): def reload_secure_settings( self, body: Any = None, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -72,8 +72,8 @@ def reload_secure_settings( @query_params("flat_settings", "timeout") def info( self, - node_id: Optional[Any] = None, - metric: Optional[Any] = None, + node_id: Any = None, + metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -108,9 +108,9 @@ def info( ) def stats( self, - node_id: Optional[Any] = None, - metric: Optional[Any] = None, - index_metric: Optional[Any] = None, + node_id: Any = None, + metric: Any = None, + index_metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -159,7 +159,7 @@ def stats( ) def hot_threads( self, - node_id: Optional[Any] = None, + node_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -197,8 +197,8 @@ def hot_threads( @query_params("timeout") def usage( self, - node_id: Optional[Any] = None, - metric: Optional[Any] = None, + node_id: Any = None, + metric: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/security.py b/opensearchpy/client/security.py index 0174532e..6d1574ea 100644 --- a/opensearchpy/client/security.py +++ b/opensearchpy/client/security.py @@ -18,7 +18,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -801,7 +801,7 @@ def patch_configuration( @query_params() def get_distinguished_names( self, - cluster_name: Optional[Any] = None, + cluster_name: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/snapshot.py b/opensearchpy/client/snapshot.py index 5fbcf255..fe6536fa 100644 --- a/opensearchpy/client/snapshot.py +++ b/opensearchpy/client/snapshot.py @@ -36,7 +36,7 @@ # ----------------------------------------------------- -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -180,7 +180,7 @@ def delete_repository( @query_params("cluster_manager_timeout", "local", "master_timeout") def get_repository( self, - repository: Optional[Any] = None, + repository: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -274,8 +274,8 @@ def restore( @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") def status( self, - repository: Optional[Any] = None, - snapshot: Optional[Any] = None, + repository: Any = None, + snapshot: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/opensearchpy/client/tasks.py b/opensearchpy/client/tasks.py index 76ff6924..7e675233 100644 --- a/opensearchpy/client/tasks.py +++ b/opensearchpy/client/tasks.py @@ -37,7 +37,7 @@ import warnings -from typing import Any, Optional +from typing import Any from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -84,7 +84,7 @@ def list( @query_params("actions", "nodes", "parent_task_id", "wait_for_completion") def cancel( self, - task_id: Optional[Any] = None, + task_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -115,7 +115,7 @@ def cancel( @query_params("timeout", "wait_for_completion") def get( self, - task_id: Optional[Any] = None, + task_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: diff --git a/utils/templates/func_params b/utils/templates/func_params index 7a66cb36..cbb976ed 100644 --- a/utils/templates/func_params +++ b/utils/templates/func_params @@ -7,7 +7,8 @@ {% endif %} {% for p, info in api.all_parts.items() %} - {% if not info.required and info.type == 'Any' %}{{ p }}: Optional[{{ info.type }}]=None, {% endif %} + {% if not info.required and not info.type == 'Any' %}{{ p }}: Optional[{{ info.type }}]=None, {% endif %} + {% if not info.required and info.type == 'Any' %}{{ p }}: {{ info.type }}=None, {% endif %} {% endfor %} params: Any=None,