diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json index 884de3757c9a..1073e1ee54ac 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json @@ -1,11 +1,11 @@ { - "commit": "21426cf85836ec17aaa4f20f58324a8666925e34", + "commit": "db1186ad066d08f5a972ab7777cf05234a6f7dfc", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.2.7", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/cosmos-db/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py index de0ee92a4749..2ffb9868aed3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py index 9b21cb3f7fe5..89838c61c0cc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py @@ -42,7 +42,7 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-15-preview") # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-08-15-preview"] = kwargs.pop("api_version", "2022-08-15-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-cosmosdb/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py index 18bb993ec21a..fe0acb09f4f5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import CosmosDBManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -184,7 +184,7 @@ def __init__( ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -310,15 +310,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> CosmosDBManagementClient + def __enter__(self) -> "CosmosDBManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py index 7c1dedb5133d..2c170e28dbca 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,24 +38,22 @@ import re import sys import codecs +from typing import Optional, Union, AnyStr, IO, Mapping try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate +import isodate # type: ignore -from typing import Dict, Any, cast, TYPE_CHECKING +from typing import Dict, Any, cast from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping - class RawDeserializer: @@ -65,8 +64,7 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -132,8 +130,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -160,8 +157,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) @@ -188,7 +185,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -219,7 +216,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -276,9 +273,9 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} def __init__(self, **kwargs): self.additional_properties = {} @@ -310,7 +307,7 @@ def enable_additional_properties_sending(cls): @classmethod def is_xml_model(cls): try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -319,7 +316,7 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} @@ -453,7 +450,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -606,13 +603,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): @@ -621,23 +618,23 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): + for k in reversed(keys): # type: ignore unflattened = {k: new_attr} new_attr = unflattened _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue @@ -675,7 +672,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -843,7 +840,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -1001,10 +998,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1416,7 +1413,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1444,7 +1441,7 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1543,7 +1540,7 @@ def _unpack_content(raw_data, content_type=None): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1565,7 +1562,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1747,7 +1744,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1798,7 +1795,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1810,8 +1807,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1826,7 +1823,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1841,7 +1838,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1871,7 +1868,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1886,7 +1883,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1901,7 +1898,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) @@ -1924,7 +1921,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -1960,7 +1957,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py index e25f4fc7373b..a712687790e5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "9.0.0b2" +VERSION = "0.7.0" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py index ac5eb24b55c8..0ec156d96fb5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py index dc12448cd980..4cb674ed2628 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py @@ -42,7 +42,7 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-15-preview") # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-08-15-preview"] = kwargs.pop("api_version", "2022-08-15-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py index 4fa2888ba9cb..0bff2bab36a9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import CosmosDBManagementClientConfiguration from .operations import ( @@ -187,7 +187,7 @@ def __init__( ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py index b9aee75bbc64..1f05cd933e30 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py @@ -47,7 +47,7 @@ from ._service_operations import ServiceOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py index 1345e60701d6..b59487bb6c78 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py @@ -85,10 +85,10 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ClusterR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,7 +109,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -125,7 +125,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -133,13 +133,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -152,7 +152,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace def list_by_resource_group( @@ -171,10 +173,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -196,7 +198,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -212,7 +214,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -220,13 +222,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -239,7 +241,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace_async async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ClusterResource: @@ -266,10 +270,10 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -281,9 +285,9 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -300,7 +304,9 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -316,10 +322,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -331,9 +337,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -346,7 +352,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -372,13 +380,13 @@ async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -396,7 +404,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -408,9 +416,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _create_update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -426,11 +436,11 @@ async def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -453,9 +463,9 @@ async def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -472,11 +482,13 @@ async def _create_update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload async def begin_create_update( @@ -588,16 +600,16 @@ async def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_initial( # type: ignore + raw_result = await self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -617,7 +629,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -629,9 +641,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -647,11 +661,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -674,9 +688,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -693,11 +707,13 @@ async def _update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload async def begin_update( @@ -804,16 +820,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -833,7 +849,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -845,9 +861,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _invoke_command_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.CommandPostBody, IO], **kwargs: Any @@ -863,11 +881,11 @@ async def _invoke_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -890,9 +908,9 @@ async def _invoke_command_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -909,7 +927,9 @@ async def _invoke_command_initial( return deserialized - _invoke_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # type: ignore + _invoke_command_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } @overload async def begin_invoke_command( @@ -1016,16 +1036,16 @@ async def begin_invoke_command( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._invoke_command_initial( # type: ignore + raw_result = await self._invoke_command_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1045,7 +1065,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1057,9 +1077,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_invoke_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # type: ignore + begin_invoke_command.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } @distributed_trace def list_backups( @@ -1080,10 +1102,10 @@ def list_backups( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListBackups] + ) + cls: ClsType[_models.ListBackups] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1106,7 +1128,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1122,7 +1144,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1130,13 +1152,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListBackups", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1149,7 +1171,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_backups.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups"} # type: ignore + list_backups.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups" + } @distributed_trace_async async def get_backup( @@ -1180,10 +1204,10 @@ async def get_backup( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupResource] + ) + cls: ClsType[_models.BackupResource] = kwargs.pop("cls", None) request = build_get_backup_request( resource_group_name=resource_group_name, @@ -1196,9 +1220,9 @@ async def get_backup( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1215,7 +1239,9 @@ async def get_backup( return deserialized - get_backup.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}"} # type: ignore + get_backup.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}" + } async def _deallocate_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1231,10 +1257,10 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_deallocate_request( resource_group_name=resource_group_name, @@ -1246,9 +1272,9 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1261,7 +1287,9 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _deallocate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + _deallocate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } @distributed_trace_async async def begin_deallocate( @@ -1291,13 +1319,13 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._deallocate_initial( # type: ignore resource_group_name=resource_group_name, @@ -1315,7 +1343,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1327,9 +1355,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_deallocate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + begin_deallocate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1345,10 +1375,10 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -1360,9 +1390,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1375,7 +1405,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace_async async def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1403,13 +1435,13 @@ async def begin_start(self, resource_group_name: str, cluster_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -1427,7 +1459,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1439,9 +1471,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace_async async def status( @@ -1470,10 +1504,10 @@ async def status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraClusterPublicStatus] + ) + cls: ClsType[_models.CassandraClusterPublicStatus] = kwargs.pop("cls", None) request = build_status_request( resource_group_name=resource_group_name, @@ -1485,9 +1519,9 @@ async def status( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1504,4 +1538,6 @@ async def status( return deserialized - status.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status"} # type: ignore + status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py index 1a98c919d8ad..5001b9848872 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py @@ -85,10 +85,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListDataCenters] + ) + cls: ClsType[_models.ListDataCenters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,7 +111,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -127,7 +127,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -135,13 +135,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListDataCenters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -154,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters" + } @distributed_trace_async async def get( @@ -185,10 +187,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -201,9 +203,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -220,7 +222,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, data_center_name: str, **kwargs: Any @@ -236,10 +240,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -252,9 +256,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -267,7 +271,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @distributed_trace_async async def begin_delete( @@ -297,13 +303,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -322,7 +328,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -334,9 +340,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } async def _create_update_initial( self, @@ -357,11 +365,11 @@ async def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -385,9 +393,9 @@ async def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -404,11 +412,13 @@ async def _create_update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload async def begin_create_update( @@ -531,16 +541,16 @@ async def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_initial( # type: ignore + raw_result = await self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -561,7 +571,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -573,9 +583,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } async def _update_initial( self, @@ -596,11 +608,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -624,9 +636,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -643,11 +655,13 @@ async def _update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload async def begin_update( @@ -767,16 +781,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -797,7 +811,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -809,6 +823,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py index 3dcb19e46c16..a1e77bfdad1b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py @@ -106,10 +106,10 @@ def list_cassandra_keyspaces( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceListResult] + ) + cls: ClsType[_models.CassandraKeyspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -132,7 +132,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -148,7 +148,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -156,13 +156,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CassandraKeyspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -175,7 +175,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_cassandra_keyspaces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces"} # type: ignore + list_cassandra_keyspaces.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces" + } @distributed_trace_async async def get_cassandra_keyspace( @@ -207,10 +209,10 @@ async def get_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] + ) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -223,9 +225,9 @@ async def get_cassandra_keyspace( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -242,7 +244,9 @@ async def get_cassandra_keyspace( return deserialized - get_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + get_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } async def _create_update_cassandra_keyspace_initial( self, @@ -263,11 +267,11 @@ async def _create_update_cassandra_keyspace_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraKeyspaceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraKeyspaceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -293,9 +297,9 @@ async def _create_update_cassandra_keyspace_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -314,7 +318,9 @@ async def _create_update_cassandra_keyspace_initial( return deserialized - _create_update_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _create_update_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @overload async def begin_create_update_cassandra_keyspace( @@ -441,16 +447,16 @@ async def begin_create_update_cassandra_keyspace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_cassandra_keyspace_initial( # type: ignore + raw_result = await self._create_update_cassandra_keyspace_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -471,7 +477,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -483,9 +489,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_create_update_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -501,10 +509,10 @@ async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -517,9 +525,9 @@ async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-re params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -532,7 +540,9 @@ async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-re if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _delete_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace_async async def begin_delete_cassandra_keyspace( @@ -562,13 +572,13 @@ async def begin_delete_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_cassandra_keyspace_initial( # type: ignore resource_group_name=resource_group_name, @@ -587,7 +597,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -599,9 +609,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_delete_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace_async async def get_cassandra_keyspace_throughput( @@ -633,10 +645,10 @@ async def get_cassandra_keyspace_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_throughput_request( resource_group_name=resource_group_name, @@ -649,9 +661,9 @@ async def get_cassandra_keyspace_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -668,7 +680,9 @@ async def get_cassandra_keyspace_throughput( return deserialized - get_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + get_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } async def _update_cassandra_keyspace_throughput_initial( self, @@ -689,11 +703,11 @@ async def _update_cassandra_keyspace_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -717,9 +731,9 @@ async def _update_cassandra_keyspace_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -738,7 +752,9 @@ async def _update_cassandra_keyspace_throughput_initial( return deserialized - _update_cassandra_keyspace_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + _update_cassandra_keyspace_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } @overload async def begin_update_cassandra_keyspace_throughput( @@ -865,16 +881,16 @@ async def begin_update_cassandra_keyspace_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_cassandra_keyspace_throughput_initial( # type: ignore + raw_result = await self._update_cassandra_keyspace_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -895,7 +911,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -907,9 +923,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } async def _migrate_cassandra_keyspace_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -925,10 +943,10 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_autoscale_request( resource_group_name=resource_group_name, @@ -941,9 +959,9 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -962,7 +980,9 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( return deserialized - _migrate_cassandra_keyspace_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_keyspace_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_cassandra_keyspace_to_autoscale( @@ -994,15 +1014,15 @@ async def begin_migrate_cassandra_keyspace_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_keyspace_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_cassandra_keyspace_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1021,7 +1041,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1033,9 +1053,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_keyspace_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_cassandra_keyspace_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1051,10 +1073,10 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1067,9 +1089,9 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1088,7 +1110,9 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( return deserialized - _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_cassandra_keyspace_to_manual_throughput( @@ -1120,15 +1144,15 @@ async def begin_migrate_cassandra_keyspace_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_keyspace_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_cassandra_keyspace_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1147,7 +1171,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1159,9 +1183,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_tables( @@ -1186,10 +1212,10 @@ def list_cassandra_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableListResult] + ) + cls: ClsType[_models.CassandraTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1213,7 +1239,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1229,7 +1255,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1237,13 +1263,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CassandraTableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1256,7 +1282,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_cassandra_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables"} # type: ignore + list_cassandra_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables" + } @distributed_trace_async async def get_cassandra_table( @@ -1289,10 +1317,10 @@ async def get_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] + ) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_request( resource_group_name=resource_group_name, @@ -1306,9 +1334,9 @@ async def get_cassandra_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1325,7 +1353,9 @@ async def get_cassandra_table( return deserialized - get_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + get_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } async def _create_update_cassandra_table_initial( self, @@ -1347,11 +1377,11 @@ async def _create_update_cassandra_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraTableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraTableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1378,9 +1408,9 @@ async def _create_update_cassandra_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1399,7 +1429,9 @@ async def _create_update_cassandra_table_initial( return deserialized - _create_update_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _create_update_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @overload async def begin_create_update_cassandra_table( @@ -1535,16 +1567,16 @@ async def begin_create_update_cassandra_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_cassandra_table_initial( # type: ignore + raw_result = await self._create_update_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1566,7 +1598,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1578,9 +1610,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_create_update_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -1596,10 +1630,10 @@ async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_table_request( resource_group_name=resource_group_name, @@ -1613,9 +1647,9 @@ async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1628,7 +1662,9 @@ async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _delete_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace_async async def begin_delete_cassandra_table( @@ -1660,13 +1696,13 @@ async def begin_delete_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_cassandra_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -1686,7 +1722,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1698,9 +1734,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_delete_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace_async async def get_cassandra_table_throughput( @@ -1734,10 +1772,10 @@ async def get_cassandra_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_throughput_request( resource_group_name=resource_group_name, @@ -1751,9 +1789,9 @@ async def get_cassandra_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1770,7 +1808,9 @@ async def get_cassandra_table_throughput( return deserialized - get_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } async def _update_cassandra_table_throughput_initial( self, @@ -1792,11 +1832,11 @@ async def _update_cassandra_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1821,9 +1861,9 @@ async def _update_cassandra_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1842,7 +1882,9 @@ async def _update_cassandra_table_throughput_initial( return deserialized - _update_cassandra_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_cassandra_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } @overload async def begin_update_cassandra_table_throughput( @@ -1978,16 +2020,16 @@ async def begin_update_cassandra_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_cassandra_table_throughput_initial( # type: ignore + raw_result = await self._update_cassandra_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2009,7 +2051,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2021,9 +2063,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } async def _migrate_cassandra_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2039,10 +2083,10 @@ async def _migrate_cassandra_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -2056,9 +2100,9 @@ async def _migrate_cassandra_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2077,7 +2121,9 @@ async def _migrate_cassandra_table_to_autoscale_initial( return deserialized - _migrate_cassandra_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_cassandra_table_to_autoscale( @@ -2111,15 +2157,15 @@ async def begin_migrate_cassandra_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_table_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_cassandra_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2139,7 +2185,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2151,9 +2197,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_cassandra_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2169,10 +2217,10 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2186,9 +2234,9 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2207,7 +2255,9 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( return deserialized - _migrate_cassandra_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_cassandra_table_to_manual_throughput( @@ -2241,15 +2291,15 @@ async def begin_migrate_cassandra_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_table_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_cassandra_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2269,7 +2319,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2281,9 +2331,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_views( @@ -2308,10 +2360,10 @@ def list_cassandra_views( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewListResult] + ) + cls: ClsType[_models.CassandraViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2335,7 +2387,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2351,7 +2403,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2359,13 +2411,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CassandraViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2378,7 +2430,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_cassandra_views.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views"} # type: ignore + list_cassandra_views.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views" + } @distributed_trace_async async def get_cassandra_view( @@ -2411,10 +2465,10 @@ async def get_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] + ) + cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_request( resource_group_name=resource_group_name, @@ -2428,9 +2482,9 @@ async def get_cassandra_view( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2447,7 +2501,9 @@ async def get_cassandra_view( return deserialized - get_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + get_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } async def _create_update_cassandra_view_initial( self, @@ -2469,11 +2525,11 @@ async def _create_update_cassandra_view_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraViewGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraViewGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2498,9 +2554,9 @@ async def _create_update_cassandra_view_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2519,7 +2575,9 @@ async def _create_update_cassandra_view_initial( return deserialized - _create_update_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _create_update_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @overload async def begin_create_update_cassandra_view( @@ -2652,16 +2710,16 @@ async def begin_create_update_cassandra_view( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_cassandra_view_initial( # type: ignore + raw_result = await self._create_update_cassandra_view_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2683,7 +2741,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2695,9 +2753,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_create_update_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -2713,10 +2773,10 @@ async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_view_request( resource_group_name=resource_group_name, @@ -2730,9 +2790,9 @@ async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2745,7 +2805,9 @@ async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _delete_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace_async async def begin_delete_cassandra_view( @@ -2777,13 +2839,13 @@ async def begin_delete_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_cassandra_view_initial( # type: ignore resource_group_name=resource_group_name, @@ -2803,7 +2865,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2815,9 +2877,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_delete_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace_async async def get_cassandra_view_throughput( @@ -2851,10 +2915,10 @@ async def get_cassandra_view_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_throughput_request( resource_group_name=resource_group_name, @@ -2868,9 +2932,9 @@ async def get_cassandra_view_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2887,7 +2951,9 @@ async def get_cassandra_view_throughput( return deserialized - get_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + get_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } async def _update_cassandra_view_throughput_initial( self, @@ -2909,11 +2975,11 @@ async def _update_cassandra_view_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2938,9 +3004,9 @@ async def _update_cassandra_view_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2959,7 +3025,9 @@ async def _update_cassandra_view_throughput_initial( return deserialized - _update_cassandra_view_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + _update_cassandra_view_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } @overload async def begin_update_cassandra_view_throughput( @@ -3095,16 +3163,16 @@ async def begin_update_cassandra_view_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_cassandra_view_throughput_initial( # type: ignore + raw_result = await self._update_cassandra_view_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3126,7 +3194,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3138,9 +3206,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } async def _migrate_cassandra_view_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -3156,10 +3226,10 @@ async def _migrate_cassandra_view_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_autoscale_request( resource_group_name=resource_group_name, @@ -3173,9 +3243,9 @@ async def _migrate_cassandra_view_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3194,7 +3264,9 @@ async def _migrate_cassandra_view_to_autoscale_initial( return deserialized - _migrate_cassandra_view_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_view_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_cassandra_view_to_autoscale( @@ -3228,15 +3300,15 @@ async def begin_migrate_cassandra_view_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_view_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_cassandra_view_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3256,7 +3328,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3268,9 +3340,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_view_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_cassandra_view_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -3286,10 +3360,10 @@ async def _migrate_cassandra_view_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -3303,9 +3377,9 @@ async def _migrate_cassandra_view_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3324,7 +3398,9 @@ async def _migrate_cassandra_view_to_manual_throughput_initial( return deserialized - _migrate_cassandra_view_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_view_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_cassandra_view_to_manual_throughput( @@ -3358,15 +3434,15 @@ async def begin_migrate_cassandra_view_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_view_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_cassandra_view_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3386,7 +3462,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3398,6 +3474,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_view_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py index 7c431c7d5954..fedd9c4efb05 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py @@ -95,10 +95,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,7 +124,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -140,7 +140,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -148,13 +148,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,7 +167,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } @distributed_trace def list_usages( @@ -202,10 +204,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -231,7 +233,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -247,7 +249,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -255,13 +257,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -274,7 +276,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -299,10 +303,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -327,7 +331,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -343,7 +347,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -351,13 +355,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -370,4 +374,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py index 8f260e154590..e56405922eee 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py @@ -91,10 +91,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,7 +163,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } @distributed_trace def list_usages( @@ -198,10 +200,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionUsagesResult] + ) + cls: ClsType[_models.PartitionUsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -227,7 +229,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -243,7 +245,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -251,13 +253,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionUsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -270,4 +272,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py index 6d4cbbab300c..9ffaebed0db8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py @@ -94,10 +94,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,7 +124,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -140,7 +140,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -148,13 +148,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,4 +167,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py index bf46f4e3f032..6933c80c8eea 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py @@ -94,10 +94,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,7 +124,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -140,7 +140,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -148,13 +148,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,4 +167,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py index 3954f90316b1..2fef8d8c4d6c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py @@ -166,11 +166,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -194,9 +194,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,7 +213,9 @@ async def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace_async async def get( @@ -244,10 +246,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +262,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +281,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace_async async def pause( @@ -310,10 +314,10 @@ async def pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -326,9 +330,9 @@ async def pause( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -345,7 +349,9 @@ async def pause( return deserialized - pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause"} # type: ignore + pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause" + } @distributed_trace_async async def resume( @@ -376,10 +382,10 @@ async def resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -392,9 +398,9 @@ async def resume( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -411,7 +417,9 @@ async def resume( return deserialized - resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume"} # type: ignore + resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume" + } @distributed_trace_async async def cancel( @@ -442,10 +450,10 @@ async def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -458,9 +466,9 @@ async def cancel( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -477,7 +485,9 @@ async def cancel( return deserialized - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel" + } @distributed_trace def list_by_database_account( @@ -500,10 +510,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobFeedResults] + ) + cls: ClsType[_models.DataTransferJobFeedResults] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -526,7 +536,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -542,7 +552,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -550,13 +560,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DataTransferJobFeedResults", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -569,4 +579,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py index 5c8d85b1b799..c9fa1758ad08 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py @@ -82,10 +82,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,7 +110,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -126,7 +126,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -134,13 +134,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -153,4 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py index db108e5f4d06..9ea5fe14fd18 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py @@ -106,10 +106,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -121,9 +121,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -140,7 +140,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _update_initial( self, @@ -160,11 +162,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload async def begin_update( @@ -320,16 +324,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, account_name=account_name, update_parameters=update_parameters, @@ -349,7 +353,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -361,9 +365,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _create_or_update_initial( self, @@ -383,11 +389,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -410,9 +416,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -429,7 +435,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload async def begin_create_or_update( @@ -550,16 +558,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, create_update_parameters=create_update_parameters, @@ -579,7 +587,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -591,9 +599,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any @@ -609,10 +619,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -624,9 +634,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -639,7 +649,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -665,13 +677,13 @@ async def begin_delete(self, resource_group_name: str, account_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -689,7 +701,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -701,9 +713,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _failover_priority_change_initial( # pylint: disable=inconsistent-return-statements self, @@ -723,11 +737,11 @@ async def _failover_priority_change_initial( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -750,9 +764,9 @@ async def _failover_priority_change_initial( # pylint: disable=inconsistent-ret params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -765,7 +779,9 @@ async def _failover_priority_change_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _failover_priority_change_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + _failover_priority_change_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @overload async def begin_failover_priority_change( @@ -882,14 +898,14 @@ async def begin_failover_priority_change( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._failover_priority_change_initial( # type: ignore resource_group_name=resource_group_name, @@ -909,7 +925,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -921,9 +937,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover_priority_change.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + begin_failover_priority_change.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.DatabaseAccountGetResults"]: @@ -939,10 +957,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DatabaseAccountGetResult _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -963,7 +981,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -979,7 +997,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -987,13 +1005,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1006,7 +1024,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} @distributed_trace def list_by_resource_group( @@ -1027,10 +1045,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1052,7 +1070,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1068,7 +1086,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1076,13 +1094,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1095,7 +1113,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts" + } @distributed_trace_async async def list_keys( @@ -1124,10 +1144,10 @@ async def list_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListKeysResult] = kwargs.pop("cls", None) request = build_list_keys_request( resource_group_name=resource_group_name, @@ -1139,9 +1159,9 @@ async def list_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1158,7 +1178,9 @@ async def list_keys( return deserialized - list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys"} # type: ignore + list_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys" + } @distributed_trace_async async def list_connection_strings( @@ -1187,10 +1209,10 @@ async def list_connection_strings( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListConnectionStringsResult] + ) + cls: ClsType[_models.DatabaseAccountListConnectionStringsResult] = kwargs.pop("cls", None) request = build_list_connection_strings_request( resource_group_name=resource_group_name, @@ -1202,9 +1224,9 @@ async def list_connection_strings( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1221,7 +1243,9 @@ async def list_connection_strings( return deserialized - list_connection_strings.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings"} # type: ignore + list_connection_strings.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings" + } async def _offline_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -1241,11 +1265,11 @@ async def _offline_region_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1268,9 +1292,9 @@ async def _offline_region_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1284,7 +1308,9 @@ async def _offline_region_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _offline_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + _offline_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } @overload async def begin_offline_region( @@ -1394,14 +1420,14 @@ async def begin_offline_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._offline_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -1421,7 +1447,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1433,9 +1459,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_offline_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + begin_offline_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } async def _online_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -1455,11 +1483,11 @@ async def _online_region_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1482,9 +1510,9 @@ async def _online_region_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1498,7 +1526,9 @@ async def _online_region_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _online_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + _online_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @overload async def begin_online_region( @@ -1608,14 +1638,14 @@ async def begin_online_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._online_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -1635,7 +1665,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1647,9 +1677,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_online_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + begin_online_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @distributed_trace_async async def get_read_only_keys( @@ -1678,10 +1710,10 @@ async def get_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_get_read_only_keys_request( resource_group_name=resource_group_name, @@ -1693,9 +1725,9 @@ async def get_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1712,7 +1744,9 @@ async def get_read_only_keys( return deserialized - get_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + get_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } @distributed_trace_async async def list_read_only_keys( @@ -1741,10 +1775,10 @@ async def list_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_list_read_only_keys_request( resource_group_name=resource_group_name, @@ -1756,9 +1790,9 @@ async def list_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1775,7 +1809,9 @@ async def list_read_only_keys( return deserialized - list_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + list_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements self, @@ -1795,11 +1831,11 @@ async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1822,9 +1858,9 @@ async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1837,7 +1873,9 @@ async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _regenerate_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + _regenerate_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @overload async def begin_regenerate_key( @@ -1946,14 +1984,14 @@ async def begin_regenerate_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._regenerate_key_initial( # type: ignore resource_group_name=resource_group_name, @@ -1973,7 +2011,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1985,9 +2023,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + begin_regenerate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @distributed_trace_async async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: @@ -2013,10 +2053,10 @@ async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_check_name_exists_request( account_name=account_name, @@ -2026,9 +2066,9 @@ async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2042,7 +2082,7 @@ async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} # type: ignore + check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} @distributed_trace def list_metrics( @@ -2067,10 +2107,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2094,7 +2134,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2110,7 +2150,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2118,13 +2158,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2137,7 +2177,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics" + } @distributed_trace def list_usages( @@ -2162,10 +2204,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2189,7 +2231,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2205,7 +2247,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2213,13 +2255,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2232,7 +2274,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages" + } @distributed_trace def list_metric_definitions( @@ -2253,10 +2297,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2279,7 +2323,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2295,7 +2339,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2303,13 +2347,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2322,4 +2366,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py index 6cf8af613227..6420e259dcb3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py @@ -87,10 +87,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -131,7 +131,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,7 +158,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics" + } @distributed_trace def list_usages( @@ -190,10 +192,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,7 +220,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -234,7 +236,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +244,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,7 +263,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -284,10 +288,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -311,7 +315,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -327,7 +331,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -335,13 +339,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -354,4 +358,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py index 6afe7dddb442..5c9c9d1e57af 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py @@ -86,10 +86,10 @@ def list_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourcesListResult] + ) + cls: ClsType[_models.GraphResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +112,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -128,7 +128,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -136,13 +136,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GraphResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -155,7 +155,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs"} # type: ignore + list_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs" + } @distributed_trace_async async def get_graph( @@ -187,10 +189,10 @@ async def get_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] + ) + cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) request = build_get_graph_request( resource_group_name=resource_group_name, @@ -203,9 +205,9 @@ async def get_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -222,7 +224,9 @@ async def get_graph( return deserialized - get_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + get_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } async def _create_update_graph_initial( self, @@ -243,11 +247,11 @@ async def _create_update_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GraphResourceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GraphResourceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -271,9 +275,9 @@ async def _create_update_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -292,7 +296,9 @@ async def _create_update_graph_initial( return deserialized - _create_update_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _create_update_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @overload async def begin_create_update_graph( @@ -416,16 +422,16 @@ async def begin_create_update_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_graph_initial( # type: ignore + raw_result = await self._create_update_graph_initial( resource_group_name=resource_group_name, account_name=account_name, graph_name=graph_name, @@ -446,7 +452,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -458,9 +464,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_create_update_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any @@ -476,10 +484,10 @@ async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_graph_resource_request( resource_group_name=resource_group_name, @@ -492,9 +500,9 @@ async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -507,7 +515,9 @@ async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _delete_graph_resource_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _delete_graph_resource_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @distributed_trace_async async def begin_delete_graph_resource( @@ -537,13 +547,13 @@ async def begin_delete_graph_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_graph_resource_initial( # type: ignore resource_group_name=resource_group_name, @@ -562,7 +572,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -574,6 +584,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_graph_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_delete_graph_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py index e47a0615bd74..48e3333a7692 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py @@ -99,10 +99,10 @@ def list_gremlin_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseListResult] + ) + cls: ClsType[_models.GremlinDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,7 +125,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -141,7 +141,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -149,13 +149,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GremlinDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -168,7 +168,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_gremlin_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases"} # type: ignore + list_gremlin_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases" + } @distributed_trace_async async def get_gremlin_database( @@ -200,10 +202,10 @@ async def get_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] + ) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_request( resource_group_name=resource_group_name, @@ -216,9 +218,9 @@ async def get_gremlin_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -235,7 +237,9 @@ async def get_gremlin_database( return deserialized - get_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + get_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } async def _create_update_gremlin_database_initial( self, @@ -256,11 +260,11 @@ async def _create_update_gremlin_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -286,9 +290,9 @@ async def _create_update_gremlin_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -307,7 +311,9 @@ async def _create_update_gremlin_database_initial( return deserialized - _create_update_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _create_update_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @overload async def begin_create_update_gremlin_database( @@ -434,16 +440,16 @@ async def begin_create_update_gremlin_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_gremlin_database_initial( # type: ignore + raw_result = await self._create_update_gremlin_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -464,7 +470,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -476,9 +482,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_create_update_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -494,10 +502,10 @@ async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_database_request( resource_group_name=resource_group_name, @@ -510,9 +518,9 @@ async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-retu params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -525,7 +533,9 @@ async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-retu if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _delete_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace_async async def begin_delete_gremlin_database( @@ -555,13 +565,13 @@ async def begin_delete_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_gremlin_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -580,7 +590,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -592,9 +602,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_delete_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace_async async def get_gremlin_database_throughput( @@ -626,10 +638,10 @@ async def get_gremlin_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_throughput_request( resource_group_name=resource_group_name, @@ -642,9 +654,9 @@ async def get_gremlin_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -661,7 +673,9 @@ async def get_gremlin_database_throughput( return deserialized - get_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } async def _update_gremlin_database_throughput_initial( self, @@ -682,11 +696,11 @@ async def _update_gremlin_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -710,9 +724,9 @@ async def _update_gremlin_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -731,7 +745,9 @@ async def _update_gremlin_database_throughput_initial( return deserialized - _update_gremlin_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_gremlin_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } @overload async def begin_update_gremlin_database_throughput( @@ -858,16 +874,16 @@ async def begin_update_gremlin_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_gremlin_database_throughput_initial( # type: ignore + raw_result = await self._update_gremlin_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -888,7 +904,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -900,9 +916,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } async def _migrate_gremlin_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -918,10 +936,10 @@ async def _migrate_gremlin_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -934,9 +952,9 @@ async def _migrate_gremlin_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -955,7 +973,9 @@ async def _migrate_gremlin_database_to_autoscale_initial( return deserialized - _migrate_gremlin_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_gremlin_database_to_autoscale( @@ -987,15 +1007,15 @@ async def begin_migrate_gremlin_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_database_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_gremlin_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1014,7 +1034,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1026,9 +1046,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_gremlin_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1044,10 +1066,10 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1060,9 +1082,9 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1081,7 +1103,9 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( return deserialized - _migrate_gremlin_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_gremlin_database_to_manual_throughput( @@ -1113,15 +1137,15 @@ async def begin_migrate_gremlin_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_database_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_gremlin_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1140,7 +1164,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1152,9 +1176,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_gremlin_graphs( @@ -1179,10 +1205,10 @@ def list_gremlin_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphListResult] + ) + cls: ClsType[_models.GremlinGraphListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1206,7 +1232,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1222,7 +1248,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1230,13 +1256,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GremlinGraphListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1249,7 +1275,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_gremlin_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs"} # type: ignore + list_gremlin_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs" + } @distributed_trace_async async def get_gremlin_graph( @@ -1282,10 +1310,10 @@ async def get_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] + ) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_request( resource_group_name=resource_group_name, @@ -1299,9 +1327,9 @@ async def get_gremlin_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1318,7 +1346,9 @@ async def get_gremlin_graph( return deserialized - get_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + get_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } async def _create_update_gremlin_graph_initial( self, @@ -1340,11 +1370,11 @@ async def _create_update_gremlin_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinGraphGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinGraphGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1369,9 +1399,9 @@ async def _create_update_gremlin_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1390,7 +1420,9 @@ async def _create_update_gremlin_graph_initial( return deserialized - _create_update_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _create_update_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @overload async def begin_create_update_gremlin_graph( @@ -1523,16 +1555,16 @@ async def begin_create_update_gremlin_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_gremlin_graph_initial( # type: ignore + raw_result = await self._create_update_gremlin_graph_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1554,7 +1586,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1566,9 +1598,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_create_update_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -1584,10 +1618,10 @@ async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_graph_request( resource_group_name=resource_group_name, @@ -1601,9 +1635,9 @@ async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1616,7 +1650,9 @@ async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _delete_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace_async async def begin_delete_gremlin_graph( @@ -1648,13 +1684,13 @@ async def begin_delete_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_gremlin_graph_initial( # type: ignore resource_group_name=resource_group_name, @@ -1674,7 +1710,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1686,9 +1722,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_delete_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace_async async def get_gremlin_graph_throughput( @@ -1722,10 +1760,10 @@ async def get_gremlin_graph_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_throughput_request( resource_group_name=resource_group_name, @@ -1739,9 +1777,9 @@ async def get_gremlin_graph_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1758,7 +1796,9 @@ async def get_gremlin_graph_throughput( return deserialized - get_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + get_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } async def _update_gremlin_graph_throughput_initial( self, @@ -1780,11 +1820,11 @@ async def _update_gremlin_graph_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1809,9 +1849,9 @@ async def _update_gremlin_graph_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1830,7 +1870,9 @@ async def _update_gremlin_graph_throughput_initial( return deserialized - _update_gremlin_graph_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + _update_gremlin_graph_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } @overload async def begin_update_gremlin_graph_throughput( @@ -1966,16 +2008,16 @@ async def begin_update_gremlin_graph_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_gremlin_graph_throughput_initial( # type: ignore + raw_result = await self._update_gremlin_graph_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1997,7 +2039,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2009,9 +2051,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } async def _migrate_gremlin_graph_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2027,10 +2071,10 @@ async def _migrate_gremlin_graph_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_autoscale_request( resource_group_name=resource_group_name, @@ -2044,9 +2088,9 @@ async def _migrate_gremlin_graph_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2065,7 +2109,9 @@ async def _migrate_gremlin_graph_to_autoscale_initial( return deserialized - _migrate_gremlin_graph_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_graph_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_gremlin_graph_to_autoscale( @@ -2099,15 +2145,15 @@ async def begin_migrate_gremlin_graph_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_graph_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_gremlin_graph_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2127,7 +2173,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2139,9 +2185,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_graph_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_gremlin_graph_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2157,10 +2205,10 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2174,9 +2222,9 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2195,7 +2243,9 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( return deserialized - _migrate_gremlin_graph_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_graph_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_gremlin_graph_to_manual_throughput( @@ -2229,15 +2279,15 @@ async def begin_migrate_gremlin_graph_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_graph_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_gremlin_graph_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2257,7 +2307,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2269,9 +2319,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_graph_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } async def _retrieve_continuous_backup_information_initial( self, @@ -2293,11 +2345,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2322,9 +2374,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2343,7 +2395,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -2472,16 +2526,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2503,9 +2557,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2517,6 +2571,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py index 1eb27cfb8949..feb1e82fc077 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py @@ -70,10 +70,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.LocationGetResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationListResult] + ) + cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LocationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,7 +137,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} @distributed_trace_async async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: @@ -162,10 +162,10 @@ async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationGetResult] + ) + cls: ClsType[_models.LocationGetResult] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -176,9 +176,9 @@ async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -195,4 +195,4 @@ async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py index 0c09b8e5333d..4932b18798b7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py @@ -112,10 +112,10 @@ def list_mongo_db_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseListResult] + ) + cls: ClsType[_models.MongoDBDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -138,7 +138,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -154,7 +154,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -162,13 +162,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoDBDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -181,7 +181,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_db_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases"} # type: ignore + list_mongo_db_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases" + } @distributed_trace_async async def get_mongo_db_database( @@ -213,10 +215,10 @@ async def get_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] + ) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_request( resource_group_name=resource_group_name, @@ -229,9 +231,9 @@ async def get_mongo_db_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -248,7 +250,9 @@ async def get_mongo_db_database( return deserialized - get_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + get_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } async def _create_update_mongo_db_database_initial( self, @@ -269,11 +273,11 @@ async def _create_update_mongo_db_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -299,9 +303,9 @@ async def _create_update_mongo_db_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -320,7 +324,9 @@ async def _create_update_mongo_db_database_initial( return deserialized - _create_update_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _create_update_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @overload async def begin_create_update_mongo_db_database( @@ -447,16 +453,16 @@ async def begin_create_update_mongo_db_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_db_database_initial( # type: ignore + raw_result = await self._create_update_mongo_db_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -477,7 +483,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -489,9 +495,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_create_update_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -507,10 +515,10 @@ async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_database_request( resource_group_name=resource_group_name, @@ -523,9 +531,9 @@ async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-ret params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -538,7 +546,9 @@ async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _delete_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace_async async def begin_delete_mongo_db_database( @@ -568,13 +578,13 @@ async def begin_delete_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_db_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -593,7 +603,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -605,9 +615,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_delete_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace_async async def get_mongo_db_database_throughput( @@ -639,10 +651,10 @@ async def get_mongo_db_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_throughput_request( resource_group_name=resource_group_name, @@ -655,9 +667,9 @@ async def get_mongo_db_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -674,7 +686,9 @@ async def get_mongo_db_database_throughput( return deserialized - get_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } async def _update_mongo_db_database_throughput_initial( self, @@ -695,11 +709,11 @@ async def _update_mongo_db_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -723,9 +737,9 @@ async def _update_mongo_db_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -744,7 +758,9 @@ async def _update_mongo_db_database_throughput_initial( return deserialized - _update_mongo_db_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_mongo_db_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } @overload async def begin_update_mongo_db_database_throughput( @@ -871,16 +887,16 @@ async def begin_update_mongo_db_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_mongo_db_database_throughput_initial( # type: ignore + raw_result = await self._update_mongo_db_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -901,7 +917,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -913,9 +929,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } async def _migrate_mongo_db_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -931,10 +949,10 @@ async def _migrate_mongo_db_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -947,9 +965,9 @@ async def _migrate_mongo_db_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -968,7 +986,9 @@ async def _migrate_mongo_db_database_to_autoscale_initial( return deserialized - _migrate_mongo_db_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_mongo_db_database_to_autoscale( @@ -1000,15 +1020,15 @@ async def begin_migrate_mongo_db_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_database_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_mongo_db_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1027,7 +1047,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1039,9 +1059,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_mongo_db_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1057,10 +1079,10 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1073,9 +1095,9 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1094,7 +1116,9 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_mongo_db_database_to_manual_throughput( @@ -1126,15 +1150,15 @@ async def begin_migrate_mongo_db_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_database_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_mongo_db_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1153,7 +1177,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1165,9 +1189,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } async def _mongo_db_database_retrieve_throughput_distribution_initial( self, @@ -1188,11 +1214,11 @@ async def _mongo_db_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1216,9 +1242,9 @@ async def _mongo_db_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1237,7 +1263,9 @@ async def _mongo_db_database_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_mongo_db_database_retrieve_throughput_distribution( @@ -1363,16 +1391,16 @@ async def begin_mongo_db_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = await self._mongo_db_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1393,9 +1421,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1407,9 +1435,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _mongo_db_database_redistribute_throughput_initial( self, @@ -1430,11 +1460,11 @@ async def _mongo_db_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1458,9 +1488,9 @@ async def _mongo_db_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1479,7 +1509,9 @@ async def _mongo_db_database_redistribute_throughput_initial( return deserialized - _mongo_db_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_mongo_db_database_redistribute_throughput( @@ -1606,16 +1638,16 @@ async def begin_mongo_db_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_database_redistribute_throughput_initial( # type: ignore + raw_result = await self._mongo_db_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1636,9 +1668,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1650,9 +1682,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } async def _mongo_db_container_retrieve_throughput_distribution_initial( self, @@ -1674,11 +1708,11 @@ async def _mongo_db_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1703,9 +1737,9 @@ async def _mongo_db_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1724,7 +1758,9 @@ async def _mongo_db_container_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_mongo_db_container_retrieve_throughput_distribution( @@ -1859,16 +1895,16 @@ async def begin_mongo_db_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = await self._mongo_db_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1890,9 +1926,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1904,9 +1940,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _mongo_db_container_redistribute_throughput_initial( self, @@ -1928,11 +1966,11 @@ async def _mongo_db_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1957,9 +1995,9 @@ async def _mongo_db_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1978,7 +2016,9 @@ async def _mongo_db_container_redistribute_throughput_initial( return deserialized - _mongo_db_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_mongo_db_container_redistribute_throughput( @@ -2114,16 +2154,16 @@ async def begin_mongo_db_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_container_redistribute_throughput_initial( # type: ignore + raw_result = await self._mongo_db_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2145,9 +2185,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2159,9 +2199,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_mongo_db_collections( @@ -2186,10 +2228,10 @@ def list_mongo_db_collections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionListResult] + ) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2213,7 +2255,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2229,7 +2271,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2237,13 +2279,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2256,7 +2298,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_db_collections.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections"} # type: ignore + list_mongo_db_collections.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections" + } @distributed_trace_async async def get_mongo_db_collection( @@ -2289,10 +2333,10 @@ async def get_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] + ) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -2306,9 +2350,9 @@ async def get_mongo_db_collection( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2325,7 +2369,9 @@ async def get_mongo_db_collection( return deserialized - get_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + get_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } async def _create_update_mongo_db_collection_initial( self, @@ -2347,11 +2393,11 @@ async def _create_update_mongo_db_collection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBCollectionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBCollectionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2378,9 +2424,9 @@ async def _create_update_mongo_db_collection_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2399,7 +2445,9 @@ async def _create_update_mongo_db_collection_initial( return deserialized - _create_update_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _create_update_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @overload async def begin_create_update_mongo_db_collection( @@ -2535,16 +2583,16 @@ async def begin_create_update_mongo_db_collection( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_db_collection_initial( # type: ignore + raw_result = await self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2566,7 +2614,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2578,9 +2626,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_create_update_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -2596,10 +2646,10 @@ async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -2613,9 +2663,9 @@ async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2628,7 +2678,9 @@ async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _delete_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @distributed_trace_async async def begin_delete_mongo_db_collection( @@ -2660,13 +2712,13 @@ async def begin_delete_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_db_collection_initial( # type: ignore resource_group_name=resource_group_name, @@ -2686,7 +2738,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2698,9 +2750,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_delete_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } async def _list_mongo_db_collection_partition_merge_initial( self, @@ -2722,11 +2776,11 @@ async def _list_mongo_db_collection_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2751,9 +2805,9 @@ async def _list_mongo_db_collection_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2772,7 +2826,9 @@ async def _list_mongo_db_collection_partition_merge_initial( return deserialized - _list_mongo_db_collection_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + _list_mongo_db_collection_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @overload async def begin_list_mongo_db_collection_partition_merge( @@ -2904,16 +2960,16 @@ async def begin_list_mongo_db_collection_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._list_mongo_db_collection_partition_merge_initial( # type: ignore + raw_result = await self._list_mongo_db_collection_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2935,9 +2991,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2949,9 +3005,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_mongo_db_collection_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + begin_list_mongo_db_collection_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @distributed_trace_async async def get_mongo_db_collection_throughput( @@ -2985,10 +3043,10 @@ async def get_mongo_db_collection_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_throughput_request( resource_group_name=resource_group_name, @@ -3002,9 +3060,9 @@ async def get_mongo_db_collection_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3021,7 +3079,9 @@ async def get_mongo_db_collection_throughput( return deserialized - get_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + get_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } async def _update_mongo_db_collection_throughput_initial( self, @@ -3043,11 +3103,11 @@ async def _update_mongo_db_collection_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3072,9 +3132,9 @@ async def _update_mongo_db_collection_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3093,7 +3153,9 @@ async def _update_mongo_db_collection_throughput_initial( return deserialized - _update_mongo_db_collection_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + _update_mongo_db_collection_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } @overload async def begin_update_mongo_db_collection_throughput( @@ -3229,16 +3291,16 @@ async def begin_update_mongo_db_collection_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_mongo_db_collection_throughput_initial( # type: ignore + raw_result = await self._update_mongo_db_collection_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3260,7 +3322,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3272,9 +3334,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } async def _migrate_mongo_db_collection_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -3290,10 +3354,10 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_autoscale_request( resource_group_name=resource_group_name, @@ -3307,9 +3371,9 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3328,7 +3392,9 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( return deserialized - _migrate_mongo_db_collection_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_collection_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_mongo_db_collection_to_autoscale( @@ -3362,15 +3428,15 @@ async def begin_migrate_mongo_db_collection_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_collection_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_mongo_db_collection_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3390,7 +3456,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3402,9 +3468,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_collection_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_mongo_db_collection_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -3420,10 +3488,10 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -3437,9 +3505,9 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3458,7 +3526,9 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_mongo_db_collection_to_manual_throughput( @@ -3492,15 +3562,15 @@ async def begin_migrate_mongo_db_collection_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_collection_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_mongo_db_collection_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3520,7 +3590,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3532,9 +3602,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_collection_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def get_mongo_role_definition( @@ -3566,10 +3638,10 @@ async def get_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] + ) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -3582,9 +3654,9 @@ async def get_mongo_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3601,7 +3673,9 @@ async def get_mongo_role_definition( return deserialized - get_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + get_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } async def _create_update_mongo_role_definition_initial( self, @@ -3622,11 +3696,11 @@ async def _create_update_mongo_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3652,9 +3726,9 @@ async def _create_update_mongo_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3673,7 +3747,9 @@ async def _create_update_mongo_role_definition_initial( return deserialized - _create_update_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _create_update_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @overload async def begin_create_update_mongo_role_definition( @@ -3800,16 +3876,16 @@ async def begin_create_update_mongo_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_role_definition_initial( # type: ignore + raw_result = await self._create_update_mongo_role_definition_initial( mongo_role_definition_id=mongo_role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -3830,7 +3906,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3842,9 +3918,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_create_update_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -3860,10 +3938,10 @@ async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -3876,9 +3954,9 @@ async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3891,7 +3969,9 @@ async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent if cls: return cls(pipeline_response, None, {}) - _delete_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _delete_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace_async async def begin_delete_mongo_role_definition( @@ -3921,13 +4001,13 @@ async def begin_delete_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_role_definition_initial( # type: ignore mongo_role_definition_id=mongo_role_definition_id, @@ -3946,7 +4026,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3958,9 +4038,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_delete_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace def list_mongo_role_definitions( @@ -3983,10 +4065,10 @@ def list_mongo_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionListResult] + ) + cls: ClsType[_models.MongoRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4009,7 +4091,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4025,7 +4107,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4033,13 +4115,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4052,7 +4134,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions"} # type: ignore + list_mongo_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions" + } @distributed_trace_async async def get_mongo_user_definition( @@ -4084,10 +4168,10 @@ async def get_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] + ) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -4100,9 +4184,9 @@ async def get_mongo_user_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4119,7 +4203,9 @@ async def get_mongo_user_definition( return deserialized - get_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + get_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } async def _create_update_mongo_user_definition_initial( self, @@ -4140,11 +4226,11 @@ async def _create_update_mongo_user_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoUserDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoUserDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4170,9 +4256,9 @@ async def _create_update_mongo_user_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4191,7 +4277,9 @@ async def _create_update_mongo_user_definition_initial( return deserialized - _create_update_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _create_update_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @overload async def begin_create_update_mongo_user_definition( @@ -4318,16 +4406,16 @@ async def begin_create_update_mongo_user_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_user_definition_initial( # type: ignore + raw_result = await self._create_update_mongo_user_definition_initial( mongo_user_definition_id=mongo_user_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -4348,7 +4436,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4360,9 +4448,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_create_update_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_user_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -4378,10 +4468,10 @@ async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -4394,9 +4484,9 @@ async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4409,7 +4499,9 @@ async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent if cls: return cls(pipeline_response, None, {}) - _delete_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _delete_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace_async async def begin_delete_mongo_user_definition( @@ -4439,13 +4531,13 @@ async def begin_delete_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_user_definition_initial( # type: ignore mongo_user_definition_id=mongo_user_definition_id, @@ -4464,7 +4556,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4476,9 +4568,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_delete_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace def list_mongo_user_definitions( @@ -4501,10 +4595,10 @@ def list_mongo_user_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionListResult] + ) + cls: ClsType[_models.MongoUserDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4527,7 +4621,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4543,7 +4637,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4551,13 +4645,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoUserDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4570,7 +4664,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_user_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions"} # type: ignore + list_mongo_user_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions" + } async def _retrieve_continuous_backup_information_initial( self, @@ -4592,11 +4688,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4621,9 +4717,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4642,7 +4738,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -4771,16 +4869,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4802,9 +4900,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4816,6 +4914,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py index 28205c6250ea..060f75ff6aab 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py @@ -87,10 +87,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceListResult] + ) + cls: ClsType[_models.NotebookWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,7 +113,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -129,7 +129,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -137,13 +137,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("NotebookWorkspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -157,7 +157,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces" + } @distributed_trace_async async def get( @@ -193,10 +195,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -209,9 +211,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -229,7 +231,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } async def _create_or_update_initial( self, @@ -250,11 +254,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -278,9 +282,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,7 +302,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @overload async def begin_create_or_update( @@ -425,16 +431,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, notebook_workspace_name=notebook_workspace_name, @@ -455,7 +461,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -467,9 +473,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -489,10 +497,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -505,9 +513,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -521,7 +529,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace_async async def begin_delete( @@ -556,13 +566,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -581,7 +591,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -593,9 +603,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace_async async def list_connection_info( @@ -631,10 +643,10 @@ async def list_connection_info( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceConnectionInfoResult] + ) + cls: ClsType[_models.NotebookWorkspaceConnectionInfoResult] = kwargs.pop("cls", None) request = build_list_connection_info_request( resource_group_name=resource_group_name, @@ -647,9 +659,9 @@ async def list_connection_info( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -667,7 +679,9 @@ async def list_connection_info( return deserialized - list_connection_info.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo"} # type: ignore + list_connection_info.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo" + } async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-statements self, @@ -687,10 +701,10 @@ async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_regenerate_auth_token_request( resource_group_name=resource_group_name, @@ -703,9 +717,9 @@ async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -719,7 +733,9 @@ async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _regenerate_auth_token_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + _regenerate_auth_token_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } @distributed_trace_async async def begin_regenerate_auth_token( @@ -754,13 +770,13 @@ async def begin_regenerate_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._regenerate_auth_token_initial( # type: ignore resource_group_name=resource_group_name, @@ -779,7 +795,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -791,9 +807,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_auth_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + begin_regenerate_auth_token.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -813,10 +831,10 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -829,9 +847,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -845,7 +863,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } @distributed_trace_async async def begin_start( @@ -880,13 +900,13 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -905,7 +925,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -917,6 +937,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py index fc94e37006bf..be98591d79c4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py @@ -69,10 +69,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -92,7 +92,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -108,7 +108,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -116,13 +116,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -135,4 +135,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py index 163426b27448..92c30f07a2c2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py @@ -93,10 +93,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -123,7 +123,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -139,7 +139,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -147,13 +147,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -166,4 +166,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py index 50a7915bb7b6..c7e250bfe44c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py @@ -97,10 +97,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,7 +128,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -144,7 +144,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -152,13 +152,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -171,4 +171,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py index 97c4c2cefa9d..3157b0f1648b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py @@ -81,10 +81,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,7 +108,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -124,7 +124,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,4 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py index e7cc706de2a4..0ccbd9438ca1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py @@ -93,10 +93,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,7 +122,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -138,7 +138,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py index 39aa19a07c53..b95c37e85d15 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py @@ -84,10 +84,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +112,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -128,7 +128,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -136,13 +136,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -155,4 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py index d79bf1fc3e52..d3f223eafe0e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py @@ -86,10 +86,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +112,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -128,7 +128,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -136,13 +136,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -155,7 +155,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections" + } @distributed_trace_async async def get( @@ -186,10 +188,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -202,9 +204,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -221,7 +223,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _create_or_update_initial( self, @@ -242,11 +246,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -270,9 +274,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -292,7 +296,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload async def begin_create_or_update( @@ -414,16 +420,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -444,7 +450,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -456,9 +462,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -474,10 +482,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -490,9 +498,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -506,7 +514,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -536,13 +546,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -561,7 +571,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -573,6 +583,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py index 3f74aafee8de..bf02f707b234 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py @@ -78,10 +78,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,7 +104,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -120,7 +120,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -128,13 +128,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -147,7 +147,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources" + } @distributed_trace_async async def get( @@ -178,10 +180,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -194,9 +196,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,4 +215,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py index 42a6eb44655e..43d6eaa58d28 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py @@ -83,10 +83,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,7 +108,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -124,7 +124,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,7 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.RestorableDatabaseAccountGetResult"]: @@ -168,10 +170,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.RestorableDatabaseAccoun _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -192,7 +194,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -208,7 +210,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -216,13 +218,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -235,7 +237,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} @distributed_trace_async async def get_by_location( @@ -265,10 +267,10 @@ async def get_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountGetResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountGetResult] = kwargs.pop("cls", None) request = build_get_by_location_request( location=location, @@ -280,9 +282,9 @@ async def get_by_location( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -299,4 +301,6 @@ async def get_by_location( return deserialized - get_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}"} # type: ignore + get_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py index 9ffd2d6e7b6a..3052cd1a1cee 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py @@ -81,10 +81,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinDatabasesListResult] + ) + cls: ClsType[_models.RestorableGremlinDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,4 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py index b11afe582572..ac7a15baf23c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py @@ -93,10 +93,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinGraphsListResult] + ) + cls: ClsType[_models.RestorableGremlinGraphsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,7 +122,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -138,7 +138,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinGraphsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py index 4bd33c6dbdeb..abe3a74a3b36 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinResourcesListResult] + ) + cls: ClsType[_models.RestorableGremlinResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,4 +163,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py index 7fe523e667fe..1ae26eacb831 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py @@ -93,10 +93,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbCollectionsListResult] + ) + cls: ClsType[_models.RestorableMongodbCollectionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,7 +122,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -138,7 +138,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbCollectionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py index 28977cd2b3eb..c7e1436f7da0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py @@ -81,10 +81,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbDatabasesListResult] + ) + cls: ClsType[_models.RestorableMongodbDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,4 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py index 4ee7e84fd2fb..0b5a6de139d2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbResourcesListResult] + ) + cls: ClsType[_models.RestorableMongodbResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,4 +163,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py index 7b2c3af2f4d1..77048a18733f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlContainersListResult] + ) + cls: ClsType[_models.RestorableSqlContainersListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -121,7 +121,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -137,7 +137,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -145,13 +145,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlContainersListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -164,4 +164,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py index d27cced217ae..82d8346c8720 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py @@ -81,10 +81,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlDatabasesListResult] + ) + cls: ClsType[_models.RestorableSqlDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,4 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py index 65124eaf723a..a12844d6ccd9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlResourcesListResult] + ) + cls: ClsType[_models.RestorableSqlResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,4 +163,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py index c37e1426f095..bee4ad5fcd0f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py @@ -91,10 +91,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTableResourcesListResult] + ) + cls: ClsType[_models.RestorableTableResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -119,7 +119,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -135,7 +135,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -143,13 +143,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTableResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -162,4 +162,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py index 6d3cf445f193..140c39c9dcaa 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py @@ -89,10 +89,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTablesListResult] + ) + cls: ClsType[_models.RestorableTablesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,7 +117,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -133,7 +133,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -141,13 +141,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTablesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -160,4 +160,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py index 51272509c629..9622344de685 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py @@ -84,10 +84,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResourceListResult] + ) + cls: ClsType[_models.ServiceResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,7 +110,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -126,7 +126,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -134,13 +134,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -153,7 +153,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services" + } async def _create_initial( self, @@ -174,11 +176,11 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServiceResource]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServiceResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -202,9 +204,9 @@ async def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -223,7 +225,9 @@ async def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @overload async def begin_create( @@ -345,16 +349,16 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( # type: ignore + raw_result = await self._create_initial( resource_group_name=resource_group_name, account_name=account_name, service_name=service_name, @@ -375,7 +379,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -387,9 +391,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace_async async def get( @@ -420,10 +426,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -436,9 +442,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -455,7 +461,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, service_name: str, **kwargs: Any @@ -471,10 +479,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -487,9 +495,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -502,7 +510,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace_async async def begin_delete( @@ -532,13 +542,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -557,7 +567,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -569,6 +579,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py index 2f568d744fea..a9f768c3a458 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py @@ -127,10 +127,10 @@ def list_sql_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseListResult] + ) + cls: ClsType[_models.SqlDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -153,7 +153,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -169,7 +169,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -177,13 +177,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -196,7 +196,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases"} # type: ignore + list_sql_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases" + } @distributed_trace_async async def get_sql_database( @@ -228,10 +230,10 @@ async def get_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] + ) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_request( resource_group_name=resource_group_name, @@ -244,9 +246,9 @@ async def get_sql_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -263,7 +265,9 @@ async def get_sql_database( return deserialized - get_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + get_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } async def _create_update_sql_database_initial( self, @@ -284,11 +288,11 @@ async def _create_update_sql_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -312,9 +316,9 @@ async def _create_update_sql_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -333,7 +337,9 @@ async def _create_update_sql_database_initial( return deserialized - _create_update_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _create_update_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @overload async def begin_create_update_sql_database( @@ -457,16 +463,16 @@ async def begin_create_update_sql_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_database_initial( # type: ignore + raw_result = await self._create_update_sql_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -487,7 +493,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -499,9 +505,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_create_update_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -517,10 +525,10 @@ async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_database_request( resource_group_name=resource_group_name, @@ -533,9 +541,9 @@ async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-s params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -548,7 +556,9 @@ async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-s if cls: return cls(pipeline_response, None, {}) - _delete_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _delete_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace_async async def begin_delete_sql_database( @@ -578,13 +588,13 @@ async def begin_delete_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -603,7 +613,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -615,9 +625,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_delete_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace_async async def get_sql_database_throughput( @@ -649,10 +661,10 @@ async def get_sql_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_throughput_request( resource_group_name=resource_group_name, @@ -665,9 +677,9 @@ async def get_sql_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -684,7 +696,9 @@ async def get_sql_database_throughput( return deserialized - get_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } async def _update_sql_database_throughput_initial( self, @@ -705,11 +719,11 @@ async def _update_sql_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -733,9 +747,9 @@ async def _update_sql_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -754,7 +768,9 @@ async def _update_sql_database_throughput_initial( return deserialized - _update_sql_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_sql_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } @overload async def begin_update_sql_database_throughput( @@ -881,16 +897,16 @@ async def begin_update_sql_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_sql_database_throughput_initial( # type: ignore + raw_result = await self._update_sql_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -911,7 +927,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -923,9 +939,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } async def _migrate_sql_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -941,10 +959,10 @@ async def _migrate_sql_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -957,9 +975,9 @@ async def _migrate_sql_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -978,7 +996,9 @@ async def _migrate_sql_database_to_autoscale_initial( return deserialized - _migrate_sql_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_sql_database_to_autoscale( @@ -1010,15 +1030,15 @@ async def begin_migrate_sql_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_database_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_sql_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1037,7 +1057,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1049,9 +1069,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_sql_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1067,10 +1089,10 @@ async def _migrate_sql_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1083,9 +1105,9 @@ async def _migrate_sql_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1104,7 +1126,9 @@ async def _migrate_sql_database_to_manual_throughput_initial( return deserialized - _migrate_sql_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_sql_database_to_manual_throughput( @@ -1136,15 +1160,15 @@ async def begin_migrate_sql_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_database_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_sql_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1163,7 +1187,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1175,9 +1199,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_client_encryption_keys( @@ -1202,10 +1228,10 @@ def list_client_encryption_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeysListResult] + ) + cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1229,7 +1255,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1245,7 +1271,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1253,13 +1279,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1272,7 +1298,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_client_encryption_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys"} # type: ignore + list_client_encryption_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys" + } @distributed_trace_async async def get_client_encryption_key( @@ -1310,10 +1338,10 @@ async def get_client_encryption_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] + ) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) request = build_get_client_encryption_key_request( resource_group_name=resource_group_name, @@ -1327,9 +1355,9 @@ async def get_client_encryption_key( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1346,7 +1374,9 @@ async def get_client_encryption_key( return deserialized - get_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + get_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } async def _create_update_client_encryption_key_initial( self, @@ -1368,11 +1398,11 @@ async def _create_update_client_encryption_key_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1399,9 +1429,9 @@ async def _create_update_client_encryption_key_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1420,7 +1450,9 @@ async def _create_update_client_encryption_key_initial( return deserialized - _create_update_client_encryption_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + _create_update_client_encryption_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @overload async def begin_create_update_client_encryption_key( @@ -1559,16 +1591,16 @@ async def begin_create_update_client_encryption_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_client_encryption_key_initial( # type: ignore + raw_result = await self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1590,7 +1622,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1602,9 +1634,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + begin_create_update_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @distributed_trace def list_sql_containers( @@ -1629,10 +1663,10 @@ def list_sql_containers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerListResult] + ) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1656,7 +1690,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1672,7 +1706,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1680,13 +1714,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1699,7 +1733,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_containers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers"} # type: ignore + list_sql_containers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers" + } @distributed_trace_async async def get_sql_container( @@ -1732,10 +1768,10 @@ async def get_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] + ) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_request( resource_group_name=resource_group_name, @@ -1749,9 +1785,9 @@ async def get_sql_container( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1768,7 +1804,9 @@ async def get_sql_container( return deserialized - get_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + get_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } async def _create_update_sql_container_initial( self, @@ -1790,11 +1828,11 @@ async def _create_update_sql_container_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlContainerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlContainerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1819,9 +1857,9 @@ async def _create_update_sql_container_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1840,7 +1878,9 @@ async def _create_update_sql_container_initial( return deserialized - _create_update_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _create_update_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @overload async def begin_create_update_sql_container( @@ -1973,16 +2013,16 @@ async def begin_create_update_sql_container( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_container_initial( # type: ignore + raw_result = await self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2004,7 +2044,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2016,9 +2056,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_create_update_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } async def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -2034,10 +2076,10 @@ async def _delete_sql_container_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_container_request( resource_group_name=resource_group_name, @@ -2051,9 +2093,9 @@ async def _delete_sql_container_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2066,7 +2108,9 @@ async def _delete_sql_container_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _delete_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @distributed_trace_async async def begin_delete_sql_container( @@ -2098,13 +2142,13 @@ async def begin_delete_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_container_initial( # type: ignore resource_group_name=resource_group_name, @@ -2124,7 +2168,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2136,9 +2180,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_delete_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } async def _list_sql_container_partition_merge_initial( self, @@ -2160,11 +2206,11 @@ async def _list_sql_container_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2189,9 +2235,9 @@ async def _list_sql_container_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2210,7 +2256,9 @@ async def _list_sql_container_partition_merge_initial( return deserialized - _list_sql_container_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + _list_sql_container_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @overload async def begin_list_sql_container_partition_merge( @@ -2342,16 +2390,16 @@ async def begin_list_sql_container_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._list_sql_container_partition_merge_initial( # type: ignore + raw_result = await self._list_sql_container_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2373,9 +2421,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2387,9 +2435,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_sql_container_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + begin_list_sql_container_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @distributed_trace_async async def get_sql_container_throughput( @@ -2423,10 +2473,10 @@ async def get_sql_container_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, @@ -2440,9 +2490,9 @@ async def get_sql_container_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2459,7 +2509,9 @@ async def get_sql_container_throughput( return deserialized - get_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + get_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } async def _update_sql_container_throughput_initial( self, @@ -2481,11 +2533,11 @@ async def _update_sql_container_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2510,9 +2562,9 @@ async def _update_sql_container_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2531,7 +2583,9 @@ async def _update_sql_container_throughput_initial( return deserialized - _update_sql_container_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + _update_sql_container_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } @overload async def begin_update_sql_container_throughput( @@ -2667,16 +2721,16 @@ async def begin_update_sql_container_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_sql_container_throughput_initial( # type: ignore + raw_result = await self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2698,7 +2752,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2710,9 +2764,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + begin_update_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } async def _migrate_sql_container_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -2728,10 +2784,10 @@ async def _migrate_sql_container_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, @@ -2745,9 +2801,9 @@ async def _migrate_sql_container_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2766,7 +2822,9 @@ async def _migrate_sql_container_to_autoscale_initial( return deserialized - _migrate_sql_container_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_container_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_sql_container_to_autoscale( @@ -2800,15 +2858,15 @@ async def begin_migrate_sql_container_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_container_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2828,7 +2886,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2840,9 +2898,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_container_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_sql_container_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -2858,10 +2918,10 @@ async def _migrate_sql_container_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2875,9 +2935,9 @@ async def _migrate_sql_container_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2896,7 +2956,9 @@ async def _migrate_sql_container_to_manual_throughput_initial( return deserialized - _migrate_sql_container_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_container_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_sql_container_to_manual_throughput( @@ -2930,15 +2992,15 @@ async def begin_migrate_sql_container_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_container_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2958,7 +3020,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2970,9 +3032,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_container_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } async def _sql_database_retrieve_throughput_distribution_initial( self, @@ -2993,11 +3057,11 @@ async def _sql_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3021,9 +3085,9 @@ async def _sql_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3042,7 +3106,9 @@ async def _sql_database_retrieve_throughput_distribution_initial( return deserialized - _sql_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_sql_database_retrieve_throughput_distribution( @@ -3168,16 +3234,16 @@ async def begin_sql_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = await self._sql_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3198,9 +3264,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3212,9 +3278,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _sql_database_redistribute_throughput_initial( self, @@ -3235,11 +3303,11 @@ async def _sql_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3263,9 +3331,9 @@ async def _sql_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3284,7 +3352,9 @@ async def _sql_database_redistribute_throughput_initial( return deserialized - _sql_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_sql_database_redistribute_throughput( @@ -3411,16 +3481,16 @@ async def begin_sql_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_database_redistribute_throughput_initial( # type: ignore + raw_result = await self._sql_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3441,9 +3511,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3455,9 +3525,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } async def _sql_container_retrieve_throughput_distribution_initial( self, @@ -3479,11 +3551,11 @@ async def _sql_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3508,9 +3580,9 @@ async def _sql_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3529,7 +3601,9 @@ async def _sql_container_retrieve_throughput_distribution_initial( return deserialized - _sql_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_sql_container_retrieve_throughput_distribution( @@ -3664,16 +3738,16 @@ async def begin_sql_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = await self._sql_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3695,9 +3769,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3709,9 +3783,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _sql_container_redistribute_throughput_initial( self, @@ -3733,11 +3809,11 @@ async def _sql_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3762,9 +3838,9 @@ async def _sql_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3783,7 +3859,9 @@ async def _sql_container_redistribute_throughput_initial( return deserialized - _sql_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_sql_container_redistribute_throughput( @@ -3919,16 +3997,16 @@ async def begin_sql_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_container_redistribute_throughput_initial( # type: ignore + raw_result = await self._sql_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3950,9 +4028,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3964,9 +4042,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_sql_stored_procedures( @@ -3993,10 +4073,10 @@ def list_sql_stored_procedures( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureListResult] + ) + cls: ClsType[_models.SqlStoredProcedureListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4021,7 +4101,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4037,7 +4117,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4045,13 +4125,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlStoredProcedureListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4064,7 +4144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_stored_procedures.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures"} # type: ignore + list_sql_stored_procedures.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures" + } @distributed_trace_async async def get_sql_stored_procedure( @@ -4105,10 +4187,10 @@ async def get_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] + ) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) request = build_get_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -4123,9 +4205,9 @@ async def get_sql_stored_procedure( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4142,7 +4224,9 @@ async def get_sql_stored_procedure( return deserialized - get_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + get_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } async def _create_update_sql_stored_procedure_initial( self, @@ -4165,11 +4249,11 @@ async def _create_update_sql_stored_procedure_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlStoredProcedureGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlStoredProcedureGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4197,9 +4281,9 @@ async def _create_update_sql_stored_procedure_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4218,7 +4302,9 @@ async def _create_update_sql_stored_procedure_initial( return deserialized - _create_update_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _create_update_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @overload async def begin_create_update_sql_stored_procedure( @@ -4363,16 +4449,16 @@ async def begin_create_update_sql_stored_procedure( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_stored_procedure_initial( # type: ignore + raw_result = await self._create_update_sql_stored_procedure_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4395,7 +4481,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4407,9 +4493,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_create_update_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return-statements self, @@ -4431,10 +4519,10 @@ async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -4449,9 +4537,9 @@ async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4464,7 +4552,9 @@ async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - _delete_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _delete_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace_async async def begin_delete_sql_stored_procedure( @@ -4504,13 +4594,13 @@ async def begin_delete_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_stored_procedure_initial( # type: ignore resource_group_name=resource_group_name, @@ -4531,7 +4621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4543,9 +4633,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_delete_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace def list_sql_user_defined_functions( @@ -4572,10 +4664,10 @@ def list_sql_user_defined_functions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionListResult] + ) + cls: ClsType[_models.SqlUserDefinedFunctionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4600,7 +4692,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4616,7 +4708,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4624,13 +4716,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlUserDefinedFunctionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4643,7 +4735,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_user_defined_functions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions"} # type: ignore + list_sql_user_defined_functions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions" + } @distributed_trace_async async def get_sql_user_defined_function( @@ -4684,10 +4778,10 @@ async def get_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] + ) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) request = build_get_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -4702,9 +4796,9 @@ async def get_sql_user_defined_function( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4721,7 +4815,9 @@ async def get_sql_user_defined_function( return deserialized - get_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + get_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } async def _create_update_sql_user_defined_function_initial( self, @@ -4746,11 +4842,11 @@ async def _create_update_sql_user_defined_function_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4778,9 +4874,9 @@ async def _create_update_sql_user_defined_function_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4799,7 +4895,9 @@ async def _create_update_sql_user_defined_function_initial( return deserialized - _create_update_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _create_update_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @overload async def begin_create_update_sql_user_defined_function( @@ -4946,16 +5044,16 @@ async def begin_create_update_sql_user_defined_function( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_user_defined_function_initial( # type: ignore + raw_result = await self._create_update_sql_user_defined_function_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4978,7 +5076,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4990,9 +5088,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_create_update_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-return-statements self, @@ -5014,10 +5114,10 @@ async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -5032,9 +5132,9 @@ async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsis params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5047,7 +5147,9 @@ async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsis if cls: return cls(pipeline_response, None, {}) - _delete_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _delete_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace_async async def begin_delete_sql_user_defined_function( @@ -5087,13 +5189,13 @@ async def begin_delete_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_user_defined_function_initial( # type: ignore resource_group_name=resource_group_name, @@ -5114,7 +5216,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5126,9 +5228,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_delete_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace def list_sql_triggers( @@ -5155,10 +5259,10 @@ def list_sql_triggers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerListResult] + ) + cls: ClsType[_models.SqlTriggerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5183,7 +5287,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5199,7 +5303,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5207,13 +5311,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlTriggerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5226,7 +5330,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_triggers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers"} # type: ignore + list_sql_triggers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers" + } @distributed_trace_async async def get_sql_trigger( @@ -5267,10 +5373,10 @@ async def get_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] + ) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) request = build_get_sql_trigger_request( resource_group_name=resource_group_name, @@ -5285,9 +5391,9 @@ async def get_sql_trigger( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5304,7 +5410,9 @@ async def get_sql_trigger( return deserialized - get_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + get_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } async def _create_update_sql_trigger_initial( self, @@ -5327,11 +5435,11 @@ async def _create_update_sql_trigger_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlTriggerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlTriggerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5357,9 +5465,9 @@ async def _create_update_sql_trigger_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5378,7 +5486,9 @@ async def _create_update_sql_trigger_initial( return deserialized - _create_update_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _create_update_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @overload async def begin_create_update_sql_trigger( @@ -5520,16 +5630,16 @@ async def begin_create_update_sql_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_trigger_initial( # type: ignore + raw_result = await self._create_update_sql_trigger_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5552,7 +5662,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5564,9 +5674,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_create_update_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statements self, @@ -5588,10 +5700,10 @@ async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_trigger_request( resource_group_name=resource_group_name, @@ -5606,9 +5718,9 @@ async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5621,7 +5733,9 @@ async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _delete_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace_async async def begin_delete_sql_trigger( @@ -5661,13 +5775,13 @@ async def begin_delete_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_trigger_initial( # type: ignore resource_group_name=resource_group_name, @@ -5688,7 +5802,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5700,9 +5814,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_delete_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace_async async def get_sql_role_definition( @@ -5733,10 +5849,10 @@ async def get_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] + ) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_definition_request( role_definition_id=role_definition_id, @@ -5749,9 +5865,9 @@ async def get_sql_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5768,7 +5884,9 @@ async def get_sql_role_definition( return deserialized - get_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + get_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } async def _create_update_sql_role_definition_initial( self, @@ -5789,11 +5907,11 @@ async def _create_update_sql_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5819,9 +5937,9 @@ async def _create_update_sql_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5840,7 +5958,9 @@ async def _create_update_sql_role_definition_initial( return deserialized - _create_update_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _create_update_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @overload async def begin_create_update_sql_role_definition( @@ -5967,16 +6087,16 @@ async def begin_create_update_sql_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_role_definition_initial( # type: ignore + raw_result = await self._create_update_sql_role_definition_initial( role_definition_id=role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -5997,7 +6117,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6009,9 +6129,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_create_update_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return-statements self, role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -6027,10 +6149,10 @@ async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_definition_request( role_definition_id=role_definition_id, @@ -6043,9 +6165,9 @@ async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6058,7 +6180,9 @@ async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _delete_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace_async async def begin_delete_sql_role_definition( @@ -6088,13 +6212,13 @@ async def begin_delete_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_role_definition_initial( # type: ignore role_definition_id=role_definition_id, @@ -6113,7 +6237,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6125,9 +6249,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_delete_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace def list_sql_role_definitions( @@ -6150,10 +6276,10 @@ def list_sql_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionListResult] + ) + cls: ClsType[_models.SqlRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6176,7 +6302,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -6192,7 +6318,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -6200,13 +6326,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -6219,7 +6345,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions"} # type: ignore + list_sql_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions" + } @distributed_trace_async async def get_sql_role_assignment( @@ -6250,10 +6378,10 @@ async def get_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] + ) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -6266,9 +6394,9 @@ async def get_sql_role_assignment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6285,7 +6413,9 @@ async def get_sql_role_assignment( return deserialized - get_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + get_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } async def _create_update_sql_role_assignment_initial( self, @@ -6306,11 +6436,11 @@ async def _create_update_sql_role_assignment_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6336,9 +6466,9 @@ async def _create_update_sql_role_assignment_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6357,7 +6487,9 @@ async def _create_update_sql_role_assignment_initial( return deserialized - _create_update_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _create_update_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @overload async def begin_create_update_sql_role_assignment( @@ -6484,16 +6616,16 @@ async def begin_create_update_sql_role_assignment( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_role_assignment_initial( # type: ignore + raw_result = await self._create_update_sql_role_assignment_initial( role_assignment_id=role_assignment_id, resource_group_name=resource_group_name, account_name=account_name, @@ -6514,7 +6646,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6526,9 +6658,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_create_update_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return-statements self, role_assignment_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -6544,10 +6678,10 @@ async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -6560,9 +6694,9 @@ async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6575,7 +6709,9 @@ async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _delete_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace_async async def begin_delete_sql_role_assignment( @@ -6605,13 +6741,13 @@ async def begin_delete_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_role_assignment_initial( # type: ignore role_assignment_id=role_assignment_id, @@ -6630,7 +6766,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6642,9 +6778,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_delete_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace def list_sql_role_assignments( @@ -6667,10 +6805,10 @@ def list_sql_role_assignments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentListResult] + ) + cls: ClsType[_models.SqlRoleAssignmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6693,7 +6831,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -6709,7 +6847,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -6717,13 +6855,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleAssignmentListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -6736,7 +6874,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_role_assignments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments"} # type: ignore + list_sql_role_assignments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments" + } async def _retrieve_continuous_backup_information_initial( self, @@ -6758,11 +6898,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6787,9 +6927,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6808,7 +6948,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -6937,16 +7079,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -6968,9 +7110,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6982,6 +7124,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py index 7fb87c8f5e24..443656aa871a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py @@ -89,10 +89,10 @@ def list_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableListResult] + ) + cls: ClsType[_models.TableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -131,7 +131,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("TableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,7 +158,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables"} # type: ignore + list_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables" + } @distributed_trace_async async def get_table( @@ -189,10 +191,10 @@ async def get_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] + ) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) request = build_get_table_request( resource_group_name=resource_group_name, @@ -205,9 +207,9 @@ async def get_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -224,7 +226,9 @@ async def get_table( return deserialized - get_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + get_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } async def _create_update_table_initial( self, @@ -245,11 +249,11 @@ async def _create_update_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.TableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.TableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -273,9 +277,9 @@ async def _create_update_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -294,7 +298,9 @@ async def _create_update_table_initial( return deserialized - _create_update_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _create_update_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @overload async def begin_create_update_table( @@ -417,16 +423,16 @@ async def begin_create_update_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_table_initial( # type: ignore + raw_result = await self._create_update_table_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -447,7 +453,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -459,9 +465,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_create_update_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } async def _delete_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -477,10 +485,10 @@ async def _delete_table_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_table_request( resource_group_name=resource_group_name, @@ -493,9 +501,9 @@ async def _delete_table_initial( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -508,7 +516,9 @@ async def _delete_table_initial( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - _delete_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _delete_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace_async async def begin_delete_table( @@ -538,13 +548,13 @@ async def begin_delete_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -563,7 +573,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -575,9 +585,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_delete_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace_async async def get_table_throughput( @@ -609,10 +621,10 @@ async def get_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_table_throughput_request( resource_group_name=resource_group_name, @@ -625,9 +637,9 @@ async def get_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -644,7 +656,9 @@ async def get_table_throughput( return deserialized - get_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } async def _update_table_throughput_initial( self, @@ -665,11 +679,11 @@ async def _update_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -693,9 +707,9 @@ async def _update_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -714,7 +728,9 @@ async def _update_table_throughput_initial( return deserialized - _update_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } @overload async def begin_update_table_throughput( @@ -841,16 +857,16 @@ async def begin_update_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_table_throughput_initial( # type: ignore + raw_result = await self._update_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -871,7 +887,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -883,9 +899,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } async def _migrate_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -901,10 +919,10 @@ async def _migrate_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -917,9 +935,9 @@ async def _migrate_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -938,7 +956,9 @@ async def _migrate_table_to_autoscale_initial( return deserialized - _migrate_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_table_to_autoscale( @@ -970,15 +990,15 @@ async def begin_migrate_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_table_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -997,7 +1017,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1009,9 +1029,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -1027,10 +1049,10 @@ async def _migrate_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1043,9 +1065,9 @@ async def _migrate_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1064,7 +1086,9 @@ async def _migrate_table_to_manual_throughput_initial( return deserialized - _migrate_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_table_to_manual_throughput( @@ -1096,15 +1120,15 @@ async def begin_migrate_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_table_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1123,7 +1147,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1135,9 +1159,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } async def _retrieve_continuous_backup_information_initial( self, @@ -1158,11 +1184,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1186,9 +1212,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1207,7 +1233,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -1327,16 +1355,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1357,9 +1385,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1371,6 +1399,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index b4f2e142fde6..923508722485 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -356,7 +356,7 @@ from ._cosmos_db_management_client_enums import TriggerType from ._cosmos_db_management_client_enums import UnitType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py index 5d97d53df9cc..f6936ae4c1d6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py @@ -390,7 +390,7 @@ class DataTransferDataSourceSink(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.component = None # type: Optional[str] + self.component: Optional[str] = None class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): @@ -426,7 +426,7 @@ def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, * :paramtype endpoint_url: str """ super().__init__(**kwargs) - self.component = "AzureBlobStorage" # type: str + self.component: str = "AzureBlobStorage" self.container_name = container_name self.endpoint_url = endpoint_url @@ -488,7 +488,7 @@ def __init__(self, *, migration_state: Optional["_models.BackupPolicyMigrationSt :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState """ super().__init__(**kwargs) - self.type = None # type: Optional[str] + self.type: Optional[str] = None self.migration_state = migration_state @@ -3048,7 +3048,7 @@ def __init__( :paramtype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties """ super().__init__(migration_state=migration_state, **kwargs) - self.type = "Continuous" # type: str + self.type: str = "Continuous" self.continuous_mode_properties = continuous_mode_properties @@ -3178,7 +3178,7 @@ def __init__(self, *, keyspace_name: str, table_name: str, **kwargs): :paramtype table_name: str """ super().__init__(**kwargs) - self.component = "CosmosDBCassandra" # type: str + self.component: str = "CosmosDBCassandra" self.keyspace_name = keyspace_name self.table_name = table_name @@ -3217,7 +3217,7 @@ def __init__(self, *, database_name: str, collection_name: str, **kwargs): :paramtype collection_name: str """ super().__init__(**kwargs) - self.component = "CosmosDBMongo" # type: str + self.component: str = "CosmosDBMongo" self.database_name = database_name self.collection_name = collection_name @@ -3256,7 +3256,7 @@ def __init__(self, *, database_name: str, container_name: str, **kwargs): :paramtype container_name: str """ super().__init__(**kwargs) - self.component = "CosmosDBSql" # type: str + self.component: str = "CosmosDBSql" self.database_name = database_name self.container_name = container_name @@ -5131,7 +5131,7 @@ def __init__( self.creation_time = None self.instance_size = instance_size self.instance_count = instance_count - self.service_type = None # type: Optional[str] + self.service_type: Optional[str] = None self.status = None @@ -5204,7 +5204,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "DataTransfer" # type: str + self.service_type: str = "DataTransfer" self.locations = None @@ -5479,7 +5479,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "GraphAPICompute" # type: str + self.service_type: str = "GraphAPICompute" self.graph_api_compute_endpoint = graph_api_compute_endpoint self.locations = None @@ -7195,7 +7195,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "MaterializedViewsBuilder" # type: str + self.service_type: str = "MaterializedViewsBuilder" self.locations = None @@ -9178,7 +9178,7 @@ def __init__( :paramtype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties """ super().__init__(migration_state=migration_state, **kwargs) - self.type = "Periodic" # type: str + self.type: str = "Periodic" self.periodic_mode_properties = periodic_mode_properties @@ -12767,7 +12767,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "SqlDedicatedGateway" # type: str + self.service_type: str = "SqlDedicatedGateway" self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint self.locations = None diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py index b9aee75bbc64..1f05cd933e30 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py @@ -47,7 +47,7 @@ from ._service_operations import ServiceOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py index 6e172e7d1fd4..4b9c1c66e449 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py @@ -47,9 +47,9 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,9 +75,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,9 +107,9 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,9 +144,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,10 +181,10 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,7 +202,7 @@ def build_create_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -221,10 +221,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,7 +242,7 @@ def build_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,10 +261,10 @@ def build_invoke_command_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +282,7 @@ def build_invoke_command_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -301,9 +301,9 @@ def build_list_backups_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -321,7 +321,7 @@ def build_list_backups_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -338,9 +338,9 @@ def build_get_backup_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -359,7 +359,7 @@ def build_get_backup_request( "backupId": _SERIALIZER.url("backup_id", backup_id, "str", max_length=15, min_length=1, pattern=r"^[0-9]+$"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -376,9 +376,9 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -396,7 +396,7 @@ def build_deallocate_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,9 +413,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -433,7 +433,7 @@ def build_start_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -450,9 +450,9 @@ def build_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +470,7 @@ def build_status_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -512,10 +512,10 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ClusterResour _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -536,7 +536,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -552,7 +552,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -560,13 +560,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -579,7 +579,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ClusterResource"]: @@ -596,10 +598,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -621,7 +623,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -637,7 +639,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -645,13 +647,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -664,7 +666,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ClusterResource: @@ -691,10 +695,10 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -706,9 +710,9 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -725,7 +729,9 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -741,10 +747,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -756,9 +762,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -771,7 +777,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -797,13 +805,13 @@ def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -821,7 +829,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -833,9 +841,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _create_update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -851,11 +861,11 @@ def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -878,9 +888,9 @@ def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -897,11 +907,13 @@ def _create_update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload def begin_create_update( @@ -1013,16 +1025,16 @@ def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_initial( # type: ignore + raw_result = self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1042,7 +1054,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1054,9 +1066,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -1072,11 +1086,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1099,9 +1113,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1118,11 +1132,13 @@ def _update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload def begin_update( @@ -1229,16 +1245,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1258,7 +1274,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1270,9 +1286,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _invoke_command_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.CommandPostBody, IO], **kwargs: Any @@ -1288,11 +1306,11 @@ def _invoke_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1315,9 +1333,9 @@ def _invoke_command_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1334,7 +1352,9 @@ def _invoke_command_initial( return deserialized - _invoke_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # type: ignore + _invoke_command_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } @overload def begin_invoke_command( @@ -1441,16 +1461,16 @@ def begin_invoke_command( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._invoke_command_initial( # type: ignore + raw_result = self._invoke_command_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1470,7 +1490,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1482,9 +1502,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_invoke_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # type: ignore + begin_invoke_command.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } @distributed_trace def list_backups( @@ -1505,10 +1527,10 @@ def list_backups( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListBackups] + ) + cls: ClsType[_models.ListBackups] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1531,7 +1553,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1547,7 +1569,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1555,13 +1577,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListBackups", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1574,7 +1596,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_backups.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups"} # type: ignore + list_backups.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups" + } @distributed_trace def get_backup( @@ -1605,10 +1629,10 @@ def get_backup( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupResource] + ) + cls: ClsType[_models.BackupResource] = kwargs.pop("cls", None) request = build_get_backup_request( resource_group_name=resource_group_name, @@ -1621,9 +1645,9 @@ def get_backup( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1640,7 +1664,9 @@ def get_backup( return deserialized - get_backup.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}"} # type: ignore + get_backup.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}" + } def _deallocate_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1656,10 +1682,10 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_deallocate_request( resource_group_name=resource_group_name, @@ -1671,9 +1697,9 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1686,7 +1712,9 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _deallocate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + _deallocate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } @distributed_trace def begin_deallocate(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1714,13 +1742,13 @@ def begin_deallocate(self, resource_group_name: str, cluster_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._deallocate_initial( # type: ignore resource_group_name=resource_group_name, @@ -1738,7 +1766,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1750,9 +1778,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_deallocate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + begin_deallocate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1768,10 +1798,10 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -1783,9 +1813,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1798,7 +1828,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1826,13 +1858,13 @@ def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -1850,7 +1882,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1862,9 +1894,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace def status( @@ -1893,10 +1927,10 @@ def status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraClusterPublicStatus] + ) + cls: ClsType[_models.CassandraClusterPublicStatus] = kwargs.pop("cls", None) request = build_status_request( resource_group_name=resource_group_name, @@ -1908,9 +1942,9 @@ def status( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1927,4 +1961,6 @@ def status( return deserialized - status.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status"} # type: ignore + status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py index 001712256b7d..2a281de76018 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py @@ -47,9 +47,9 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,9 +84,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +157,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,10 +174,10 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +203,7 @@ def build_create_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,10 +222,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +251,7 @@ def build_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -302,10 +302,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListDataCenters] + ) + cls: ClsType[_models.ListDataCenters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -328,7 +328,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -344,7 +344,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -352,13 +352,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListDataCenters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -371,7 +371,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters" + } @distributed_trace def get( @@ -402,10 +404,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -418,9 +420,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -437,7 +439,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, data_center_name: str, **kwargs: Any @@ -453,10 +457,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -469,9 +473,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -484,7 +488,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @distributed_trace def begin_delete( @@ -514,13 +520,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -539,7 +545,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -551,9 +557,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } def _create_update_initial( self, @@ -574,11 +582,11 @@ def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -602,9 +610,9 @@ def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -621,11 +629,13 @@ def _create_update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload def begin_create_update( @@ -748,16 +758,16 @@ def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_initial( # type: ignore + raw_result = self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -778,7 +788,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -790,9 +800,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } def _update_initial( self, @@ -813,11 +825,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -841,9 +853,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -860,11 +872,13 @@ def _update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload def begin_update( @@ -984,16 +998,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -1014,7 +1028,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1026,6 +1040,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py index 4d7e794c82ba..bda951e6ee26 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py @@ -49,9 +49,9 @@ def build_list_cassandra_keyspaces_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_cassandra_keyspaces_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_cassandra_keyspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_cassandra_keyspace_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_cassandra_keyspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_cassandra_keyspace_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_cassandra_keyspace_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_cassandra_keyspace_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_cassandra_keyspace_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_cassandra_keyspace_throughput_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_cassandra_keyspace_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_cassandra_keyspace_throughput_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,9 +352,9 @@ def build_list_cassandra_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +373,7 @@ def build_list_cassandra_tables_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,9 +395,9 @@ def build_get_cassandra_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_get_cassandra_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_create_update_cassandra_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_create_update_cassandra_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -485,9 +485,9 @@ def build_delete_cassandra_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +505,7 @@ def build_delete_cassandra_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ def build_get_cassandra_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +546,7 @@ def build_get_cassandra_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -568,10 +568,10 @@ def build_update_cassandra_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +591,7 @@ def build_update_cassandra_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,9 +615,9 @@ def build_migrate_cassandra_table_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -637,7 +637,7 @@ def build_migrate_cassandra_table_to_autoscale_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -659,9 +659,9 @@ def build_migrate_cassandra_table_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -681,7 +681,7 @@ def build_migrate_cassandra_table_to_manual_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -698,9 +698,9 @@ def build_list_cassandra_views_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -719,7 +719,7 @@ def build_list_cassandra_views_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -736,9 +736,9 @@ def build_get_cassandra_view_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -758,7 +758,7 @@ def build_get_cassandra_view_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -775,10 +775,10 @@ def build_create_update_cassandra_view_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -798,7 +798,7 @@ def build_create_update_cassandra_view_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,9 +816,9 @@ def build_delete_cassandra_view_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -836,7 +836,7 @@ def build_delete_cassandra_view_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -850,9 +850,9 @@ def build_get_cassandra_view_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -872,7 +872,7 @@ def build_get_cassandra_view_throughput_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -889,10 +889,10 @@ def build_update_cassandra_view_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -912,7 +912,7 @@ def build_update_cassandra_view_throughput_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -931,9 +931,9 @@ def build_migrate_cassandra_view_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -953,7 +953,7 @@ def build_migrate_cassandra_view_to_autoscale_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -970,9 +970,9 @@ def build_migrate_cassandra_view_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -992,7 +992,7 @@ def build_migrate_cassandra_view_to_manual_throughput_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1042,10 +1042,10 @@ def list_cassandra_keyspaces( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceListResult] + ) + cls: ClsType[_models.CassandraKeyspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1068,7 +1068,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1084,7 +1084,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1092,13 +1092,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CassandraKeyspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1111,7 +1111,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_cassandra_keyspaces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces"} # type: ignore + list_cassandra_keyspaces.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces" + } @distributed_trace def get_cassandra_keyspace( @@ -1143,10 +1145,10 @@ def get_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] + ) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -1159,9 +1161,9 @@ def get_cassandra_keyspace( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1178,7 +1180,9 @@ def get_cassandra_keyspace( return deserialized - get_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + get_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } def _create_update_cassandra_keyspace_initial( self, @@ -1199,11 +1203,11 @@ def _create_update_cassandra_keyspace_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraKeyspaceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraKeyspaceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1229,9 +1233,9 @@ def _create_update_cassandra_keyspace_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1250,7 +1254,9 @@ def _create_update_cassandra_keyspace_initial( return deserialized - _create_update_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _create_update_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @overload def begin_create_update_cassandra_keyspace( @@ -1374,16 +1380,16 @@ def begin_create_update_cassandra_keyspace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_keyspace_initial( # type: ignore + raw_result = self._create_update_cassandra_keyspace_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1404,7 +1410,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1416,9 +1422,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_create_update_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1434,10 +1442,10 @@ def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -1450,9 +1458,9 @@ def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-s params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1465,7 +1473,9 @@ def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-s if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _delete_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace def begin_delete_cassandra_keyspace( @@ -1495,13 +1505,13 @@ def begin_delete_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_cassandra_keyspace_initial( # type: ignore resource_group_name=resource_group_name, @@ -1520,7 +1530,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1532,9 +1542,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_delete_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace def get_cassandra_keyspace_throughput( @@ -1566,10 +1578,10 @@ def get_cassandra_keyspace_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_throughput_request( resource_group_name=resource_group_name, @@ -1582,9 +1594,9 @@ def get_cassandra_keyspace_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1601,7 +1613,9 @@ def get_cassandra_keyspace_throughput( return deserialized - get_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + get_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } def _update_cassandra_keyspace_throughput_initial( self, @@ -1622,11 +1636,11 @@ def _update_cassandra_keyspace_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1650,9 +1664,9 @@ def _update_cassandra_keyspace_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1671,7 +1685,9 @@ def _update_cassandra_keyspace_throughput_initial( return deserialized - _update_cassandra_keyspace_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + _update_cassandra_keyspace_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } @overload def begin_update_cassandra_keyspace_throughput( @@ -1795,16 +1811,16 @@ def begin_update_cassandra_keyspace_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_keyspace_throughput_initial( # type: ignore + raw_result = self._update_cassandra_keyspace_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1825,7 +1841,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1837,9 +1853,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } def _migrate_cassandra_keyspace_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1855,10 +1873,10 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_autoscale_request( resource_group_name=resource_group_name, @@ -1871,9 +1889,9 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1892,7 +1910,9 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( return deserialized - _migrate_cassandra_keyspace_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_keyspace_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_cassandra_keyspace_to_autoscale( @@ -1923,15 +1943,15 @@ def begin_migrate_cassandra_keyspace_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( # type: ignore + raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1950,7 +1970,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1962,9 +1982,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_keyspace_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_cassandra_keyspace_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1980,10 +2002,10 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1996,9 +2018,9 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2017,7 +2039,9 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( return deserialized - _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_cassandra_keyspace_to_manual_throughput( @@ -2048,15 +2072,15 @@ def begin_migrate_cassandra_keyspace_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2075,7 +2099,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2087,9 +2111,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_tables( @@ -2113,10 +2139,10 @@ def list_cassandra_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableListResult] + ) + cls: ClsType[_models.CassandraTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2140,7 +2166,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2156,7 +2182,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2164,13 +2190,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CassandraTableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2183,7 +2209,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_cassandra_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables"} # type: ignore + list_cassandra_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables" + } @distributed_trace def get_cassandra_table( @@ -2216,10 +2244,10 @@ def get_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] + ) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_request( resource_group_name=resource_group_name, @@ -2233,9 +2261,9 @@ def get_cassandra_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2252,7 +2280,9 @@ def get_cassandra_table( return deserialized - get_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + get_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } def _create_update_cassandra_table_initial( self, @@ -2274,11 +2304,11 @@ def _create_update_cassandra_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraTableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraTableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2305,9 +2335,9 @@ def _create_update_cassandra_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2326,7 +2356,9 @@ def _create_update_cassandra_table_initial( return deserialized - _create_update_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _create_update_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @overload def begin_create_update_cassandra_table( @@ -2459,16 +2491,16 @@ def begin_create_update_cassandra_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_table_initial( # type: ignore + raw_result = self._create_update_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2490,7 +2522,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2502,9 +2534,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_create_update_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2520,10 +2554,10 @@ def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_table_request( resource_group_name=resource_group_name, @@ -2537,9 +2571,9 @@ def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-stat params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2552,7 +2586,9 @@ def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-stat if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _delete_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace def begin_delete_cassandra_table( @@ -2584,13 +2620,13 @@ def begin_delete_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_cassandra_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -2610,7 +2646,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2622,9 +2658,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_delete_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace def get_cassandra_table_throughput( @@ -2658,10 +2696,10 @@ def get_cassandra_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_throughput_request( resource_group_name=resource_group_name, @@ -2675,9 +2713,9 @@ def get_cassandra_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2694,7 +2732,9 @@ def get_cassandra_table_throughput( return deserialized - get_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } def _update_cassandra_table_throughput_initial( self, @@ -2716,11 +2756,11 @@ def _update_cassandra_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2745,9 +2785,9 @@ def _update_cassandra_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2766,7 +2806,9 @@ def _update_cassandra_table_throughput_initial( return deserialized - _update_cassandra_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_cassandra_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } @overload def begin_update_cassandra_table_throughput( @@ -2899,16 +2941,16 @@ def begin_update_cassandra_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_table_throughput_initial( # type: ignore + raw_result = self._update_cassandra_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2930,7 +2972,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2942,9 +2984,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } def _migrate_cassandra_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2960,10 +3004,10 @@ def _migrate_cassandra_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -2977,9 +3021,9 @@ def _migrate_cassandra_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2998,7 +3042,9 @@ def _migrate_cassandra_table_to_autoscale_initial( return deserialized - _migrate_cassandra_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_cassandra_table_to_autoscale( @@ -3031,15 +3077,15 @@ def begin_migrate_cassandra_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_table_to_autoscale_initial( # type: ignore + raw_result = self._migrate_cassandra_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3059,7 +3105,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3071,9 +3117,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_cassandra_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -3089,10 +3137,10 @@ def _migrate_cassandra_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -3106,9 +3154,9 @@ def _migrate_cassandra_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3127,7 +3175,9 @@ def _migrate_cassandra_table_to_manual_throughput_initial( return deserialized - _migrate_cassandra_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_cassandra_table_to_manual_throughput( @@ -3160,15 +3210,15 @@ def begin_migrate_cassandra_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3188,7 +3238,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3200,9 +3250,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_views( @@ -3226,10 +3278,10 @@ def list_cassandra_views( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewListResult] + ) + cls: ClsType[_models.CassandraViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3253,7 +3305,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3269,7 +3321,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3277,13 +3329,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CassandraViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3296,7 +3348,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_cassandra_views.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views"} # type: ignore + list_cassandra_views.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views" + } @distributed_trace def get_cassandra_view( @@ -3329,10 +3383,10 @@ def get_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] + ) + cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_request( resource_group_name=resource_group_name, @@ -3346,9 +3400,9 @@ def get_cassandra_view( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3365,7 +3419,9 @@ def get_cassandra_view( return deserialized - get_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + get_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } def _create_update_cassandra_view_initial( self, @@ -3387,11 +3443,11 @@ def _create_update_cassandra_view_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraViewGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraViewGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3416,9 +3472,9 @@ def _create_update_cassandra_view_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3437,7 +3493,9 @@ def _create_update_cassandra_view_initial( return deserialized - _create_update_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _create_update_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @overload def begin_create_update_cassandra_view( @@ -3570,16 +3628,16 @@ def begin_create_update_cassandra_view( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_view_initial( # type: ignore + raw_result = self._create_update_cassandra_view_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3601,7 +3659,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3613,9 +3671,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_create_update_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -3631,10 +3691,10 @@ def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_view_request( resource_group_name=resource_group_name, @@ -3648,9 +3708,9 @@ def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3663,7 +3723,9 @@ def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _delete_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace def begin_delete_cassandra_view( @@ -3695,13 +3757,13 @@ def begin_delete_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_cassandra_view_initial( # type: ignore resource_group_name=resource_group_name, @@ -3721,7 +3783,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3733,9 +3795,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_delete_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace def get_cassandra_view_throughput( @@ -3769,10 +3833,10 @@ def get_cassandra_view_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_throughput_request( resource_group_name=resource_group_name, @@ -3786,9 +3850,9 @@ def get_cassandra_view_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3805,7 +3869,9 @@ def get_cassandra_view_throughput( return deserialized - get_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + get_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } def _update_cassandra_view_throughput_initial( self, @@ -3827,11 +3893,11 @@ def _update_cassandra_view_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3856,9 +3922,9 @@ def _update_cassandra_view_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3877,7 +3943,9 @@ def _update_cassandra_view_throughput_initial( return deserialized - _update_cassandra_view_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + _update_cassandra_view_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } @overload def begin_update_cassandra_view_throughput( @@ -4010,16 +4078,16 @@ def begin_update_cassandra_view_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_view_throughput_initial( # type: ignore + raw_result = self._update_cassandra_view_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -4041,7 +4109,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4053,9 +4121,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } def _migrate_cassandra_view_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -4071,10 +4141,10 @@ def _migrate_cassandra_view_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_autoscale_request( resource_group_name=resource_group_name, @@ -4088,9 +4158,9 @@ def _migrate_cassandra_view_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4109,7 +4179,9 @@ def _migrate_cassandra_view_to_autoscale_initial( return deserialized - _migrate_cassandra_view_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_view_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_cassandra_view_to_autoscale( @@ -4142,15 +4214,15 @@ def begin_migrate_cassandra_view_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_view_to_autoscale_initial( # type: ignore + raw_result = self._migrate_cassandra_view_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -4170,7 +4242,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4182,9 +4254,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_view_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_cassandra_view_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -4200,10 +4274,10 @@ def _migrate_cassandra_view_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -4217,9 +4291,9 @@ def _migrate_cassandra_view_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4238,7 +4312,9 @@ def _migrate_cassandra_view_to_manual_throughput_initial( return deserialized - _migrate_cassandra_view_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_view_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_cassandra_view_to_manual_throughput( @@ -4271,15 +4347,15 @@ def begin_migrate_cassandra_view_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_view_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_cassandra_view_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -4299,7 +4375,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4311,6 +4387,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_view_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py index 3fea3bea493f..f62d7286e007 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py @@ -54,9 +54,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,9 +101,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_list_usages_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +169,7 @@ def build_list_metric_definitions_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -233,10 +233,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -262,7 +262,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -278,7 +278,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -286,13 +286,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -305,7 +305,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } @distributed_trace def list_usages( @@ -340,10 +342,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -369,7 +371,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -385,7 +387,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -393,13 +395,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -412,7 +414,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -437,10 +441,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -465,7 +469,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -481,7 +485,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -489,13 +493,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -508,4 +512,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py index b45407cae8e8..e9c213a404cc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py @@ -54,9 +54,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,9 +101,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_list_usages_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -189,10 +189,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,7 +218,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -234,7 +234,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +242,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,7 +261,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } @distributed_trace def list_usages( @@ -296,10 +298,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionUsagesResult] + ) + cls: ClsType[_models.PartitionUsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -325,7 +327,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -341,7 +343,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -349,13 +351,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionUsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -368,4 +370,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py index ebd6415611bc..82d272750310 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py @@ -55,9 +55,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,7 +176,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -192,7 +192,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -200,13 +200,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -219,4 +219,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py index 9e7ec0632f8f..882a351b11ab 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py @@ -55,9 +55,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,7 +176,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -192,7 +192,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -200,13 +200,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -219,4 +219,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py index 749e671f409c..211fe3e47a60 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py @@ -47,10 +47,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_create_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,9 +88,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_get_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,9 +126,9 @@ def build_pause_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -147,7 +147,7 @@ def build_pause_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_resume_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -185,7 +185,7 @@ def build_resume_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -202,9 +202,9 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -223,7 +223,7 @@ def build_cancel_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,9 +240,9 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +260,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -391,11 +391,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -419,9 +419,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -438,7 +438,9 @@ def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace def get( @@ -469,10 +471,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -485,9 +487,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -504,7 +506,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace def pause( @@ -535,10 +539,10 @@ def pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -551,9 +555,9 @@ def pause( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -570,7 +574,9 @@ def pause( return deserialized - pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause"} # type: ignore + pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause" + } @distributed_trace def resume( @@ -601,10 +607,10 @@ def resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -617,9 +623,9 @@ def resume( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -636,7 +642,9 @@ def resume( return deserialized - resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume"} # type: ignore + resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume" + } @distributed_trace def cancel( @@ -667,10 +675,10 @@ def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -683,9 +691,9 @@ def cancel( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -702,7 +710,9 @@ def cancel( return deserialized - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel" + } @distributed_trace def list_by_database_account( @@ -724,10 +734,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobFeedResults] + ) + cls: ClsType[_models.DataTransferJobFeedResults] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -750,7 +760,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -766,7 +776,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -774,13 +784,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DataTransferJobFeedResults", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -793,4 +803,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py index e510756f32c2..81d51e0a1fcd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_metrics_request( "region": _SERIALIZER.url("region", region, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -152,7 +152,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -168,7 +168,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -176,13 +176,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -195,4 +195,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py index 12cd0459afeb..9e236e3eb0d6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py @@ -47,9 +47,9 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,10 +84,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +145,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -181,7 +181,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -195,10 +195,10 @@ def build_failover_priority_change_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -214,7 +214,7 @@ def build_failover_priority_change_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,9 +230,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +241,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,9 +256,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +273,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,9 +290,9 @@ def build_list_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_list_keys_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -327,9 +327,9 @@ def build_list_connection_strings_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -347,7 +347,7 @@ def build_list_connection_strings_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -364,10 +364,10 @@ def build_offline_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -385,7 +385,7 @@ def build_offline_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -404,10 +404,10 @@ def build_online_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -425,7 +425,7 @@ def build_online_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -444,9 +444,9 @@ def build_get_read_only_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -464,7 +464,7 @@ def build_get_read_only_keys_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -481,9 +481,9 @@ def build_list_read_only_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -501,7 +501,7 @@ def build_list_read_only_keys_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -518,10 +518,10 @@ def build_regenerate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -537,7 +537,7 @@ def build_regenerate_key_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -552,9 +552,9 @@ def build_regenerate_key_request( def build_check_name_exists_request(account_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop("template_url", "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") path_format_arguments = { @@ -563,7 +563,7 @@ def build_check_name_exists_request(account_name: str, **kwargs: Any) -> HttpReq ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -577,9 +577,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -597,7 +597,7 @@ def build_list_metrics_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,9 +615,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -635,7 +635,7 @@ def build_list_usages_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -654,9 +654,9 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -674,7 +674,7 @@ def build_list_metric_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -729,10 +729,10 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -744,9 +744,9 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -763,7 +763,9 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _update_initial( self, @@ -783,11 +785,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -810,9 +812,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -829,7 +831,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload def begin_update( @@ -940,16 +944,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, update_parameters=update_parameters, @@ -969,7 +973,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -981,9 +985,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _create_or_update_initial( self, @@ -1003,11 +1009,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1030,9 +1036,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1049,7 +1055,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload def begin_create_or_update( @@ -1167,16 +1175,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, create_update_parameters=create_update_parameters, @@ -1196,7 +1204,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1208,9 +1216,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any @@ -1226,10 +1236,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1241,9 +1251,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1256,7 +1266,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1282,13 +1294,13 @@ def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -1306,7 +1318,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1318,9 +1330,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _failover_priority_change_initial( # pylint: disable=inconsistent-return-statements self, @@ -1340,11 +1354,11 @@ def _failover_priority_change_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1367,9 +1381,9 @@ def _failover_priority_change_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1382,7 +1396,9 @@ def _failover_priority_change_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _failover_priority_change_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + _failover_priority_change_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @overload def begin_failover_priority_change( @@ -1499,14 +1515,14 @@ def begin_failover_priority_change( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._failover_priority_change_initial( # type: ignore resource_group_name=resource_group_name, @@ -1526,7 +1542,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1538,9 +1554,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover_priority_change.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + begin_failover_priority_change.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.DatabaseAccountGetResults"]: @@ -1555,10 +1573,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.DatabaseAccountGetResults"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1579,7 +1597,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1595,7 +1613,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1603,13 +1621,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1622,7 +1640,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} @distributed_trace def list_by_resource_group( @@ -1642,10 +1660,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1667,7 +1685,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1683,7 +1701,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1691,13 +1709,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1710,7 +1728,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts" + } @distributed_trace def list_keys( @@ -1739,10 +1759,10 @@ def list_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListKeysResult] = kwargs.pop("cls", None) request = build_list_keys_request( resource_group_name=resource_group_name, @@ -1754,9 +1774,9 @@ def list_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1773,7 +1793,9 @@ def list_keys( return deserialized - list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys"} # type: ignore + list_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys" + } @distributed_trace def list_connection_strings( @@ -1802,10 +1824,10 @@ def list_connection_strings( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListConnectionStringsResult] + ) + cls: ClsType[_models.DatabaseAccountListConnectionStringsResult] = kwargs.pop("cls", None) request = build_list_connection_strings_request( resource_group_name=resource_group_name, @@ -1817,9 +1839,9 @@ def list_connection_strings( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1836,7 +1858,9 @@ def list_connection_strings( return deserialized - list_connection_strings.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings"} # type: ignore + list_connection_strings.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings" + } def _offline_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -1856,11 +1880,11 @@ def _offline_region_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1883,9 +1907,9 @@ def _offline_region_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1899,7 +1923,9 @@ def _offline_region_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _offline_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + _offline_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } @overload def begin_offline_region( @@ -2009,14 +2035,14 @@ def begin_offline_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._offline_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -2036,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2048,9 +2074,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_offline_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + begin_offline_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } def _online_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -2070,11 +2098,11 @@ def _online_region_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2097,9 +2125,9 @@ def _online_region_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2113,7 +2141,9 @@ def _online_region_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _online_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + _online_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @overload def begin_online_region( @@ -2223,14 +2253,14 @@ def begin_online_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._online_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -2250,7 +2280,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2262,9 +2292,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_online_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + begin_online_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @distributed_trace def get_read_only_keys( @@ -2293,10 +2325,10 @@ def get_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_get_read_only_keys_request( resource_group_name=resource_group_name, @@ -2308,9 +2340,9 @@ def get_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2327,7 +2359,9 @@ def get_read_only_keys( return deserialized - get_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + get_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } @distributed_trace def list_read_only_keys( @@ -2356,10 +2390,10 @@ def list_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_list_read_only_keys_request( resource_group_name=resource_group_name, @@ -2371,9 +2405,9 @@ def list_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2390,7 +2424,9 @@ def list_read_only_keys( return deserialized - list_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + list_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements self, @@ -2410,11 +2446,11 @@ def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2437,9 +2473,9 @@ def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2452,7 +2488,9 @@ def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _regenerate_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + _regenerate_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @overload def begin_regenerate_key( @@ -2561,14 +2599,14 @@ def begin_regenerate_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._regenerate_key_initial( # type: ignore resource_group_name=resource_group_name, @@ -2588,7 +2626,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2600,9 +2638,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + begin_regenerate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @distributed_trace def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: @@ -2628,10 +2668,10 @@ def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_check_name_exists_request( account_name=account_name, @@ -2641,9 +2681,9 @@ def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2657,7 +2697,7 @@ def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} # type: ignore + check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} @distributed_trace def list_metrics( @@ -2682,10 +2722,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2709,7 +2749,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2725,7 +2765,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2733,13 +2773,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2752,7 +2792,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics" + } @distributed_trace def list_usages( @@ -2777,10 +2819,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2804,7 +2846,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2820,7 +2862,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2828,13 +2870,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2847,7 +2889,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages" + } @distributed_trace def list_metric_definitions( @@ -2868,10 +2912,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2894,7 +2938,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2910,7 +2954,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2918,13 +2962,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2937,4 +2981,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py index f8f8ec9050ea..3f8ae6e3c0ac 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_metrics_request( "databaseRid": _SERIALIZER.url("database_rid", database_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,9 +92,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_list_usages_request( "databaseRid": _SERIALIZER.url("database_rid", database_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,9 +132,9 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +153,7 @@ def build_list_metric_definitions_request( "databaseRid": _SERIALIZER.url("database_rid", database_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,10 +209,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -237,7 +237,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -253,7 +253,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -261,13 +261,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -280,7 +280,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics" + } @distributed_trace def list_usages( @@ -312,10 +314,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -340,7 +342,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -356,7 +358,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -364,13 +366,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -383,7 +385,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -406,10 +410,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -433,7 +437,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -449,7 +453,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -457,13 +461,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -476,4 +480,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py index 3ab016a9e089..58035ad69818 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py @@ -49,9 +49,9 @@ def build_list_graphs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_graphs_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_graph_resource_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_graph_resource_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,10 +230,10 @@ def list_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourcesListResult] + ) + cls: ClsType[_models.GraphResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -256,7 +256,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -272,7 +272,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -280,13 +280,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GraphResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -299,7 +299,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs"} # type: ignore + list_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs" + } @distributed_trace def get_graph( @@ -331,10 +333,10 @@ def get_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] + ) + cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) request = build_get_graph_request( resource_group_name=resource_group_name, @@ -347,9 +349,9 @@ def get_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -366,7 +368,9 @@ def get_graph( return deserialized - get_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + get_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } def _create_update_graph_initial( self, @@ -387,11 +391,11 @@ def _create_update_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GraphResourceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GraphResourceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -415,9 +419,9 @@ def _create_update_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -436,7 +440,9 @@ def _create_update_graph_initial( return deserialized - _create_update_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _create_update_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @overload def begin_create_update_graph( @@ -560,16 +566,16 @@ def begin_create_update_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_graph_initial( # type: ignore + raw_result = self._create_update_graph_initial( resource_group_name=resource_group_name, account_name=account_name, graph_name=graph_name, @@ -590,7 +596,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -602,9 +608,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_create_update_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any @@ -620,10 +628,10 @@ def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_graph_resource_request( resource_group_name=resource_group_name, @@ -636,9 +644,9 @@ def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -651,7 +659,9 @@ def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _delete_graph_resource_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _delete_graph_resource_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @distributed_trace def begin_delete_graph_resource( @@ -681,13 +691,13 @@ def begin_delete_graph_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_graph_resource_initial( # type: ignore resource_group_name=resource_group_name, @@ -706,7 +716,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -718,6 +728,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_graph_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_delete_graph_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py index 0c494fe1708a..c861f32fe15e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py @@ -49,9 +49,9 @@ def build_list_gremlin_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_gremlin_databases_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_gremlin_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_gremlin_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_gremlin_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_gremlin_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_gremlin_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_gremlin_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_gremlin_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_gremlin_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_gremlin_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_gremlin_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_gremlin_database_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_gremlin_database_to_autoscale_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_gremlin_database_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_gremlin_database_to_manual_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,9 +352,9 @@ def build_list_gremlin_graphs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +373,7 @@ def build_list_gremlin_graphs_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,9 +395,9 @@ def build_get_gremlin_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_get_gremlin_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_create_update_gremlin_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_create_update_gremlin_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -485,9 +485,9 @@ def build_delete_gremlin_graph_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +505,7 @@ def build_delete_gremlin_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ def build_get_gremlin_graph_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +546,7 @@ def build_get_gremlin_graph_throughput_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -568,10 +568,10 @@ def build_update_gremlin_graph_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +591,7 @@ def build_update_gremlin_graph_throughput_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,9 +615,9 @@ def build_migrate_gremlin_graph_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -637,7 +637,7 @@ def build_migrate_gremlin_graph_to_autoscale_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -659,9 +659,9 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -681,7 +681,7 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -703,10 +703,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -726,7 +726,7 @@ def build_retrieve_continuous_backup_information_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -778,10 +778,10 @@ def list_gremlin_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseListResult] + ) + cls: ClsType[_models.GremlinDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -804,7 +804,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -820,7 +820,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -828,13 +828,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GremlinDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -847,7 +847,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_gremlin_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases"} # type: ignore + list_gremlin_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases" + } @distributed_trace def get_gremlin_database( @@ -879,10 +881,10 @@ def get_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] + ) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_request( resource_group_name=resource_group_name, @@ -895,9 +897,9 @@ def get_gremlin_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -914,7 +916,9 @@ def get_gremlin_database( return deserialized - get_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + get_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } def _create_update_gremlin_database_initial( self, @@ -935,11 +939,11 @@ def _create_update_gremlin_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -965,9 +969,9 @@ def _create_update_gremlin_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -986,7 +990,9 @@ def _create_update_gremlin_database_initial( return deserialized - _create_update_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _create_update_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @overload def begin_create_update_gremlin_database( @@ -1110,16 +1116,16 @@ def begin_create_update_gremlin_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_gremlin_database_initial( # type: ignore + raw_result = self._create_update_gremlin_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1140,7 +1146,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1152,9 +1158,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_create_update_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1170,10 +1178,10 @@ def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_database_request( resource_group_name=resource_group_name, @@ -1186,9 +1194,9 @@ def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-sta params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1201,7 +1209,9 @@ def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-sta if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _delete_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace def begin_delete_gremlin_database( @@ -1231,13 +1241,13 @@ def begin_delete_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_gremlin_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -1256,7 +1266,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1268,9 +1278,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_delete_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace def get_gremlin_database_throughput( @@ -1302,10 +1314,10 @@ def get_gremlin_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_throughput_request( resource_group_name=resource_group_name, @@ -1318,9 +1330,9 @@ def get_gremlin_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1337,7 +1349,9 @@ def get_gremlin_database_throughput( return deserialized - get_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } def _update_gremlin_database_throughput_initial( self, @@ -1358,11 +1372,11 @@ def _update_gremlin_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1386,9 +1400,9 @@ def _update_gremlin_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1407,7 +1421,9 @@ def _update_gremlin_database_throughput_initial( return deserialized - _update_gremlin_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_gremlin_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } @overload def begin_update_gremlin_database_throughput( @@ -1531,16 +1547,16 @@ def begin_update_gremlin_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_gremlin_database_throughput_initial( # type: ignore + raw_result = self._update_gremlin_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1561,7 +1577,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1573,9 +1589,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } def _migrate_gremlin_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1591,10 +1609,10 @@ def _migrate_gremlin_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -1607,9 +1625,9 @@ def _migrate_gremlin_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1628,7 +1646,9 @@ def _migrate_gremlin_database_to_autoscale_initial( return deserialized - _migrate_gremlin_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_gremlin_database_to_autoscale( @@ -1659,15 +1679,15 @@ def begin_migrate_gremlin_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_database_to_autoscale_initial( # type: ignore + raw_result = self._migrate_gremlin_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1686,7 +1706,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1698,9 +1718,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_gremlin_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1716,10 +1738,10 @@ def _migrate_gremlin_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1732,9 +1754,9 @@ def _migrate_gremlin_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1753,7 +1775,9 @@ def _migrate_gremlin_database_to_manual_throughput_initial( return deserialized - _migrate_gremlin_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_gremlin_database_to_manual_throughput( @@ -1784,15 +1808,15 @@ def begin_migrate_gremlin_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_database_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_gremlin_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1811,7 +1835,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1823,9 +1847,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_gremlin_graphs( @@ -1849,10 +1875,10 @@ def list_gremlin_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphListResult] + ) + cls: ClsType[_models.GremlinGraphListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1876,7 +1902,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1892,7 +1918,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1900,13 +1926,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GremlinGraphListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1919,7 +1945,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_gremlin_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs"} # type: ignore + list_gremlin_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs" + } @distributed_trace def get_gremlin_graph( @@ -1952,10 +1980,10 @@ def get_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] + ) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_request( resource_group_name=resource_group_name, @@ -1969,9 +1997,9 @@ def get_gremlin_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1988,7 +2016,9 @@ def get_gremlin_graph( return deserialized - get_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + get_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } def _create_update_gremlin_graph_initial( self, @@ -2010,11 +2040,11 @@ def _create_update_gremlin_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinGraphGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinGraphGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2039,9 +2069,9 @@ def _create_update_gremlin_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2060,7 +2090,9 @@ def _create_update_gremlin_graph_initial( return deserialized - _create_update_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _create_update_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @overload def begin_create_update_gremlin_graph( @@ -2193,16 +2225,16 @@ def begin_create_update_gremlin_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_gremlin_graph_initial( # type: ignore + raw_result = self._create_update_gremlin_graph_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2224,7 +2256,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2236,9 +2268,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_create_update_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2254,10 +2288,10 @@ def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statem _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_graph_request( resource_group_name=resource_group_name, @@ -2271,9 +2305,9 @@ def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2286,7 +2320,9 @@ def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _delete_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace def begin_delete_gremlin_graph( @@ -2318,13 +2354,13 @@ def begin_delete_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_gremlin_graph_initial( # type: ignore resource_group_name=resource_group_name, @@ -2344,7 +2380,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2356,9 +2392,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_delete_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace def get_gremlin_graph_throughput( @@ -2392,10 +2430,10 @@ def get_gremlin_graph_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_throughput_request( resource_group_name=resource_group_name, @@ -2409,9 +2447,9 @@ def get_gremlin_graph_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2428,7 +2466,9 @@ def get_gremlin_graph_throughput( return deserialized - get_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + get_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } def _update_gremlin_graph_throughput_initial( self, @@ -2450,11 +2490,11 @@ def _update_gremlin_graph_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2479,9 +2519,9 @@ def _update_gremlin_graph_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2500,7 +2540,9 @@ def _update_gremlin_graph_throughput_initial( return deserialized - _update_gremlin_graph_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + _update_gremlin_graph_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } @overload def begin_update_gremlin_graph_throughput( @@ -2633,16 +2675,16 @@ def begin_update_gremlin_graph_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_gremlin_graph_throughput_initial( # type: ignore + raw_result = self._update_gremlin_graph_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2664,7 +2706,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2676,9 +2718,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } def _migrate_gremlin_graph_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2694,10 +2738,10 @@ def _migrate_gremlin_graph_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_autoscale_request( resource_group_name=resource_group_name, @@ -2711,9 +2755,9 @@ def _migrate_gremlin_graph_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2732,7 +2776,9 @@ def _migrate_gremlin_graph_to_autoscale_initial( return deserialized - _migrate_gremlin_graph_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_graph_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_gremlin_graph_to_autoscale( @@ -2765,15 +2811,15 @@ def begin_migrate_gremlin_graph_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_graph_to_autoscale_initial( # type: ignore + raw_result = self._migrate_gremlin_graph_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2793,7 +2839,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2805,9 +2851,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_graph_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_gremlin_graph_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2823,10 +2871,10 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2840,9 +2888,9 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2861,7 +2909,9 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( return deserialized - _migrate_gremlin_graph_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_graph_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_gremlin_graph_to_manual_throughput( @@ -2894,15 +2944,15 @@ def begin_migrate_gremlin_graph_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_graph_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_gremlin_graph_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2922,7 +2972,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2934,9 +2984,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_graph_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } def _retrieve_continuous_backup_information_initial( self, @@ -2958,11 +3010,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2987,9 +3039,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3008,7 +3060,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -3137,16 +3191,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3168,9 +3222,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3182,6 +3236,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py index 6749f3590daa..243b8ecfb606 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,9 +71,9 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "location": _SERIALIZER.url("location", location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,10 +127,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.LocationGetResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationListResult] + ) + cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -151,7 +151,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -167,7 +167,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -175,13 +175,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LocationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -194,7 +194,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} @distributed_trace def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: @@ -219,10 +219,10 @@ def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationGetResult] + ) + cls: ClsType[_models.LocationGetResult] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -233,9 +233,9 @@ def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -252,4 +252,4 @@ def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py index 311c5218fa83..8759507c68f6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py @@ -49,9 +49,9 @@ def build_list_mongo_db_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_mongo_db_databases_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_mongo_db_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_mongo_db_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_mongo_db_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_mongo_db_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_mongo_db_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_mongo_db_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_mongo_db_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_mongo_db_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_mongo_db_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_mongo_db_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_mongo_db_database_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_mongo_db_database_to_autoscale_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,10 +352,10 @@ def build_mongo_db_database_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +374,7 @@ def build_mongo_db_database_retrieve_throughput_distribution_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -393,10 +393,10 @@ def build_mongo_db_database_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -415,7 +415,7 @@ def build_mongo_db_database_redistribute_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_mongo_db_container_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_mongo_db_container_retrieve_throughput_distribution_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -486,10 +486,10 @@ def build_mongo_db_container_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,7 +509,7 @@ def build_mongo_db_container_redistribute_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -528,9 +528,9 @@ def build_list_mongo_db_collections_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -549,7 +549,7 @@ def build_list_mongo_db_collections_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -571,9 +571,9 @@ def build_get_mongo_db_collection_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -593,7 +593,7 @@ def build_get_mongo_db_collection_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,10 +615,10 @@ def build_create_update_mongo_db_collection_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -638,7 +638,7 @@ def build_create_update_mongo_db_collection_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -661,9 +661,9 @@ def build_delete_mongo_db_collection_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -681,7 +681,7 @@ def build_delete_mongo_db_collection_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -700,10 +700,10 @@ def build_list_mongo_db_collection_partition_merge_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -723,7 +723,7 @@ def build_list_mongo_db_collection_partition_merge_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -747,9 +747,9 @@ def build_get_mongo_db_collection_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -769,7 +769,7 @@ def build_get_mongo_db_collection_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -791,10 +791,10 @@ def build_update_mongo_db_collection_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -814,7 +814,7 @@ def build_update_mongo_db_collection_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -838,9 +838,9 @@ def build_migrate_mongo_db_collection_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -860,7 +860,7 @@ def build_migrate_mongo_db_collection_to_autoscale_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -882,9 +882,9 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -904,7 +904,7 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -921,9 +921,9 @@ def build_get_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -942,7 +942,7 @@ def build_get_mongo_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -959,10 +959,10 @@ def build_create_update_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -981,7 +981,7 @@ def build_create_update_mongo_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1000,9 +1000,9 @@ def build_delete_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1021,7 +1021,7 @@ def build_delete_mongo_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1038,9 +1038,9 @@ def build_list_mongo_role_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1058,7 +1058,7 @@ def build_list_mongo_role_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1075,9 +1075,9 @@ def build_get_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1096,7 +1096,7 @@ def build_get_mongo_user_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1113,10 +1113,10 @@ def build_create_update_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1135,7 +1135,7 @@ def build_create_update_mongo_user_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1154,9 +1154,9 @@ def build_delete_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1175,7 +1175,7 @@ def build_delete_mongo_user_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1192,9 +1192,9 @@ def build_list_mongo_user_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1212,7 +1212,7 @@ def build_list_mongo_user_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1234,10 +1234,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1257,7 +1257,7 @@ def build_retrieve_continuous_backup_information_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1309,10 +1309,10 @@ def list_mongo_db_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseListResult] + ) + cls: ClsType[_models.MongoDBDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1335,7 +1335,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1351,7 +1351,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1359,13 +1359,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoDBDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1378,7 +1378,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_db_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases"} # type: ignore + list_mongo_db_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases" + } @distributed_trace def get_mongo_db_database( @@ -1410,10 +1412,10 @@ def get_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] + ) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_request( resource_group_name=resource_group_name, @@ -1426,9 +1428,9 @@ def get_mongo_db_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1445,7 +1447,9 @@ def get_mongo_db_database( return deserialized - get_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + get_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } def _create_update_mongo_db_database_initial( self, @@ -1466,11 +1470,11 @@ def _create_update_mongo_db_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1496,9 +1500,9 @@ def _create_update_mongo_db_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1517,7 +1521,9 @@ def _create_update_mongo_db_database_initial( return deserialized - _create_update_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _create_update_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @overload def begin_create_update_mongo_db_database( @@ -1641,16 +1647,16 @@ def begin_create_update_mongo_db_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_db_database_initial( # type: ignore + raw_result = self._create_update_mongo_db_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1671,7 +1677,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1683,9 +1689,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_create_update_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1701,10 +1709,10 @@ def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_database_request( resource_group_name=resource_group_name, @@ -1717,9 +1725,9 @@ def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1732,7 +1740,9 @@ def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _delete_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace def begin_delete_mongo_db_database( @@ -1762,13 +1772,13 @@ def begin_delete_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_db_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -1787,7 +1797,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1799,9 +1809,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_delete_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace def get_mongo_db_database_throughput( @@ -1833,10 +1845,10 @@ def get_mongo_db_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_throughput_request( resource_group_name=resource_group_name, @@ -1849,9 +1861,9 @@ def get_mongo_db_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1868,7 +1880,9 @@ def get_mongo_db_database_throughput( return deserialized - get_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } def _update_mongo_db_database_throughput_initial( self, @@ -1889,11 +1903,11 @@ def _update_mongo_db_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1917,9 +1931,9 @@ def _update_mongo_db_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1938,7 +1952,9 @@ def _update_mongo_db_database_throughput_initial( return deserialized - _update_mongo_db_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_mongo_db_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } @overload def begin_update_mongo_db_database_throughput( @@ -2062,16 +2078,16 @@ def begin_update_mongo_db_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_mongo_db_database_throughput_initial( # type: ignore + raw_result = self._update_mongo_db_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2092,7 +2108,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2104,9 +2120,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } def _migrate_mongo_db_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2122,10 +2140,10 @@ def _migrate_mongo_db_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -2138,9 +2156,9 @@ def _migrate_mongo_db_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2159,7 +2177,9 @@ def _migrate_mongo_db_database_to_autoscale_initial( return deserialized - _migrate_mongo_db_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_mongo_db_database_to_autoscale( @@ -2190,15 +2210,15 @@ def begin_migrate_mongo_db_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_database_to_autoscale_initial( # type: ignore + raw_result = self._migrate_mongo_db_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2217,7 +2237,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2229,9 +2249,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_mongo_db_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2247,10 +2269,10 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2263,9 +2285,9 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2284,7 +2306,9 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_mongo_db_database_to_manual_throughput( @@ -2315,15 +2339,15 @@ def begin_migrate_mongo_db_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_database_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_mongo_db_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2342,7 +2366,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2354,9 +2378,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } def _mongo_db_database_retrieve_throughput_distribution_initial( self, @@ -2377,11 +2403,11 @@ def _mongo_db_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2405,9 +2431,9 @@ def _mongo_db_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2426,7 +2452,9 @@ def _mongo_db_database_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_mongo_db_database_retrieve_throughput_distribution( @@ -2552,16 +2580,16 @@ def begin_mongo_db_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._mongo_db_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2582,9 +2610,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2596,9 +2624,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } def _mongo_db_database_redistribute_throughput_initial( self, @@ -2619,11 +2649,11 @@ def _mongo_db_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2647,9 +2677,9 @@ def _mongo_db_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2668,7 +2698,9 @@ def _mongo_db_database_redistribute_throughput_initial( return deserialized - _mongo_db_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_mongo_db_database_redistribute_throughput( @@ -2795,16 +2827,16 @@ def begin_mongo_db_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_database_redistribute_throughput_initial( # type: ignore + raw_result = self._mongo_db_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2825,9 +2857,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2839,9 +2871,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } def _mongo_db_container_retrieve_throughput_distribution_initial( self, @@ -2863,11 +2897,11 @@ def _mongo_db_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2892,9 +2926,9 @@ def _mongo_db_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2913,7 +2947,9 @@ def _mongo_db_container_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_mongo_db_container_retrieve_throughput_distribution( @@ -3048,16 +3084,16 @@ def begin_mongo_db_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._mongo_db_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3079,9 +3115,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3093,9 +3129,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } def _mongo_db_container_redistribute_throughput_initial( self, @@ -3117,11 +3155,11 @@ def _mongo_db_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3146,9 +3184,9 @@ def _mongo_db_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3167,7 +3205,9 @@ def _mongo_db_container_redistribute_throughput_initial( return deserialized - _mongo_db_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_mongo_db_container_redistribute_throughput( @@ -3303,16 +3343,16 @@ def begin_mongo_db_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_container_redistribute_throughput_initial( # type: ignore + raw_result = self._mongo_db_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3334,9 +3374,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3348,9 +3388,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_mongo_db_collections( @@ -3374,10 +3416,10 @@ def list_mongo_db_collections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionListResult] + ) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3401,7 +3443,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3417,7 +3459,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3425,13 +3467,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3444,7 +3486,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_db_collections.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections"} # type: ignore + list_mongo_db_collections.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections" + } @distributed_trace def get_mongo_db_collection( @@ -3477,10 +3521,10 @@ def get_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] + ) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -3494,9 +3538,9 @@ def get_mongo_db_collection( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3513,7 +3557,9 @@ def get_mongo_db_collection( return deserialized - get_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + get_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } def _create_update_mongo_db_collection_initial( self, @@ -3535,11 +3581,11 @@ def _create_update_mongo_db_collection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBCollectionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBCollectionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3566,9 +3612,9 @@ def _create_update_mongo_db_collection_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3587,7 +3633,9 @@ def _create_update_mongo_db_collection_initial( return deserialized - _create_update_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _create_update_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @overload def begin_create_update_mongo_db_collection( @@ -3720,16 +3768,16 @@ def begin_create_update_mongo_db_collection( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_db_collection_initial( # type: ignore + raw_result = self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3751,7 +3799,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3763,9 +3811,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_create_update_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -3781,10 +3831,10 @@ def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -3798,9 +3848,9 @@ def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3813,7 +3863,9 @@ def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _delete_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @distributed_trace def begin_delete_mongo_db_collection( @@ -3845,13 +3897,13 @@ def begin_delete_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_db_collection_initial( # type: ignore resource_group_name=resource_group_name, @@ -3871,7 +3923,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3883,9 +3935,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_delete_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } def _list_mongo_db_collection_partition_merge_initial( self, @@ -3907,11 +3961,11 @@ def _list_mongo_db_collection_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3936,9 +3990,9 @@ def _list_mongo_db_collection_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3957,7 +4011,9 @@ def _list_mongo_db_collection_partition_merge_initial( return deserialized - _list_mongo_db_collection_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + _list_mongo_db_collection_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @overload def begin_list_mongo_db_collection_partition_merge( @@ -4089,16 +4145,16 @@ def begin_list_mongo_db_collection_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._list_mongo_db_collection_partition_merge_initial( # type: ignore + raw_result = self._list_mongo_db_collection_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4120,9 +4176,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4134,9 +4190,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_mongo_db_collection_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + begin_list_mongo_db_collection_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @distributed_trace def get_mongo_db_collection_throughput( @@ -4170,10 +4228,10 @@ def get_mongo_db_collection_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_throughput_request( resource_group_name=resource_group_name, @@ -4187,9 +4245,9 @@ def get_mongo_db_collection_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4206,7 +4264,9 @@ def get_mongo_db_collection_throughput( return deserialized - get_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + get_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } def _update_mongo_db_collection_throughput_initial( self, @@ -4228,11 +4288,11 @@ def _update_mongo_db_collection_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4257,9 +4317,9 @@ def _update_mongo_db_collection_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4278,7 +4338,9 @@ def _update_mongo_db_collection_throughput_initial( return deserialized - _update_mongo_db_collection_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + _update_mongo_db_collection_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } @overload def begin_update_mongo_db_collection_throughput( @@ -4411,16 +4473,16 @@ def begin_update_mongo_db_collection_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_mongo_db_collection_throughput_initial( # type: ignore + raw_result = self._update_mongo_db_collection_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4442,7 +4504,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4454,9 +4516,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } def _migrate_mongo_db_collection_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -4472,10 +4536,10 @@ def _migrate_mongo_db_collection_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_autoscale_request( resource_group_name=resource_group_name, @@ -4489,9 +4553,9 @@ def _migrate_mongo_db_collection_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4510,7 +4574,9 @@ def _migrate_mongo_db_collection_to_autoscale_initial( return deserialized - _migrate_mongo_db_collection_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_collection_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_mongo_db_collection_to_autoscale( @@ -4543,15 +4609,15 @@ def begin_migrate_mongo_db_collection_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_collection_to_autoscale_initial( # type: ignore + raw_result = self._migrate_mongo_db_collection_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4571,7 +4637,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4583,9 +4649,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_collection_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_mongo_db_collection_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -4601,10 +4669,10 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -4618,9 +4686,9 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4639,7 +4707,9 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_mongo_db_collection_to_manual_throughput( @@ -4672,15 +4742,15 @@ def begin_migrate_mongo_db_collection_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_collection_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_mongo_db_collection_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4700,7 +4770,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4712,9 +4782,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_collection_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def get_mongo_role_definition( @@ -4746,10 +4818,10 @@ def get_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] + ) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -4762,9 +4834,9 @@ def get_mongo_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4781,7 +4853,9 @@ def get_mongo_role_definition( return deserialized - get_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + get_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } def _create_update_mongo_role_definition_initial( self, @@ -4802,11 +4876,11 @@ def _create_update_mongo_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4832,9 +4906,9 @@ def _create_update_mongo_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4853,7 +4927,9 @@ def _create_update_mongo_role_definition_initial( return deserialized - _create_update_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _create_update_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @overload def begin_create_update_mongo_role_definition( @@ -4980,16 +5056,16 @@ def begin_create_update_mongo_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_role_definition_initial( # type: ignore + raw_result = self._create_update_mongo_role_definition_initial( mongo_role_definition_id=mongo_role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -5010,7 +5086,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5022,9 +5098,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_create_update_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -5040,10 +5118,10 @@ def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -5056,9 +5134,9 @@ def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5071,7 +5149,9 @@ def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _delete_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _delete_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace def begin_delete_mongo_role_definition( @@ -5101,13 +5181,13 @@ def begin_delete_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_role_definition_initial( # type: ignore mongo_role_definition_id=mongo_role_definition_id, @@ -5126,7 +5206,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5138,9 +5218,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_delete_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace def list_mongo_role_definitions( @@ -5162,10 +5244,10 @@ def list_mongo_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionListResult] + ) + cls: ClsType[_models.MongoRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5188,7 +5270,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5204,7 +5286,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5212,13 +5294,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5231,7 +5313,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions"} # type: ignore + list_mongo_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions" + } @distributed_trace def get_mongo_user_definition( @@ -5263,10 +5347,10 @@ def get_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] + ) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -5279,9 +5363,9 @@ def get_mongo_user_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5298,7 +5382,9 @@ def get_mongo_user_definition( return deserialized - get_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + get_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } def _create_update_mongo_user_definition_initial( self, @@ -5319,11 +5405,11 @@ def _create_update_mongo_user_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoUserDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoUserDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5349,9 +5435,9 @@ def _create_update_mongo_user_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5370,7 +5456,9 @@ def _create_update_mongo_user_definition_initial( return deserialized - _create_update_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _create_update_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @overload def begin_create_update_mongo_user_definition( @@ -5497,16 +5585,16 @@ def begin_create_update_mongo_user_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_user_definition_initial( # type: ignore + raw_result = self._create_update_mongo_user_definition_initial( mongo_user_definition_id=mongo_user_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -5527,7 +5615,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5539,9 +5627,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_create_update_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_user_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -5557,10 +5647,10 @@ def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -5573,9 +5663,9 @@ def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5588,7 +5678,9 @@ def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _delete_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _delete_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace def begin_delete_mongo_user_definition( @@ -5618,13 +5710,13 @@ def begin_delete_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_user_definition_initial( # type: ignore mongo_user_definition_id=mongo_user_definition_id, @@ -5643,7 +5735,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5655,9 +5747,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_delete_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace def list_mongo_user_definitions( @@ -5679,10 +5773,10 @@ def list_mongo_user_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionListResult] + ) + cls: ClsType[_models.MongoUserDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5705,7 +5799,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5721,7 +5815,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5729,13 +5823,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoUserDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5748,7 +5842,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_user_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions"} # type: ignore + list_mongo_user_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions" + } def _retrieve_continuous_backup_information_initial( self, @@ -5770,11 +5866,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5799,9 +5895,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5820,7 +5916,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -5949,16 +6047,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5980,9 +6078,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5994,6 +6092,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py index 93f6c5e537aa..6c03a38ffc27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py @@ -49,9 +49,9 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,9 +90,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,10 +132,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +154,7 @@ def build_create_or_update_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,9 +177,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_delete_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,9 +219,9 @@ def build_list_connection_info_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +240,7 @@ def build_list_connection_info_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,9 +261,9 @@ def build_regenerate_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +282,7 @@ def build_regenerate_auth_token_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -303,9 +303,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +324,7 @@ def build_start_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -373,10 +373,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceListResult] + ) + cls: ClsType[_models.NotebookWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -399,7 +399,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -415,7 +415,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -423,13 +423,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("NotebookWorkspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -443,7 +443,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces" + } @distributed_trace def get( @@ -479,10 +481,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -495,9 +497,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -515,7 +517,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } def _create_or_update_initial( self, @@ -536,11 +540,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -564,9 +568,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -584,7 +588,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @overload def begin_create_or_update( @@ -711,16 +717,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, notebook_workspace_name=notebook_workspace_name, @@ -741,7 +747,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -753,9 +759,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -775,10 +783,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -791,9 +799,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -807,7 +815,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace def begin_delete( @@ -842,13 +852,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -867,7 +877,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -879,9 +889,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace def list_connection_info( @@ -917,10 +929,10 @@ def list_connection_info( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceConnectionInfoResult] + ) + cls: ClsType[_models.NotebookWorkspaceConnectionInfoResult] = kwargs.pop("cls", None) request = build_list_connection_info_request( resource_group_name=resource_group_name, @@ -933,9 +945,9 @@ def list_connection_info( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -953,7 +965,9 @@ def list_connection_info( return deserialized - list_connection_info.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo"} # type: ignore + list_connection_info.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo" + } def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-statements self, @@ -973,10 +987,10 @@ def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_regenerate_auth_token_request( resource_group_name=resource_group_name, @@ -989,9 +1003,9 @@ def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1005,7 +1019,9 @@ def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _regenerate_auth_token_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + _regenerate_auth_token_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } @distributed_trace def begin_regenerate_auth_token( @@ -1040,13 +1056,13 @@ def begin_regenerate_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._regenerate_auth_token_initial( # type: ignore resource_group_name=resource_group_name, @@ -1065,7 +1081,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1077,9 +1093,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_auth_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + begin_regenerate_auth_token.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1099,10 +1117,10 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -1115,9 +1133,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1131,7 +1149,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } @distributed_trace def begin_start( @@ -1166,13 +1186,13 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -1191,7 +1211,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1203,6 +1223,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py index 2fbc8b7deb6c..48f05242dd00 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py @@ -45,9 +45,9 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,10 +93,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -116,7 +116,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -132,7 +132,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -140,13 +140,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -159,4 +159,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py index db390f0e246d..c6443dac9772 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py @@ -55,9 +55,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_metrics_request( "partitionKeyRangeId": _SERIALIZER.url("partition_key_range_id", partition_key_range_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,10 +145,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -175,7 +175,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -191,7 +191,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -199,13 +199,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -218,4 +218,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py index db837aefe5ef..c15046166fd8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py @@ -56,9 +56,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_list_metrics_request( "partitionKeyRangeId": _SERIALIZER.url("partition_key_range_id", partition_key_range_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,10 +151,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -182,7 +182,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -198,7 +198,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -206,13 +206,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -225,4 +225,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py index a9c47c6ff1ad..4ed398ab27b3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_metrics_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,10 +122,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -149,7 +149,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -165,7 +165,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -173,13 +173,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -192,4 +192,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py index 1c7697c6c969..ff126462efaa 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py @@ -54,9 +54,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_metrics_request( "targetRegion": _SERIALIZER.url("target_region", target_region, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,10 +143,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,7 +172,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -188,7 +188,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -196,13 +196,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -215,4 +215,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py index 276f2c7c4089..3c5562fc18c7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_metrics_request( "targetRegion": _SERIALIZER.url("target_region", target_region, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,10 +126,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -154,7 +154,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -170,7 +170,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -178,13 +178,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -197,4 +197,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py index 35c730832763..be2effe9e164 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py @@ -49,9 +49,9 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,9 +90,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,10 +134,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,9 +181,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +204,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -254,10 +254,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -280,7 +280,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -296,7 +296,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -304,13 +304,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -323,7 +323,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections" + } @distributed_trace def get( @@ -354,10 +356,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -370,9 +372,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -389,7 +391,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _create_or_update_initial( self, @@ -410,11 +414,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -438,9 +442,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -460,7 +464,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload def begin_create_or_update( @@ -579,16 +585,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -609,7 +615,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -621,9 +627,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -639,10 +647,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -655,9 +663,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -671,7 +679,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def begin_delete( @@ -701,13 +711,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -726,7 +736,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -738,6 +748,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py index 45dc003f19d8..cc4b632de95c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py @@ -47,9 +47,9 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,9 +84,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -154,10 +154,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -180,7 +180,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -196,7 +196,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -204,13 +204,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -223,7 +223,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources" + } @distributed_trace def get( @@ -254,10 +256,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -270,9 +272,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -289,4 +291,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py index d427dee29773..1a46285946ed 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py @@ -45,9 +45,9 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs "location": _SERIALIZER.url("location", location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,9 +75,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,9 +103,9 @@ def build_get_by_location_request(location: str, instance_id: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_get_by_location_request(location: str, instance_id: str, subscription_ "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,10 +168,10 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -193,7 +193,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -209,7 +209,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -217,13 +217,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -236,7 +236,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.RestorableDatabaseAccountGetResult"]: @@ -253,10 +255,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.RestorableDatabaseAccountGetR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -277,7 +279,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -293,7 +295,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +303,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,7 +322,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} @distributed_trace def get_by_location( @@ -350,10 +352,10 @@ def get_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountGetResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountGetResult] = kwargs.pop("cls", None) request = build_get_by_location_request( location=location, @@ -365,9 +367,9 @@ def get_by_location( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -384,4 +386,6 @@ def get_by_location( return deserialized - get_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}"} # type: ignore + get_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py index 2a0410095b85..bd627754062d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py @@ -45,9 +45,9 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinDatabasesListResult] + ) + cls: ClsType[_models.RestorableGremlinDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,7 +141,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -157,7 +157,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,4 +184,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py index c73dc751971f..43ea3d9803ed 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py @@ -54,9 +54,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,10 +144,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinGraphsListResult] + ) + cls: ClsType[_models.RestorableGremlinGraphsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -173,7 +173,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -189,7 +189,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -197,13 +197,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinGraphsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -216,4 +216,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py index 0e852217cdea..5119898095f5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinResourcesListResult] + ) + cls: ClsType[_models.RestorableGremlinResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -168,7 +168,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -184,7 +184,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -192,13 +192,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,4 +211,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py index fef5e5618042..e259666f50d4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py @@ -54,9 +54,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,10 +144,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbCollectionsListResult] + ) + cls: ClsType[_models.RestorableMongodbCollectionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -173,7 +173,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -189,7 +189,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -197,13 +197,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbCollectionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -216,4 +216,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py index ff117c7068be..062ccba6a218 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py @@ -45,9 +45,9 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbDatabasesListResult] + ) + cls: ClsType[_models.RestorableMongodbDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,7 +141,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -157,7 +157,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,4 +184,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py index 8028af9f27e2..3193ec61033f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbResourcesListResult] + ) + cls: ClsType[_models.RestorableMongodbResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -168,7 +168,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -184,7 +184,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -192,13 +192,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,4 +211,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py index 8f0b9244cb88..3f707d64d8c6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py @@ -54,9 +54,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,10 +143,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlContainersListResult] + ) + cls: ClsType[_models.RestorableSqlContainersListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,7 +172,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -188,7 +188,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -196,13 +196,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlContainersListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -215,4 +215,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py index d87fd6a1ecb9..698f51de3fec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py @@ -45,9 +45,9 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlDatabasesListResult] + ) + cls: ClsType[_models.RestorableSqlDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,7 +141,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -157,7 +157,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,4 +184,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py index 299968b5dac9..78258dca6134 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlResourcesListResult] + ) + cls: ClsType[_models.RestorableSqlResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -168,7 +168,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -184,7 +184,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -192,13 +192,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,4 +211,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py index 33b684d69fa6..1a3cbab0b16d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -139,10 +139,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTableResourcesListResult] + ) + cls: ClsType[_models.RestorableTableResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -167,7 +167,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -183,7 +183,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -191,13 +191,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTableResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -210,4 +210,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py index 631848b04df2..c556e9df813a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,10 +134,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTablesListResult] + ) + cls: ClsType[_models.RestorableTablesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -162,7 +162,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -178,7 +178,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -186,13 +186,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTablesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -205,4 +205,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py index d8999828d165..834001e366a0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py @@ -47,9 +47,9 @@ def build_list_request(resource_group_name: str, account_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,10 +84,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_create_request( "serviceName": _SERIALIZER.url("service_name", service_name, "str", max_length=50, min_length=3), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,9 +125,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_get_request( "serviceName": _SERIALIZER.url("service_name", service_name, "str", max_length=50, min_length=3), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ def build_delete_request( "serviceName": _SERIALIZER.url("service_name", service_name, "str", max_length=50, min_length=3), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,10 +231,10 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResourceListResult] + ) + cls: ClsType[_models.ServiceResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -257,7 +257,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -273,7 +273,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -281,13 +281,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -300,7 +300,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services" + } def _create_initial( self, @@ -321,11 +323,11 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServiceResource]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServiceResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -349,9 +351,9 @@ def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -370,7 +372,9 @@ def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @overload def begin_create( @@ -492,16 +496,16 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( # type: ignore + raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, service_name=service_name, @@ -522,7 +526,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -534,9 +538,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace def get( @@ -567,10 +573,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -583,9 +589,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -602,7 +608,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, service_name: str, **kwargs: Any @@ -618,10 +626,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -634,9 +642,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -649,7 +657,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace def begin_delete( @@ -679,13 +689,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -704,7 +714,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -716,6 +726,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py index 3bf700b9605e..953929dbdd73 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py @@ -49,9 +49,9 @@ def build_list_sql_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_sql_databases_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_sql_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_sql_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_sql_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_sql_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_sql_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_sql_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_sql_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_sql_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_sql_database_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_sql_database_to_autoscale_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_sql_database_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_sql_database_to_manual_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,9 +352,9 @@ def build_list_client_encryption_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +373,7 @@ def build_list_client_encryption_keys_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,9 +395,9 @@ def build_get_client_encryption_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_get_client_encryption_key_request( "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_create_update_client_encryption_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_create_update_client_encryption_key_request( "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -481,9 +481,9 @@ def build_list_sql_containers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -502,7 +502,7 @@ def build_list_sql_containers_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ def build_get_sql_container_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +546,7 @@ def build_get_sql_container_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -568,10 +568,10 @@ def build_create_update_sql_container_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +591,7 @@ def build_create_update_sql_container_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -614,9 +614,9 @@ def build_delete_sql_container_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -634,7 +634,7 @@ def build_delete_sql_container_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -653,10 +653,10 @@ def build_list_sql_container_partition_merge_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -676,7 +676,7 @@ def build_list_sql_container_partition_merge_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -700,9 +700,9 @@ def build_get_sql_container_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -722,7 +722,7 @@ def build_get_sql_container_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -744,10 +744,10 @@ def build_update_sql_container_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -767,7 +767,7 @@ def build_update_sql_container_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -791,9 +791,9 @@ def build_migrate_sql_container_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -813,7 +813,7 @@ def build_migrate_sql_container_to_autoscale_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -835,9 +835,9 @@ def build_migrate_sql_container_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -857,7 +857,7 @@ def build_migrate_sql_container_to_manual_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -874,10 +874,10 @@ def build_sql_database_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -896,7 +896,7 @@ def build_sql_database_retrieve_throughput_distribution_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -915,10 +915,10 @@ def build_sql_database_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -937,7 +937,7 @@ def build_sql_database_redistribute_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -961,10 +961,10 @@ def build_sql_container_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -984,7 +984,7 @@ def build_sql_container_retrieve_throughput_distribution_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1008,10 +1008,10 @@ def build_sql_container_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1031,7 +1031,7 @@ def build_sql_container_redistribute_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1055,9 +1055,9 @@ def build_list_sql_stored_procedures_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1077,7 +1077,7 @@ def build_list_sql_stored_procedures_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1100,9 +1100,9 @@ def build_get_sql_stored_procedure_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1123,7 +1123,7 @@ def build_get_sql_stored_procedure_request( "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1146,10 +1146,10 @@ def build_create_update_sql_stored_procedure_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1170,7 +1170,7 @@ def build_create_update_sql_stored_procedure_request( "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1194,9 +1194,9 @@ def build_delete_sql_stored_procedure_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -1215,7 +1215,7 @@ def build_delete_sql_stored_procedure_request( "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1234,9 +1234,9 @@ def build_list_sql_user_defined_functions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1256,7 +1256,7 @@ def build_list_sql_user_defined_functions_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1279,9 +1279,9 @@ def build_get_sql_user_defined_function_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1302,7 +1302,7 @@ def build_get_sql_user_defined_function_request( "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1325,10 +1325,10 @@ def build_create_update_sql_user_defined_function_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1349,7 +1349,7 @@ def build_create_update_sql_user_defined_function_request( "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1373,9 +1373,9 @@ def build_delete_sql_user_defined_function_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -1394,7 +1394,7 @@ def build_delete_sql_user_defined_function_request( "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1413,9 +1413,9 @@ def build_list_sql_triggers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1435,7 +1435,7 @@ def build_list_sql_triggers_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1458,9 +1458,9 @@ def build_get_sql_trigger_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1481,7 +1481,7 @@ def build_get_sql_trigger_request( "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1504,10 +1504,10 @@ def build_create_update_sql_trigger_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1528,7 +1528,7 @@ def build_create_update_sql_trigger_request( "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1552,9 +1552,9 @@ def build_delete_sql_trigger_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -1573,7 +1573,7 @@ def build_delete_sql_trigger_request( "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1587,9 +1587,9 @@ def build_get_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1608,7 +1608,7 @@ def build_get_sql_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1625,10 +1625,10 @@ def build_create_update_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1647,7 +1647,7 @@ def build_create_update_sql_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1666,9 +1666,9 @@ def build_delete_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1687,7 +1687,7 @@ def build_delete_sql_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1704,9 +1704,9 @@ def build_list_sql_role_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1724,7 +1724,7 @@ def build_list_sql_role_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1741,9 +1741,9 @@ def build_get_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1762,7 +1762,7 @@ def build_get_sql_role_assignment_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1779,10 +1779,10 @@ def build_create_update_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1801,7 +1801,7 @@ def build_create_update_sql_role_assignment_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1820,9 +1820,9 @@ def build_delete_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1841,7 +1841,7 @@ def build_delete_sql_role_assignment_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1858,9 +1858,9 @@ def build_list_sql_role_assignments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1878,7 +1878,7 @@ def build_list_sql_role_assignments_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1900,10 +1900,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1923,7 +1923,7 @@ def build_retrieve_continuous_backup_information_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1975,10 +1975,10 @@ def list_sql_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseListResult] + ) + cls: ClsType[_models.SqlDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2001,7 +2001,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2017,7 +2017,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2025,13 +2025,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2044,7 +2044,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases"} # type: ignore + list_sql_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases" + } @distributed_trace def get_sql_database( @@ -2076,10 +2078,10 @@ def get_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] + ) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_request( resource_group_name=resource_group_name, @@ -2092,9 +2094,9 @@ def get_sql_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2111,7 +2113,9 @@ def get_sql_database( return deserialized - get_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + get_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } def _create_update_sql_database_initial( self, @@ -2132,11 +2136,11 @@ def _create_update_sql_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2160,9 +2164,9 @@ def _create_update_sql_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2181,7 +2185,9 @@ def _create_update_sql_database_initial( return deserialized - _create_update_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _create_update_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @overload def begin_create_update_sql_database( @@ -2305,16 +2311,16 @@ def begin_create_update_sql_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_database_initial( # type: ignore + raw_result = self._create_update_sql_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2335,7 +2341,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2347,9 +2353,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_create_update_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } def _delete_sql_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2365,10 +2373,10 @@ def _delete_sql_database_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_database_request( resource_group_name=resource_group_name, @@ -2381,9 +2389,9 @@ def _delete_sql_database_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2396,7 +2404,9 @@ def _delete_sql_database_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _delete_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _delete_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace def begin_delete_sql_database( @@ -2426,13 +2436,13 @@ def begin_delete_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -2451,7 +2461,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2463,9 +2473,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_delete_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace def get_sql_database_throughput( @@ -2497,10 +2509,10 @@ def get_sql_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_throughput_request( resource_group_name=resource_group_name, @@ -2513,9 +2525,9 @@ def get_sql_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2532,7 +2544,9 @@ def get_sql_database_throughput( return deserialized - get_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } def _update_sql_database_throughput_initial( self, @@ -2553,11 +2567,11 @@ def _update_sql_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2581,9 +2595,9 @@ def _update_sql_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2602,7 +2616,9 @@ def _update_sql_database_throughput_initial( return deserialized - _update_sql_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_sql_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } @overload def begin_update_sql_database_throughput( @@ -2726,16 +2742,16 @@ def begin_update_sql_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_sql_database_throughput_initial( # type: ignore + raw_result = self._update_sql_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2756,7 +2772,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2768,9 +2784,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } def _migrate_sql_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2786,10 +2804,10 @@ def _migrate_sql_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -2802,9 +2820,9 @@ def _migrate_sql_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2823,7 +2841,9 @@ def _migrate_sql_database_to_autoscale_initial( return deserialized - _migrate_sql_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_sql_database_to_autoscale( @@ -2854,15 +2874,15 @@ def begin_migrate_sql_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_database_to_autoscale_initial( # type: ignore + raw_result = self._migrate_sql_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2881,7 +2901,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2893,9 +2913,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_sql_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2911,10 +2933,10 @@ def _migrate_sql_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2927,9 +2949,9 @@ def _migrate_sql_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2948,7 +2970,9 @@ def _migrate_sql_database_to_manual_throughput_initial( return deserialized - _migrate_sql_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_sql_database_to_manual_throughput( @@ -2979,15 +3003,15 @@ def begin_migrate_sql_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_database_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_sql_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3006,7 +3030,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3018,9 +3042,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_client_encryption_keys( @@ -3044,10 +3070,10 @@ def list_client_encryption_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeysListResult] + ) + cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3071,7 +3097,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3087,7 +3113,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3095,13 +3121,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3114,7 +3140,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_client_encryption_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys"} # type: ignore + list_client_encryption_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys" + } @distributed_trace def get_client_encryption_key( @@ -3152,10 +3180,10 @@ def get_client_encryption_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] + ) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) request = build_get_client_encryption_key_request( resource_group_name=resource_group_name, @@ -3169,9 +3197,9 @@ def get_client_encryption_key( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3188,7 +3216,9 @@ def get_client_encryption_key( return deserialized - get_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + get_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } def _create_update_client_encryption_key_initial( self, @@ -3210,11 +3240,11 @@ def _create_update_client_encryption_key_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3241,9 +3271,9 @@ def _create_update_client_encryption_key_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3262,7 +3292,9 @@ def _create_update_client_encryption_key_initial( return deserialized - _create_update_client_encryption_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + _create_update_client_encryption_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @overload def begin_create_update_client_encryption_key( @@ -3401,16 +3433,16 @@ def begin_create_update_client_encryption_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_client_encryption_key_initial( # type: ignore + raw_result = self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3432,7 +3464,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3444,9 +3476,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + begin_create_update_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @distributed_trace def list_sql_containers( @@ -3470,10 +3504,10 @@ def list_sql_containers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerListResult] + ) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3497,7 +3531,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3513,7 +3547,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3521,13 +3555,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3540,7 +3574,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_containers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers"} # type: ignore + list_sql_containers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers" + } @distributed_trace def get_sql_container( @@ -3573,10 +3609,10 @@ def get_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] + ) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_request( resource_group_name=resource_group_name, @@ -3590,9 +3626,9 @@ def get_sql_container( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3609,7 +3645,9 @@ def get_sql_container( return deserialized - get_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + get_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } def _create_update_sql_container_initial( self, @@ -3631,11 +3669,11 @@ def _create_update_sql_container_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlContainerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlContainerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3660,9 +3698,9 @@ def _create_update_sql_container_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3681,7 +3719,9 @@ def _create_update_sql_container_initial( return deserialized - _create_update_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _create_update_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @overload def begin_create_update_sql_container( @@ -3814,16 +3854,16 @@ def begin_create_update_sql_container( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_container_initial( # type: ignore + raw_result = self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3845,7 +3885,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3857,9 +3897,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_create_update_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -3875,10 +3917,10 @@ def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statem _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_container_request( resource_group_name=resource_group_name, @@ -3892,9 +3934,9 @@ def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3907,7 +3949,9 @@ def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _delete_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _delete_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @distributed_trace def begin_delete_sql_container( @@ -3939,13 +3983,13 @@ def begin_delete_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_container_initial( # type: ignore resource_group_name=resource_group_name, @@ -3965,7 +4009,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3977,9 +4021,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_delete_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } def _list_sql_container_partition_merge_initial( self, @@ -4001,11 +4047,11 @@ def _list_sql_container_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4030,9 +4076,9 @@ def _list_sql_container_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4051,7 +4097,9 @@ def _list_sql_container_partition_merge_initial( return deserialized - _list_sql_container_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + _list_sql_container_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @overload def begin_list_sql_container_partition_merge( @@ -4183,16 +4231,16 @@ def begin_list_sql_container_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._list_sql_container_partition_merge_initial( # type: ignore + raw_result = self._list_sql_container_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4214,9 +4262,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4228,9 +4276,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_sql_container_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + begin_list_sql_container_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @distributed_trace def get_sql_container_throughput( @@ -4264,10 +4314,10 @@ def get_sql_container_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, @@ -4281,9 +4331,9 @@ def get_sql_container_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4300,7 +4350,9 @@ def get_sql_container_throughput( return deserialized - get_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + get_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } def _update_sql_container_throughput_initial( self, @@ -4322,11 +4374,11 @@ def _update_sql_container_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4351,9 +4403,9 @@ def _update_sql_container_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4372,7 +4424,9 @@ def _update_sql_container_throughput_initial( return deserialized - _update_sql_container_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + _update_sql_container_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } @overload def begin_update_sql_container_throughput( @@ -4505,16 +4559,16 @@ def begin_update_sql_container_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_sql_container_throughput_initial( # type: ignore + raw_result = self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4536,7 +4590,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4548,9 +4602,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + begin_update_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } def _migrate_sql_container_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -4566,10 +4622,10 @@ def _migrate_sql_container_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, @@ -4583,9 +4639,9 @@ def _migrate_sql_container_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4604,7 +4660,9 @@ def _migrate_sql_container_to_autoscale_initial( return deserialized - _migrate_sql_container_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_container_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_sql_container_to_autoscale( @@ -4637,15 +4695,15 @@ def begin_migrate_sql_container_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_container_to_autoscale_initial( # type: ignore + raw_result = self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4665,7 +4723,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4677,9 +4735,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_container_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_sql_container_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -4695,10 +4755,10 @@ def _migrate_sql_container_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -4712,9 +4772,9 @@ def _migrate_sql_container_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4733,7 +4793,9 @@ def _migrate_sql_container_to_manual_throughput_initial( return deserialized - _migrate_sql_container_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_container_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_sql_container_to_manual_throughput( @@ -4766,15 +4828,15 @@ def begin_migrate_sql_container_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_container_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4794,7 +4856,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4806,9 +4868,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_container_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } def _sql_database_retrieve_throughput_distribution_initial( self, @@ -4829,11 +4893,11 @@ def _sql_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4857,9 +4921,9 @@ def _sql_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4878,7 +4942,9 @@ def _sql_database_retrieve_throughput_distribution_initial( return deserialized - _sql_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_sql_database_retrieve_throughput_distribution( @@ -5004,16 +5070,16 @@ def begin_sql_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._sql_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5034,9 +5100,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5048,9 +5114,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } def _sql_database_redistribute_throughput_initial( self, @@ -5071,11 +5139,11 @@ def _sql_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5099,9 +5167,9 @@ def _sql_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5120,7 +5188,9 @@ def _sql_database_redistribute_throughput_initial( return deserialized - _sql_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_sql_database_redistribute_throughput( @@ -5247,16 +5317,16 @@ def begin_sql_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_database_redistribute_throughput_initial( # type: ignore + raw_result = self._sql_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5277,9 +5347,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5291,9 +5361,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } def _sql_container_retrieve_throughput_distribution_initial( self, @@ -5315,11 +5387,11 @@ def _sql_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5344,9 +5416,9 @@ def _sql_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5365,7 +5437,9 @@ def _sql_container_retrieve_throughput_distribution_initial( return deserialized - _sql_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_sql_container_retrieve_throughput_distribution( @@ -5500,16 +5574,16 @@ def begin_sql_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._sql_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5531,9 +5605,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5545,9 +5619,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } def _sql_container_redistribute_throughput_initial( self, @@ -5569,11 +5645,11 @@ def _sql_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5598,9 +5674,9 @@ def _sql_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5619,7 +5695,9 @@ def _sql_container_redistribute_throughput_initial( return deserialized - _sql_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_sql_container_redistribute_throughput( @@ -5755,16 +5833,16 @@ def begin_sql_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_container_redistribute_throughput_initial( # type: ignore + raw_result = self._sql_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5786,9 +5864,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5800,9 +5878,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_sql_stored_procedures( @@ -5828,10 +5908,10 @@ def list_sql_stored_procedures( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureListResult] + ) + cls: ClsType[_models.SqlStoredProcedureListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5856,7 +5936,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5872,7 +5952,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5880,13 +5960,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlStoredProcedureListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5899,7 +5979,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_stored_procedures.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures"} # type: ignore + list_sql_stored_procedures.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures" + } @distributed_trace def get_sql_stored_procedure( @@ -5940,10 +6022,10 @@ def get_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] + ) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) request = build_get_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -5958,9 +6040,9 @@ def get_sql_stored_procedure( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5977,7 +6059,9 @@ def get_sql_stored_procedure( return deserialized - get_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + get_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } def _create_update_sql_stored_procedure_initial( self, @@ -6000,11 +6084,11 @@ def _create_update_sql_stored_procedure_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlStoredProcedureGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlStoredProcedureGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6032,9 +6116,9 @@ def _create_update_sql_stored_procedure_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6053,7 +6137,9 @@ def _create_update_sql_stored_procedure_initial( return deserialized - _create_update_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _create_update_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @overload def begin_create_update_sql_stored_procedure( @@ -6195,16 +6281,16 @@ def begin_create_update_sql_stored_procedure( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_stored_procedure_initial( # type: ignore + raw_result = self._create_update_sql_stored_procedure_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -6227,7 +6313,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6239,9 +6325,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_create_update_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return-statements self, @@ -6263,10 +6351,10 @@ def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -6281,9 +6369,9 @@ def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6296,7 +6384,9 @@ def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _delete_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _delete_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace def begin_delete_sql_stored_procedure( @@ -6336,13 +6426,13 @@ def begin_delete_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_stored_procedure_initial( # type: ignore resource_group_name=resource_group_name, @@ -6363,7 +6453,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6375,9 +6465,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_delete_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace def list_sql_user_defined_functions( @@ -6404,10 +6496,10 @@ def list_sql_user_defined_functions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionListResult] + ) + cls: ClsType[_models.SqlUserDefinedFunctionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6432,7 +6524,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -6448,7 +6540,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -6456,13 +6548,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlUserDefinedFunctionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -6475,7 +6567,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_user_defined_functions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions"} # type: ignore + list_sql_user_defined_functions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions" + } @distributed_trace def get_sql_user_defined_function( @@ -6516,10 +6610,10 @@ def get_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] + ) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) request = build_get_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -6534,9 +6628,9 @@ def get_sql_user_defined_function( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6553,7 +6647,9 @@ def get_sql_user_defined_function( return deserialized - get_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + get_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } def _create_update_sql_user_defined_function_initial( self, @@ -6578,11 +6674,11 @@ def _create_update_sql_user_defined_function_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6610,9 +6706,9 @@ def _create_update_sql_user_defined_function_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6631,7 +6727,9 @@ def _create_update_sql_user_defined_function_initial( return deserialized - _create_update_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _create_update_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @overload def begin_create_update_sql_user_defined_function( @@ -6778,16 +6876,16 @@ def begin_create_update_sql_user_defined_function( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_user_defined_function_initial( # type: ignore + raw_result = self._create_update_sql_user_defined_function_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -6810,7 +6908,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6822,9 +6920,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_create_update_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-return-statements self, @@ -6846,10 +6946,10 @@ def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -6864,9 +6964,9 @@ def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6879,7 +6979,9 @@ def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _delete_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace def begin_delete_sql_user_defined_function( @@ -6919,13 +7021,13 @@ def begin_delete_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_user_defined_function_initial( # type: ignore resource_group_name=resource_group_name, @@ -6946,7 +7048,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6958,9 +7060,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_delete_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace def list_sql_triggers( @@ -6986,10 +7090,10 @@ def list_sql_triggers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerListResult] + ) + cls: ClsType[_models.SqlTriggerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -7014,7 +7118,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -7030,7 +7134,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -7038,13 +7142,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlTriggerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -7057,7 +7161,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_triggers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers"} # type: ignore + list_sql_triggers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers" + } @distributed_trace def get_sql_trigger( @@ -7098,10 +7204,10 @@ def get_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] + ) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) request = build_get_sql_trigger_request( resource_group_name=resource_group_name, @@ -7116,9 +7222,9 @@ def get_sql_trigger( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7135,7 +7241,9 @@ def get_sql_trigger( return deserialized - get_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + get_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } def _create_update_sql_trigger_initial( self, @@ -7158,11 +7266,11 @@ def _create_update_sql_trigger_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlTriggerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlTriggerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -7188,9 +7296,9 @@ def _create_update_sql_trigger_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7209,7 +7317,9 @@ def _create_update_sql_trigger_initial( return deserialized - _create_update_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _create_update_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @overload def begin_create_update_sql_trigger( @@ -7351,16 +7461,16 @@ def begin_create_update_sql_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_trigger_initial( # type: ignore + raw_result = self._create_update_sql_trigger_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -7383,7 +7493,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7395,9 +7505,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_create_update_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statements self, @@ -7419,10 +7531,10 @@ def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_trigger_request( resource_group_name=resource_group_name, @@ -7437,9 +7549,9 @@ def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7452,7 +7564,9 @@ def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - _delete_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _delete_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace def begin_delete_sql_trigger( @@ -7492,13 +7606,13 @@ def begin_delete_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_trigger_initial( # type: ignore resource_group_name=resource_group_name, @@ -7519,7 +7633,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7531,9 +7645,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_delete_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace def get_sql_role_definition( @@ -7564,10 +7680,10 @@ def get_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] + ) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_definition_request( role_definition_id=role_definition_id, @@ -7580,9 +7696,9 @@ def get_sql_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7599,7 +7715,9 @@ def get_sql_role_definition( return deserialized - get_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + get_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } def _create_update_sql_role_definition_initial( self, @@ -7620,11 +7738,11 @@ def _create_update_sql_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -7650,9 +7768,9 @@ def _create_update_sql_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7671,7 +7789,9 @@ def _create_update_sql_role_definition_initial( return deserialized - _create_update_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _create_update_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @overload def begin_create_update_sql_role_definition( @@ -7795,16 +7915,16 @@ def begin_create_update_sql_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_role_definition_initial( # type: ignore + raw_result = self._create_update_sql_role_definition_initial( role_definition_id=role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -7825,7 +7945,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7837,9 +7957,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_create_update_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return-statements self, role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -7855,10 +7977,10 @@ def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_definition_request( role_definition_id=role_definition_id, @@ -7871,9 +7993,9 @@ def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7886,7 +8008,9 @@ def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _delete_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace def begin_delete_sql_role_definition( @@ -7916,13 +8040,13 @@ def begin_delete_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_role_definition_initial( # type: ignore role_definition_id=role_definition_id, @@ -7941,7 +8065,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7953,9 +8077,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_delete_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace def list_sql_role_definitions( @@ -7977,10 +8103,10 @@ def list_sql_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionListResult] + ) + cls: ClsType[_models.SqlRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -8003,7 +8129,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -8019,7 +8145,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -8027,13 +8153,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -8046,7 +8172,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions"} # type: ignore + list_sql_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions" + } @distributed_trace def get_sql_role_assignment( @@ -8077,10 +8205,10 @@ def get_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] + ) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -8093,9 +8221,9 @@ def get_sql_role_assignment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8112,7 +8240,9 @@ def get_sql_role_assignment( return deserialized - get_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + get_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } def _create_update_sql_role_assignment_initial( self, @@ -8133,11 +8263,11 @@ def _create_update_sql_role_assignment_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -8163,9 +8293,9 @@ def _create_update_sql_role_assignment_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8184,7 +8314,9 @@ def _create_update_sql_role_assignment_initial( return deserialized - _create_update_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _create_update_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @overload def begin_create_update_sql_role_assignment( @@ -8308,16 +8440,16 @@ def begin_create_update_sql_role_assignment( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_role_assignment_initial( # type: ignore + raw_result = self._create_update_sql_role_assignment_initial( role_assignment_id=role_assignment_id, resource_group_name=resource_group_name, account_name=account_name, @@ -8338,7 +8470,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -8350,9 +8482,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_create_update_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return-statements self, role_assignment_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -8368,10 +8502,10 @@ def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -8384,9 +8518,9 @@ def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8399,7 +8533,9 @@ def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _delete_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace def begin_delete_sql_role_assignment( @@ -8429,13 +8565,13 @@ def begin_delete_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_role_assignment_initial( # type: ignore role_assignment_id=role_assignment_id, @@ -8454,7 +8590,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -8466,9 +8602,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_delete_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace def list_sql_role_assignments( @@ -8490,10 +8628,10 @@ def list_sql_role_assignments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentListResult] + ) + cls: ClsType[_models.SqlRoleAssignmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -8516,7 +8654,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -8532,7 +8670,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -8540,13 +8678,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleAssignmentListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -8559,7 +8697,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_role_assignments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments"} # type: ignore + list_sql_role_assignments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments" + } def _retrieve_continuous_backup_information_initial( self, @@ -8581,11 +8721,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -8610,9 +8750,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8631,7 +8771,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -8760,16 +8902,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -8791,9 +8933,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -8805,6 +8947,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py index f6f4efd13987..60c393608176 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py @@ -49,9 +49,9 @@ def build_list_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_tables_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_table_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_table_to_autoscale_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_table_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_table_to_manual_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,10 +352,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +374,7 @@ def build_retrieve_continuous_backup_information_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -425,10 +425,10 @@ def list_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableListResult] + ) + cls: ClsType[_models.TableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -451,7 +451,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -467,7 +467,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -475,13 +475,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("TableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -494,7 +494,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables"} # type: ignore + list_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables" + } @distributed_trace def get_table( @@ -525,10 +527,10 @@ def get_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] + ) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) request = build_get_table_request( resource_group_name=resource_group_name, @@ -541,9 +543,9 @@ def get_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -560,7 +562,9 @@ def get_table( return deserialized - get_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + get_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } def _create_update_table_initial( self, @@ -581,11 +585,11 @@ def _create_update_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.TableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.TableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -609,9 +613,9 @@ def _create_update_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -630,7 +634,9 @@ def _create_update_table_initial( return deserialized - _create_update_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _create_update_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @overload def begin_create_update_table( @@ -753,16 +759,16 @@ def begin_create_update_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_table_initial( # type: ignore + raw_result = self._create_update_table_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -783,7 +789,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -795,9 +801,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_create_update_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } def _delete_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -813,10 +821,10 @@ def _delete_table_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_table_request( resource_group_name=resource_group_name, @@ -829,9 +837,9 @@ def _delete_table_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -844,7 +852,9 @@ def _delete_table_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _delete_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace def begin_delete_table( @@ -874,13 +884,13 @@ def begin_delete_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -899,7 +909,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -911,9 +921,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_delete_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace def get_table_throughput( @@ -945,10 +957,10 @@ def get_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_table_throughput_request( resource_group_name=resource_group_name, @@ -961,9 +973,9 @@ def get_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -980,7 +992,9 @@ def get_table_throughput( return deserialized - get_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } def _update_table_throughput_initial( self, @@ -1001,11 +1015,11 @@ def _update_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1029,9 +1043,9 @@ def _update_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1050,7 +1064,9 @@ def _update_table_throughput_initial( return deserialized - _update_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } @overload def begin_update_table_throughput( @@ -1174,16 +1190,16 @@ def begin_update_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_table_throughput_initial( # type: ignore + raw_result = self._update_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1204,7 +1220,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1216,9 +1232,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } def _migrate_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -1234,10 +1252,10 @@ def _migrate_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -1250,9 +1268,9 @@ def _migrate_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1271,7 +1289,9 @@ def _migrate_table_to_autoscale_initial( return deserialized - _migrate_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_table_to_autoscale( @@ -1302,15 +1322,15 @@ def begin_migrate_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_table_to_autoscale_initial( # type: ignore + raw_result = self._migrate_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1329,7 +1349,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1341,9 +1361,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -1359,10 +1381,10 @@ def _migrate_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1375,9 +1397,9 @@ def _migrate_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1396,7 +1418,9 @@ def _migrate_table_to_manual_throughput_initial( return deserialized - _migrate_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_table_to_manual_throughput( @@ -1427,15 +1451,15 @@ def begin_migrate_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_table_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1454,7 +1478,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1466,9 +1490,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } def _retrieve_continuous_backup_information_initial( self, @@ -1489,11 +1515,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1517,9 +1543,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1538,7 +1564,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -1658,16 +1686,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1688,9 +1716,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1702,6 +1730,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py new file mode 100644 index 000000000000..3f001e7ded2e --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_collection_partition_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.collection_partition.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + database_rid="databaseRid", + collection_rid="collectionRid", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py new file mode 100644 index 000000000000..f771c98c5f96 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_collection_partition_get_usages.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.collection_partition.list_usages( + resource_group_name="rg1", + account_name="ddb1", + database_rid="databaseRid", + collection_rid="collectionRid", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py new file mode 100644 index 000000000000..77ca4ea063c0 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_collection_partition_region_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.collection_partition_region.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + region="North Europe", + database_rid="databaseRid", + collection_rid="collectionRid", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py new file mode 100644 index 000000000000..2549bdbc299b --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_data_transfer_job_cancel.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.data_transfer_jobs.cancel( + resource_group_name="rg1", + account_name="ddb1", + job_name="j1", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py new file mode 100644 index 000000000000..2691f1926187 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_data_transfer_job_resume.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.data_transfer_jobs.resume( + resource_group_name="rg1", + account_name="ddb1", + job_name="j1", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py index ec9473f00721..8eccadc9866a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python data_transfer_service_create.py + python cosmos_db_data_transfer_service_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py index 1d0c93cc79b0..57e749cf2949 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python data_transfer_service_delete.py + python cosmos_db_data_transfer_service_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py index 9effb49d7e09..0b049757b070 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python data_transfer_service_get.py + python cosmos_db_data_transfer_service_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py index c3565bf74065..746069a53c51 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python graph_api_compute_service_create.py + python cosmos_db_graph_api_compute_service_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py index 804281a9e8a1..79d830d6b494 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python graph_api_compute_service_delete.py + python cosmos_db_graph_api_compute_service_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py index db1974971dd1..5b6d84fa522d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python graph_api_compute_service_get.py + python cosmos_db_graph_api_compute_service_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py similarity index 97% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_create_update.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py index 600417639f0a..5755b02363d7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_graph_create_update.py + python cosmos_db_graph_resource_create_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py new file mode 100644 index 000000000000..93f059661642 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_graph_resource_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.graph_resources.begin_delete_graph_resource( + resource_group_name="rg1", + account_name="ddb1", + graph_name="graphName", + ).result() + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py new file mode 100644 index 000000000000..c119d572e86e --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_graph_resource_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.graph_resources.get_graph( + resource_group_name="rg1", + account_name="ddb1", + graph_name="graphName", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceGet.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py new file mode 100644 index 000000000000..10d814f50de7 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_graph_resource_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.graph_resources.list_graphs( + resource_group_name="rgName", + account_name="ddb1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceList.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py similarity index 97% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_update.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py index d75c7881eacb..838025f47d85 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_managed_cassandra_data_center_update.py + python cosmos_db_managed_cassandra_data_center_patch.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py index 142418d13f45..3642a7981ace 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python materialized_views_builder_service_create.py + python cosmos_db_materialized_views_builder_service_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py similarity index 95% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py index 90c2982b5477..58bc66f0aa00 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python materialized_views_builder_service_delete.py + python cosmos_db_materialized_views_builder_service_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py index ca0edbf69722..ce1c2e339887 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python materialized_views_builder_service_get.py + python cosmos_db_materialized_views_builder_service_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_role_definition_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py index 7d3e03a7b38c..94a203dc65c1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_role_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_mongo_role_definition_get.py + python cosmos_db_mongo_db_role_definition_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py new file mode 100644 index 000000000000..9cd7160179a2 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_percentile_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.percentile.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + filter="$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPercentileGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py new file mode 100644 index 000000000000..75f1b0cf80e1 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_percentile_source_target_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.percentile_source_target.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + source_region="West Central US", + target_region="East US", + filter="$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py new file mode 100644 index 000000000000..bf22b1bc5dcf --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_percentile_target_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.percentile_target.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + target_region="East US", + filter="$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py similarity index 95% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py index 6449b6a607fa..b135457030cd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python deletes_a_private_endpoint_connection_with_a_given_name..py + python cosmos_db_private_endpoint_connection_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py new file mode 100644 index 000000000000..a6928df8cd34 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_private_endpoint_connection_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.get( + resource_group_name="rg1", + account_name="ddb1", + private_endpoint_connection_name="privateEndpointConnectionName", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/gets_private_endpoint_connection..py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/gets_private_endpoint_connection..py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py index 25833f8e030a..805bb8f6413c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/gets_private_endpoint_connection..py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python gets_private_endpoint_connection..py + python cosmos_db_private_endpoint_connection_list_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py similarity index 95% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py index 7e91c1b11e3d..a0b5c067a5cd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python approve_or_reject_a_private_endpoint_connection_with_a_given_name..py + python cosmos_db_private_endpoint_connection_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py new file mode 100644 index 000000000000..609bb1c115cd --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_private_link_resource_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.get( + resource_group_name="rg1", + account_name="ddb1", + group_name="sql", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPrivateLinkResourceGet.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py new file mode 100644 index 000000000000..01f560b29ec5 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_db_private_link_resource_list_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.list_by_database_account( + resource_group_name="rg1", + account_name="ddb1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.json.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py similarity index 97% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.json.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py index 1d23fffaac60..aab776d89268 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.json.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_restore_database_account_create_update.json.py + python cosmos_db_restore_database_account_create_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py similarity index 97% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_create_update.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py index ed0095e21141..0cd5d936f132 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_client_encryption_key_create_update.py + python cosmos_db_sql_client_encryption_key_create_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py index 214a3698462e..2c5f09817d46 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_client_encryption_key_get.py + python cosmos_db_sql_client_encryption_key_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_keys_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_keys_list.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py index 3797a7474be0..453eae1c9258 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_keys_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_client_encryption_keys_list.py + python cosmos_db_sql_client_encryption_keys_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py index c07825ee2405..44b802466eb4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py @@ -29,14 +29,14 @@ def main(): subscription_id="subid", ) - response = client.graph_resources.begin_delete_graph_resource( + response = client.sql_resources.begin_delete_sql_database( resource_group_name="rg1", account_name="ddb1", - graph_name="graphName", + database_name="databaseName", ).result() print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py index f97c2b8f16b4..67468d301f59 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py @@ -29,14 +29,14 @@ def main(): subscription_id="subid", ) - response = client.graph_resources.get_graph( + response = client.sql_resources.get_sql_database( resource_group_name="rg1", account_name="ddb1", - graph_name="graphName", + database_name="databaseName", ) print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py index 8d282d994847..e55aec066d38 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py @@ -29,7 +29,7 @@ def main(): subscription_id="subid", ) - response = client.graph_resources.list_graphs( + response = client.sql_resources.list_sql_databases( resource_group_name="rgName", account_name="ddb1", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_create.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_create.py index c84ac27f8fec..4d6eadd2980a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python sql_dedicated_gateway_service_create.py + python cosmos_db_sql_dedicated_gateway_service_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_delete.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_delete.py index 402f5d9e452a..af370f476bc6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python sql_dedicated_gateway_service_delete.py + python cosmos_db_sql_dedicated_gateway_service_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_get.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_get.py index 6fe8b6e12f94..360682fbc0c2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python sql_dedicated_gateway_service_get.py + python cosmos_db_sql_dedicated_gateway_service_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_collection_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py similarity index 96% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_collection_backup_information.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py index a6ed8773ba78..ad71144f5993 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_collection_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_table_collection_backup_information.py + python cosmos_db_table_backup_information.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_replace.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py similarity index 97% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_replace.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py index 5f409dea1b25..f921ce2ed9a5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_replace.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_table_replace.py + python cosmos_db_table_create_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py new file mode 100644 index 000000000000..2ad8a9d51f39 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_dbp_key_range_id_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.partition_key_range_id.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + database_rid="databaseRid", + collection_rid="collectionRid", + partition_key_range_id="0", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py new file mode 100644 index 000000000000..1d708b328c42 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.cosmosdb import CosmosDBManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-cosmosdb +# USAGE + python cosmos_dbp_key_range_id_region_get_metrics.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.partition_key_range_id_region.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + region="West US", + database_rid="databaseRid", + collection_rid="collectionRid", + partition_key_range_id="0", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json +if __name__ == "__main__": + main()